mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 15:53:51 +01:00
Style: adds Cpp11BracedListStyle: Block
This commit is contained in:
@@ -101,7 +101,7 @@ const char* detectByOpenGL(FFlist* gpus) {
|
||||
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
|
||||
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
|
||||
gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET;
|
||||
gpu->dedicated = gpu->shared = (FFGPUMemory) {0, 0};
|
||||
gpu->dedicated = gpu->shared = (FFGPUMemory) { 0, 0 };
|
||||
gpu->deviceId = 0;
|
||||
|
||||
FF_DEBUG("OpenGL reported renderer='%s', vendor='%s', version='%s'",
|
||||
|
||||
@@ -255,7 +255,7 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
|
||||
FF_DEBUG("Using Overdrive8 API (odVersion=%d)", odVersion);
|
||||
|
||||
if (result.frequency) {
|
||||
ADLOD8CurrentSetting currentSetting = {.count = OD8_COUNT};
|
||||
ADLOD8CurrentSetting currentSetting = { .count = OD8_COUNT };
|
||||
int status = adlData.ffADL2_Overdrive8_Current_Setting_Get(adlData.apiHandle, device->iAdapterIndex, ¤tSetting);
|
||||
FF_DEBUG("ADL2_Overdrive8_Current_Setting_Get returned %s (%d)", ffAdlStatusToString(status), status);
|
||||
if (status == ADL_OK) {
|
||||
|
||||
@@ -168,7 +168,7 @@ const char* ffDrmDetectAmdgpu(const FFGPUOptions* options, FFGPUResult* gpu, con
|
||||
const char* ffDrmDetectI915(FFGPUResult* gpu, int fd) {
|
||||
{
|
||||
int value;
|
||||
drm_i915_getparam_t getparam = {.param = I915_PARAM_EU_TOTAL, .value = &value};
|
||||
drm_i915_getparam_t getparam = { .param = I915_PARAM_EU_TOTAL, .value = &value };
|
||||
if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &getparam) >= 0) {
|
||||
gpu->coreCount = value;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe
|
||||
uint32_t sensorCount = ARRAY_SIZE(sensors);
|
||||
if (igclData.ffctlEnumTemperatureSensors(device, &sensorCount, sensors) == CTL_RESULT_SUCCESS && sensorCount > 0) {
|
||||
for (uint32_t iSensor = 0; iSensor < sensorCount; iSensor++) {
|
||||
ctl_temp_properties_t props = {.Size = sizeof(props)};
|
||||
ctl_temp_properties_t props = { .Size = sizeof(props) };
|
||||
// The official sample code does not set Version
|
||||
// https://github.com/intel/drivers.gpu.control-library/blob/1bbacbf3814f2fd0d2b930cdf42fad83f3628db9/Samples/Telemetry_Samples/Sample_TelemetryAPP.cpp#L256
|
||||
if (igclData.ffctlTemperatureGetProperties(sensors[iSensor], &props) == CTL_RESULT_SUCCESS) {
|
||||
@@ -211,7 +211,7 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe
|
||||
uint32_t domainCount = ARRAY_SIZE(domains);
|
||||
if (igclData.ffctlEnumFrequencyDomains(device, &domainCount, domains) == CTL_RESULT_SUCCESS && domainCount > 0) {
|
||||
double maxValue = 0;
|
||||
ctl_freq_properties_t props = {.Size = sizeof(props), .Version = 0};
|
||||
ctl_freq_properties_t props = { .Size = sizeof(props), .Version = 0 };
|
||||
for (uint32_t iDomain = 0; iDomain < domainCount; iDomain++) {
|
||||
if (igclData.ffctlFrequencyGetProperties(domains[iDomain], &props) == CTL_RESULT_SUCCESS) {
|
||||
if (props.type == CTL_FREQ_DOMAIN_GPU && props.max > maxValue) {
|
||||
|
||||
@@ -253,7 +253,7 @@ const char* ffDetectNvidiaGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverR
|
||||
}
|
||||
|
||||
if (result.memory) {
|
||||
nvmlMemory_v2_t memory = {.version = nvmlMemory_v2};
|
||||
nvmlMemory_v2_t memory = { .version = nvmlMemory_v2 };
|
||||
if (nvmlData.ffnvmlDeviceGetMemoryInfo_v2(device, &memory) == NVML_SUCCESS) {
|
||||
result.memory->total = memory.used + memory.free;
|
||||
result.memory->used = memory.used;
|
||||
|
||||
@@ -286,7 +286,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
|
||||
|
||||
if (gpu->type == FF_GPU_TYPE_UNKNOWN && adapterLuid > 0) {
|
||||
FF_DEBUG("Trying to determine GPU type using D3DKMT APIs");
|
||||
D3DKMT_OPENADAPTERFROMLUID openAdapterFromLuid = {.AdapterLuid = *(LUID*) &adapterLuid};
|
||||
D3DKMT_OPENADAPTERFROMLUID openAdapterFromLuid = { .AdapterLuid = *(LUID*) &adapterLuid };
|
||||
if (NT_SUCCESS(D3DKMTOpenAdapterFromLuid(&openAdapterFromLuid))) {
|
||||
FF_DEBUG("Successfully opened adapter from LUID");
|
||||
|
||||
@@ -332,7 +332,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
|
||||
D3DKMT_QUERYSTATISTICS queryStatistics = {
|
||||
.Type = D3DKMT_QUERYSTATISTICS_NODE2, // Windows 11 (22H2) and later
|
||||
.AdapterLuid = *(LUID*) &adapterLuid,
|
||||
.QueryNode2 = {.PhysicalAdapterIndex = 0, .NodeOrdinal = (UINT16) nodeIdx},
|
||||
.QueryNode2 = { .PhysicalAdapterIndex = 0, .NodeOrdinal = (UINT16) nodeIdx },
|
||||
};
|
||||
if (NT_SUCCESS(D3DKMTQueryStatistics(&queryStatistics))) {
|
||||
gpu->frequency = (uint32_t) (queryStatistics.QueryResult.NodeInformation.NodePerfData.MaxFrequency / 1000 / 1000);
|
||||
@@ -344,7 +344,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
|
||||
}
|
||||
}
|
||||
|
||||
D3DKMT_CLOSEADAPTER closeAdapter = {.hAdapter = openAdapterFromLuid.hAdapter};
|
||||
D3DKMT_CLOSEADAPTER closeAdapter = { .hAdapter = openAdapterFromLuid.hAdapter };
|
||||
(void) D3DKMTCloseAdapter(&closeAdapter);
|
||||
openAdapterFromLuid.hAdapter = (D3DKMT_HANDLE) {};
|
||||
FF_DEBUG("Closed adapter handle");
|
||||
@@ -357,7 +357,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
|
||||
D3DKMT_QUERYSTATISTICS queryStatistics = {
|
||||
.Type = D3DKMT_QUERYSTATISTICS_PHYSICAL_ADAPTER, // Windows 10 (1803) and later
|
||||
.AdapterLuid = *(LUID*) &adapterLuid,
|
||||
.QueryPhysAdapter = {.PhysicalAdapterIndex = 0},
|
||||
.QueryPhysAdapter = { .PhysicalAdapterIndex = 0 },
|
||||
};
|
||||
if (NT_SUCCESS(D3DKMTQueryStatistics(&queryStatistics)) &&
|
||||
queryStatistics.QueryResult.PhysAdapterInformation.AdapterPerfData.Temperature != 0) {
|
||||
|
||||
@@ -55,7 +55,7 @@ extern "C" const char* ffGPUDetectTypeWithDXCore(LUID adapterLuid, FFGPUResult*
|
||||
return "Failed to get adapter by LUID";
|
||||
}
|
||||
|
||||
on_scope_exit releaseAdapter{[adapter] { adapter->Release(); }};
|
||||
on_scope_exit releaseAdapter{ [adapter] { adapter->Release(); } };
|
||||
|
||||
bool isIntegrated = false;
|
||||
hr = adapter->GetProperty(DXCoreAdapterProperty::IsIntegrated, sizeof(isIntegrated), &isIntegrated);
|
||||
|
||||
@@ -91,7 +91,7 @@ const char* ffGPUDetectWsl2(const FFGPUOptions* options, FFlist* gpus) {
|
||||
|
||||
const char* vendorStr = NULL;
|
||||
|
||||
D3DKMT_QUERY_DEVICE_IDS deviceIds = {.PhysicalAdapterIndex = 0};
|
||||
D3DKMT_QUERY_DEVICE_IDS deviceIds = { .PhysicalAdapterIndex = 0 };
|
||||
if (NT_SUCCESS(D3DKMTQueryAdapterInfo(dxg, &(D3DKMT_QUERYADAPTERINFO) {
|
||||
.hAdapter = adapter->hAdapter,
|
||||
.Type = KMTQAITYPE_PHYSICALADAPTERDEVICEIDS,
|
||||
@@ -274,7 +274,7 @@ const char* ffGPUDetectWsl2(const FFGPUOptions* options, FFlist* gpus) {
|
||||
D3DKMT_QUERYSTATISTICS queryStatistics = {
|
||||
.Type = D3DKMT_QUERYSTATISTICS_NODE2,
|
||||
.AdapterLuid = adapter->AdapterLuid,
|
||||
.QueryNode2 = {.PhysicalAdapterIndex = 0, .NodeOrdinal = (UINT16) nodeIdx},
|
||||
.QueryNode2 = { .PhysicalAdapterIndex = 0, .NodeOrdinal = (UINT16) nodeIdx },
|
||||
};
|
||||
if (NT_SUCCESS(D3DKMTQueryStatistics(dxg, &queryStatistics))) {
|
||||
gpu->frequency = (uint32_t) (queryStatistics.QueryResult.NodeInformation.NodePerfData.MaxFrequency / 1000 / 1000);
|
||||
@@ -290,7 +290,7 @@ const char* ffGPUDetectWsl2(const FFGPUOptions* options, FFlist* gpus) {
|
||||
D3DKMT_QUERYSTATISTICS queryStatistics = {
|
||||
.Type = D3DKMT_QUERYSTATISTICS_PHYSICAL_ADAPTER,
|
||||
.AdapterLuid = adapter->AdapterLuid,
|
||||
.QueryPhysAdapter = {.PhysicalAdapterIndex = 0},
|
||||
.QueryPhysAdapter = { .PhysicalAdapterIndex = 0 },
|
||||
};
|
||||
if (NT_SUCCESS(D3DKMTQueryStatistics(dxg, &queryStatistics)) &&
|
||||
queryStatistics.QueryResult.PhysAdapterInformation.AdapterPerfData.Temperature != 0) {
|
||||
@@ -325,7 +325,7 @@ const char* ffGPUDetectWsl2(const FFGPUOptions* options, FFlist* gpus) {
|
||||
(unsigned) gpu->type,
|
||||
(unsigned long) gpu->deviceId);
|
||||
|
||||
if (NT_SUCCESS(D3DKMTCloseAdapter(dxg, &(D3DKMT_CLOSEADAPTER) {.hAdapter = adapter->hAdapter}))) {
|
||||
if (NT_SUCCESS(D3DKMTCloseAdapter(dxg, &(D3DKMT_CLOSEADAPTER) { .hAdapter = adapter->hAdapter }))) {
|
||||
FF_DEBUG("Closed adapter #%u successfully", i);
|
||||
} else {
|
||||
FF_DEBUG("Failed to close adapter #%u: %s", i, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user