From 3fa883706833087bf91e59246534a785bab09f0e Mon Sep 17 00:00:00 2001 From: jon-chuang Date: Fri, 14 Apr 2023 04:00:41 +0800 Subject: [PATCH] improve --- examples/common.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/common.cpp b/examples/common.cpp index 65fbb9bbd..49ce6e66a 100644 --- a/examples/common.cpp +++ b/examples/common.cpp @@ -37,15 +37,15 @@ int32_t get_num_physical_cores() { } } #elif defined(__APPLE__) && defined(__MACH__) - int num_physical_cores; + int32_t num_physical_cores; size_t len = sizeof(num_physical_cores); int result = sysctlbyname("hw.perflevel0.physicalcpu", &num_physical_cores, &len, NULL, 0); if (result == 0) { - return (int32_t) num_physical_cores; + return num_physical_cores; } result = sysctlbyname("hw.physicalcpu", &num_physical_cores, &len, NULL, 0); if (result == 0) { - return (int32_t) num_physical_cores; + return num_physical_cores; } #elif defined(_WIN32) SYSTEM_INFO sysinfo;