summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-09-24 09:34:49 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-09-25 08:31:06 (GMT)
commit1f0d23546d5721fdd92883da4c4368dad3931393 (patch)
tree100dcc55f5f1315887a2ad1f83ec25abcfcf2e00
parent6a05bd3fa6a3f4ecf45c4cc32abc616883998ff9 (diff)
downloadCMake-1f0d23546d5721fdd92883da4c4368dad3931393.zip
CMake-1f0d23546d5721fdd92883da4c4368dad3931393.tar.gz
CMake-1f0d23546d5721fdd92883da4c4368dad3931393.tar.bz2
Autogen: Return unsigned int from GetParallelCPUCount()
-rw-r--r--Source/cmQtAutoGenInitializer.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 9045722..d595eec 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -30,7 +30,6 @@
#include "cmake.h"
#include "cmsys/SystemInformation.hxx"
-#include <algorithm>
#include <cstddef>
#include <deque>
#include <initializer_list>
@@ -41,20 +40,20 @@
#include <utility>
#include <vector>
+#include <cm/algorithm>
#include <cm/memory>
namespace {
-std::size_t GetParallelCPUCount()
+unsigned int GetParallelCPUCount()
{
- static std::size_t count = 0;
+ static unsigned int count = 0;
// Detect only on the first call
if (count == 0) {
cmsys::SystemInformation info;
info.RunCPUCheck();
- count = info.GetNumberOfPhysicalCPU();
- count = std::max<std::size_t>(count, 1);
- count = std::min<std::size_t>(count, cmQtAutoGen::ParallelMax);
+ count =
+ cm::clamp(info.GetNumberOfPhysicalCPU(), 1u, cmQtAutoGen::ParallelMax);
}
return count;
}