diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-04-28 21:38:57 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-04-28 21:38:57 +0200 |
| commit | 8bbbb381017811e36c43fd08b802ec6c293e4255 (patch) | |
| tree | 684a104953e7485e5767ca2d7ec4d40937947593 /bench/benchmark.h | |
| parent | benchmark-func: use X-macros for function-listing (diff) | |
| download | libzahl-8bbbb381017811e36c43fd08b802ec6c293e4255.tar.gz libzahl-8bbbb381017811e36c43fd08b802ec6c293e4255.tar.bz2 libzahl-8bbbb381017811e36c43fd08b802ec6c293e4255.tar.xz | |
Fix warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'bench/benchmark.h')
| -rw-r--r-- | bench/benchmark.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bench/benchmark.h b/bench/benchmark.h index 6d6aa87..cb42777 100644 --- a/bench/benchmark.h +++ b/bench/benchmark.h @@ -101,11 +101,10 @@ rdtsc_join(unsigned int low, unsigned int high) rdtsc(&end_low, &end_high);\ dur_cycles = rdtsc_join(end_low, end_high);\ dur_cycles -= rdtsc_join(start_low, start_high);\ - dur_seconds = dur_cycles;\ - dur_seconds /= freq;\ - dur_seconds /= 1000;\ - dur_seconds -= dur.tv_sec = (int)dur_seconds;\ - dur.tv_nsec = dur_seconds * 1000000000L;\ + dur_seconds = (double)dur_cycles;\ + dur_seconds /= 1000 * (double)freq;\ + dur_seconds -= (double)(dur.tv_sec = (int)dur_seconds);\ + dur.tv_nsec = (long int)(dur_seconds * 1000000000L);\ } while (0) #elif defined(USE_CLOCK) # define TIC (start = clock()) @@ -130,5 +129,5 @@ rdtsc_join(unsigned int low, unsigned int high) #endif -#define TICKS (dur.tv_sec * 1000000000ULL + dur.tv_nsec) +#define TICKS ((unsigned long long int)(dur.tv_sec) * 1000000000ULL + (unsigned long long int)(dur.tv_nsec)) #define STIME (sprintf(timebuf, "%lli.%09li", (long long)(dur.tv_sec), dur.tv_nsec), timebuf) |
