get_cpu_count: quiet -Wshorten-64-to-32 warnings
sysconf returns a long; cast (unsigned) dwNumberOfProcessors to int for good measure Change-Id: I1f181d7bd9a060c0898db41f66a5065394afdc4e
This commit is contained in:
parent
4d1540f8ce
commit
d6d3d4ba31
@ -37,9 +37,9 @@ static int get_cpu_count() {
|
||||
|
||||
#if HAVE_UNISTD_H && !defined(__OS2__)
|
||||
#if defined(_SC_NPROCESSORS_ONLN)
|
||||
core_count = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
core_count = (int)sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#elif defined(_SC_NPROC_ONLN)
|
||||
core_count = sysconf(_SC_NPROC_ONLN);
|
||||
core_count = (int)sysconf(_SC_NPROC_ONLN);
|
||||
#endif
|
||||
#elif defined(_WIN32)
|
||||
{
|
||||
@ -61,7 +61,7 @@ static int get_cpu_count() {
|
||||
GetSystemInfo(&sysinfo);
|
||||
#endif
|
||||
|
||||
core_count = sysinfo.dwNumberOfProcessors;
|
||||
core_count = (int)sysinfo.dwNumberOfProcessors;
|
||||
}
|
||||
#elif defined(__OS2__)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user