Commit 5c6f7836 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'SystemInformation-fix-Wconversion'

a673a722 SystemInformation: Fix -Wconversion warning
Acked-by: Kitware Robot's avatarKitware Robot <>
Merge-request: !12
parents 06efe24e a673a722
......@@ -3421,9 +3421,10 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
// We want to record the total number of cores in this->NumberOfPhysicalCPU
// (checking only the first proc)
std::string Cores = this->ExtractValueFromCpuInfoFile(buffer, "cpu cores");
int NumberOfCoresPerSocket = atoi(Cores.c_str());
NumberOfCoresPerSocket = std::max(NumberOfCoresPerSocket, 1);
this->NumberOfPhysicalCPU = NumberOfCoresPerSocket * NumberOfSockets;
unsigned int NumberOfCoresPerSocket = (unsigned int)atoi(Cores.c_str());
NumberOfCoresPerSocket = std::max(NumberOfCoresPerSocket, 1u);
this->NumberOfPhysicalCPU =
NumberOfCoresPerSocket * (unsigned int)NumberOfSockets;
#else // __CYGWIN__
// does not have "physical id" entries, neither "cpu cores"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment