summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9089084)
The std::min() template function requires both arguments
to be of the same type.
But here we have the integer MAX_THREADS compared to a long:
long sysconf(int name);
So cast to integer and fix the compile.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
#else
# if defined(_SC_NPROCESSORS_ONLN)
#else
# if defined(_SC_NPROCESSORS_ONLN)
- return std::min(sysconf(_SC_NPROCESSORS_ONLN), MAX_THREADS);
+ return std::min((int)sysconf(_SC_NPROCESSORS_ONLN), MAX_THREADS);
# elif defined(__hpux)
struct pst_dynamic psd;
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
return 1;
# elif defined(__hpux)
struct pst_dynamic psd;
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
return 1;
- return std::min(psd.psd_proc_cnt, MAX_THREADS);
+ return std::min((int)psd.psd_proc_cnt, MAX_THREADS);