From fc7a0393a4148ad3c33f592d2ada828597d915bf Mon Sep 17 00:00:00 2001 From: knc1 Date: Thu, 1 Feb 2018 17:15:22 -0600 Subject: [PATCH 1/2] Remove unused tz argument in gettimeofday call. Passing null as the tz argument to gettimeofday on Linux is the current recommendation. It also eleminates the compiler "unused tz" error. --- source/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/util.c b/source/util.c index 1b60978..83426e2 100644 --- a/source/util.c +++ b/source/util.c @@ -47,9 +47,8 @@ * \return The real time clock of the operating system in seconds. */ double cloog_util_rtclock() { - struct timezone Tzp; struct timeval Tp; - int stat = gettimeofday(&Tp, &Tzp); + int stat = gettimeofday(&Tp, NULL); if (stat != 0) cloog_msg(NULL, CLOOG_WARNING, "Error return from gettimeofday: %d", stat); return (Tp.tv_sec + Tp.tv_usec*1.0e-6); From 78a4c67c250843c8d3590f4b27a07d83320ae4f2 Mon Sep 17 00:00:00 2001 From: knc1 Date: Thu, 1 Feb 2018 17:20:38 -0600 Subject: [PATCH 2/2] Fix calculation of fractional seconds. --- source/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/util.c b/source/util.c index 83426e2..d35bb99 100644 --- a/source/util.c +++ b/source/util.c @@ -51,5 +51,5 @@ double cloog_util_rtclock() { int stat = gettimeofday(&Tp, NULL); if (stat != 0) cloog_msg(NULL, CLOOG_WARNING, "Error return from gettimeofday: %d", stat); - return (Tp.tv_sec + Tp.tv_usec*1.0e-6); + return (Tp.tv_sec + Tp.tv_usec/1.0e-6); }