From 0cc38c20be110f1729b35e56261d30447039aba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 15 Oct 2023 10:46:25 +0800 Subject: [PATCH] CPUUsage (FreeBSD): silence compiler warnings --- src/detection/cpuusage/cpuusage_bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/cpuusage/cpuusage_bsd.c b/src/detection/cpuusage/cpuusage_bsd.c index 6c58832e0..87c6757a7 100644 --- a/src/detection/cpuusage/cpuusage_bsd.c +++ b/src/detection/cpuusage/cpuusage_bsd.c @@ -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);