Global: replaces __attribute__ to C23 [[attribute]]

This commit is contained in:
李通洲
2026-07-10 21:13:03 +08:00
parent ba18705d2e
commit 61656a1a7a
229 changed files with 619 additions and 648 deletions
+1 -1
View File
@@ -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";
}
+1 -1
View File
@@ -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";
}
+1 -1
View File
@@ -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";
}