From 1f0d23546d5721fdd92883da4c4368dad3931393 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Tue, 24 Sep 2019 11:34:49 +0200 Subject: Autogen: Return unsigned int from GetParallelCPUCount() --- Source/cmQtAutoGenInitializer.cxx | 11 +++++------ 1 file 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 #include #include #include @@ -41,20 +40,20 @@ #include #include +#include #include 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(count, 1); - count = std::min(count, cmQtAutoGen::ParallelMax); + count = + cm::clamp(info.GetNumberOfPhysicalCPU(), 1u, cmQtAutoGen::ParallelMax); } return count; } -- cgit v0.12