aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-03 20:44:39 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-03 20:44:39 +0000
commita38c819b763b78d26f983629baa035658670b611 (patch)
treef566dee2b133d2aeff3fd78bc2e93a579f24ac3e /bench
parentc74ab1813013b169ad500fcf1fa62be551041442 (diff)
Fix two warnings in bench timers.
Diffstat (limited to 'bench')
-rw-r--r--bench/BenchSysTimer_windows.cpp7
-rw-r--r--bench/BenchSysTimer_windows.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/bench/BenchSysTimer_windows.cpp b/bench/BenchSysTimer_windows.cpp
index 103d1b55cd..e51d346033 100644
--- a/bench/BenchSysTimer_windows.cpp
+++ b/bench/BenchSysTimer_windows.cpp
@@ -42,7 +42,7 @@ void BenchSysTimer::startCpu() {
double BenchSysTimer::endCpu() {
ULONGLONG end_cpu = winCpuTime();
- return (end_cpu - this->fStartCpu) / 10000;
+ return static_cast<double>((end_cpu - this->fStartCpu)) / 10000.0L;
}
double BenchSysTimer::endWall() {
LARGE_INTEGER end_wall;
@@ -55,8 +55,9 @@ double BenchSysTimer::endWall() {
LARGE_INTEGER frequency;
if (0 == ::QueryPerformanceFrequency(&frequency)) {
- return 0;
+ return 0.0L;
} else {
- return (double)ticks_elapsed.QuadPart / frequency.QuadPart * 1000;
+ return static_cast<double>(ticks_elapsed.QuadPart)
+ / static_cast<double>(frequency.QuadPart * 1000);
}
}
diff --git a/bench/BenchSysTimer_windows.h b/bench/BenchSysTimer_windows.h
index b0f016aca2..c3d0c9b9c9 100644
--- a/bench/BenchSysTimer_windows.h
+++ b/bench/BenchSysTimer_windows.h
@@ -12,7 +12,7 @@
#define WIN32_LEAN_AND_MEAN 1
#include <Windows.h>
-struct BenchSysTimer {
+class BenchSysTimer {
public:
void startWall();
void startCpu();