From e129174d1df03c1405e16d96819051341fd4e3bb Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 20 Dec 2018 14:54:05 -0800 Subject: [PATCH] fixed shadowing of variable time some standard lib do define `time` as a global variable shadowing local declarations ... --- tests/paramgrill.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/paramgrill.c b/tests/paramgrill.c index 7c52a92e..9f8c894e 100644 --- a/tests/paramgrill.c +++ b/tests/paramgrill.c @@ -12,7 +12,7 @@ /*-************************************ * Dependencies **************************************/ -#include "util.h" /* Compiler options, UTIL_GetFileSize */ +#include "util.h" /* Ensure platform.h is compiled first; also : compiler options, UTIL_GetFileSize */ #include /* malloc */ #include /* fprintf, fopen, ftello64 */ #include /* strcmp */ @@ -24,7 +24,6 @@ #include "zstd.h" #include "datagen.h" #include "xxhash.h" -#include "util.h" #include "benchfn.h" #include "benchzstd.h" #include "zstd_errors.h" @@ -879,12 +878,12 @@ BMK_printWinner(FILE* f, const int cLevel, const BMK_benchResult_t result, const if(TIMED) { const U64 mn_in_ns = 60ULL * TIMELOOP_NANOSEC; - const U64 time = UTIL_clockSpanNano(g_time); - const U64 minutes = time / mn_in_ns; + const U64 time_ns = UTIL_clockSpanNano(g_time); + const U64 minutes = time_ns / mn_in_ns; fprintf(f, "%1lu:%2lu:%05.2f - ", (unsigned long) minutes / 60, (unsigned long) minutes % 60, - (double)(time - (minutes * mn_in_ns)) / TIMELOOP_NANOSEC ); + (double)(time_ns - (minutes * mn_in_ns)) / TIMELOOP_NANOSEC ); } fprintf(f, "/* %s */ ", lvlstr);