mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Global: replaces __attribute__ to C23 [[attribute]]
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "fastfetch.h"
|
||||
#include "detection/cpuusage/cpuusage.h"
|
||||
|
||||
const char* ffGetCpuUsageInfo(FF_A_UNUSED FFlist* cpuTimes) {
|
||||
const char* ffGetCpuUsageInfo([[maybe_unused]] FFlist* cpuTimes) {
|
||||
return "Not support on this platform";
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ static inline void kstatFreeWrap(kstat_ctl_t** pkc) {
|
||||
}
|
||||
|
||||
const char* ffGetCpuUsageInfo(FFlist* cpuTimes) {
|
||||
FF_A_CLEANUP(kstatFreeWrap) kstat_ctl_t* kc = kstat_open();
|
||||
[[gnu::cleanup(kstatFreeWrap)]] kstat_ctl_t* kc = kstat_open();
|
||||
if (!kc) {
|
||||
return "kstat_open() failed";
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ static const char* getInfoByNqsi(FFlist* cpuTimes) {
|
||||
return "NtQuerySystemInformation(SystemProcessorPerformanceInformation, nullptr) failed";
|
||||
}
|
||||
|
||||
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION* FF_AUTO_FREE pinfo = (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION*) malloc(size);
|
||||
FF_AUTO_FREE SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION* pinfo = (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION*) malloc(size);
|
||||
if (!NT_SUCCESS(NtQuerySystemInformation(SystemProcessorPerformanceInformation, pinfo, size, &size))) {
|
||||
return "NtQuerySystemInformation(SystemProcessorPerformanceInformation, size) failed";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user