CPUUsage (FreeBSD): silence compiler warnings

This commit is contained in:
李通洲
2023-10-15 10:46:25 +08:00
parent d29931a91a
commit 0cc38c20be
+1 -1
View File
@@ -12,7 +12,7 @@ const char* ffGetCpuUsageInfo(FFlist* cpuTimes)
if(sysctlbyname("kern.cp_times", NULL, &neededLength, NULL, 0) != 0)
return "sysctlbyname(kern.cp_times, NULL) failed";
uint32_t coreCount = neededLength / (CPUSTATES * (uint32_t) sizeof(uint64_t));
uint32_t coreCount = (uint32_t) (neededLength / (CPUSTATES * sizeof(uint64_t)));
assert(coreCount > 0);
FF_AUTO_FREE uint64_t (*cpTimes)[CPUSTATES] = malloc(neededLength);