diff options
author | Dominic Hamon <dominichamon@users.noreply.github.com> | 2015-10-29 08:22:31 -0700 |
---|---|---|
committer | Dominic Hamon <dominichamon@users.noreply.github.com> | 2015-10-29 08:22:31 -0700 |
commit | 7c8d8c9dd7effb19337277320c3cd0491317d95b (patch) | |
tree | cc6a524aa3c8d03261a1c6cd233b058b03cb06d2 | |
parent | 87ab54ad6a728e5ff14a8d44108bbb4792195eac (diff) | |
parent | 65cd2bac6c5d1400c1a4014f8636484c03019875 (diff) | |
download | google-benchmark-7c8d8c9dd7effb19337277320c3cd0491317d95b.tar.gz |
Merge pull request #157 from guanqun/fix-static-cast
add static_cast to get rid of warnings for intel compiler on linux platform
-rw-r--r-- | src/sysinfo.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sysinfo.cc b/src/sysinfo.cc index a05d74c..d1f3120 100644 --- a/src/sysinfo.cc +++ b/src/sysinfo.cc @@ -127,7 +127,7 @@ void InitializeSystemInfo() { if (fd == -1) { perror(pname); if (!saw_mhz) { - cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); + cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond()); } return; } @@ -193,7 +193,7 @@ void InitializeSystemInfo() { cpuinfo_cycles_per_second = bogo_clock; } else { // 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) { @@ -229,7 +229,7 @@ void InitializeSystemInfo() { if (sysctlbyname(sysctl_path, &hz, &sz, nullptr, 0) != 0) { fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n", sysctl_path, strerror(errno)); - cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); + cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond()); } else { cpuinfo_cycles_per_second = hz; } @@ -275,7 +275,7 @@ void InitializeSystemInfo() { #else // Generic cycles per second counter - cpuinfo_cycles_per_second = EstimateCyclesPerSecond(); + cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond()); #endif } } // end namespace |