Commit a673a722 authored by Brad King's avatar Brad King

SystemInformation: Fix -Wconversion warning

Fix warning introduced by commit 9c4230b7 (SystemInformation: Fix counts
of logical and physical cores, 2017-01-26).
parent 9c4230b7
......@@ -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