Commit 65cd2bac by guanqun

add static_cast to get rid of warnings for intel compiler on linux platform

parent 87ab54ad
...@@ -127,7 +127,7 @@ void InitializeSystemInfo() { ...@@ -127,7 +127,7 @@ void InitializeSystemInfo() {
if (fd == -1) { if (fd == -1) {
perror(pname); perror(pname);
if (!saw_mhz) { if (!saw_mhz) {
cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
} }
return; return;
} }
...@@ -193,7 +193,7 @@ void InitializeSystemInfo() { ...@@ -193,7 +193,7 @@ void InitializeSystemInfo() {
cpuinfo_cycles_per_second = bogo_clock; cpuinfo_cycles_per_second = bogo_clock;
} else { } else {
// If we don't even have bogomips, we'll use the slow estimation. // If we don't even have bogomips, we'll use the slow estimation.
cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
} }
} }
if (num_cpus == 0) { if (num_cpus == 0) {
...@@ -229,7 +229,7 @@ void InitializeSystemInfo() { ...@@ -229,7 +229,7 @@ void InitializeSystemInfo() {
if (sysctlbyname(sysctl_path, &hz, &sz, nullptr, 0) != 0) { if (sysctlbyname(sysctl_path, &hz, &sz, nullptr, 0) != 0) {
fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n", fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
sysctl_path, strerror(errno)); sysctl_path, strerror(errno));
cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
} else { } else {
cpuinfo_cycles_per_second = hz; cpuinfo_cycles_per_second = hz;
} }
...@@ -275,7 +275,7 @@ void InitializeSystemInfo() { ...@@ -275,7 +275,7 @@ void InitializeSystemInfo() {
#else #else
// Generic cycles per second counter // Generic cycles per second counter
cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
#endif #endif
} }
} // end namespace } // end namespace
......
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