mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-31 18:13:38 +01:00
Refactor pci code
This commit is contained in:
@@ -63,10 +63,8 @@ static bool parseHwmonDir(FFstrbuf* dir, FFTempValue* value)
|
||||
return value->name.length > 0 || value->deviceClass.length > 0;
|
||||
}
|
||||
|
||||
const FFTempsResult* ffDetectTemps(const FFinstance* instance)
|
||||
const FFTempsResult* ffDetectTemps()
|
||||
{
|
||||
FF_UNUSED(instance)
|
||||
|
||||
static FFTempsResult result;
|
||||
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static bool init = false;
|
||||
|
||||
@@ -17,6 +17,6 @@ typedef struct FFTempsResult
|
||||
FFlist values; //List of FFTempValue
|
||||
} FFTempsResult;
|
||||
|
||||
const FFTempsResult* ffDetectTemps(const FFinstance* instance);
|
||||
const FFTempsResult* ffDetectTemps();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -177,10 +177,10 @@ static void detectVulkan(const FFinstance* instance, FFVulkanResult* result)
|
||||
|
||||
FFGPUResult* gpu = ffListAdd(&result->devices);
|
||||
ffStrbufInit(&gpu->vendor);
|
||||
ffStrbufInit(&gpu->name);
|
||||
ffStrbufInit(&gpu->device);
|
||||
ffStrbufInit(&gpu->driver);
|
||||
gpu->temperature = 0.0 / 0.0; //NaN, no way to detect temperature using vulkan
|
||||
ffStrbufAppendS(&gpu->name, physicalDeviceProperties.properties.deviceName);
|
||||
ffStrbufAppendS(&gpu->device, physicalDeviceProperties.properties.deviceName);
|
||||
}
|
||||
|
||||
//If the highest device version is lower than the instance version, use it as our vulkan version
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
#define FF_GPU_TEMP_UNSET (0/0.0)
|
||||
|
||||
typedef struct FFGPUResult
|
||||
{
|
||||
FFstrbuf vendor;
|
||||
FFstrbuf name;
|
||||
FFstrbuf device;
|
||||
FFstrbuf driver;
|
||||
double temperature;
|
||||
} FFGPUResult;
|
||||
|
||||
Reference in New Issue
Block a user