summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-04-06 21:16:23 (GMT)
committerYann Collet <cyan@fb.com>2018-04-06 21:16:23 (GMT)
commit133a50b780be302e726da772592e505d5b143f44 (patch)
tree948944b14c02cf53add2b258ff19cd9f8b063fc1 /programs
parentd759d0630003b0722e9389c2297c1856ba8e939f (diff)
downloadlz4-133a50b780be302e726da772592e505d5b143f44.zip
lz4-133a50b780be302e726da772592e505d5b143f44.tar.gz
lz4-133a50b780be302e726da772592e505d5b143f44.tar.bz2
fixed DISPLAYUPDATE()
wrong comparison, which was always overflowing (hence was always true) except when it was not (i386, reported by pmc) in which case it would never show any information.
Diffstat (limited to 'programs')
-rw-r--r--programs/lz4io.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index ca13316..6d0d0d0 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -94,9 +94,12 @@
static int g_displayLevel = 0; /* 0 : no display ; 1: errors ; 2 : + result + interaction + warnings ; 3 : + progression; 4 : + information */
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
- if (((clock_t)(g_time - clock()) > refreshRate) || (g_displayLevel>=4)) \
- { g_time = clock(); DISPLAY(__VA_ARGS__); \
- if (g_displayLevel>=4) fflush(stderr); } }
+ if ( ((clock() - g_time) > refreshRate) \
+ || (g_displayLevel>=4) ) { \
+ g_time = clock(); \
+ DISPLAY(__VA_ARGS__); \
+ if (g_displayLevel>=4) fflush(stderr); \
+ } }
static const clock_t refreshRate = CLOCKS_PER_SEC / 6;
static clock_t g_time = 0;