diff options
author | Yann Collet <cyan@fb.com> | 2017-09-10 21:32:38 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2017-09-10 21:32:38 (GMT) |
commit | a30cba08f489c07e0d6085248287cd5dcc901b30 (patch) | |
tree | 35b768df854d5764d6232de84ad2fe5266f137ca /programs | |
parent | a2b4f732f4ab941dbd3108fb3c36c3afc54c47ee (diff) | |
download | lz4-a30cba08f489c07e0d6085248287cd5dcc901b30.zip lz4-a30cba08f489c07e0d6085248287cd5dcc901b30.tar.gz lz4-a30cba08f489c07e0d6085248287cd5dcc901b30.tar.bz2 |
fixed a bunch of -Wcomma warnings
reported by @rvandermeulen (#398)
Diffstat (limited to 'programs')
-rw-r--r-- | programs/bench.c | 5 | ||||
-rw-r--r-- | programs/datagen.c | 5 | ||||
-rw-r--r-- | programs/lz4cli.c | 7 |
3 files changed, 13 insertions, 4 deletions
diff --git a/programs/bench.c b/programs/bench.c index 05ddaff..5c83d59 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -428,7 +428,10 @@ static void BMK_loadFiles(void* buffer, size_t bufferSize, f = fopen(fileNamesTable[n], "rb"); if (f==NULL) EXM_THROW(10, "impossible to open file %s", fileNamesTable[n]); DISPLAYUPDATE(2, "Loading %s... \r", fileNamesTable[n]); - if (fileSize > bufferSize-pos) fileSize = bufferSize-pos, nbFiles=n; /* buffer too small - stop after this file */ + if (fileSize > bufferSize-pos) { /* buffer too small - stop after this file */ + fileSize = bufferSize-pos; + nbFiles=n; + } { size_t const readSize = fread(((char*)buffer)+pos, 1, (size_t)fileSize, f); if (readSize != (size_t)fileSize) EXM_THROW(11, "could not read %s", fileNamesTable[n]); pos += readSize; } diff --git a/programs/datagen.c b/programs/datagen.c index a61afc0..7285d69 100644 --- a/programs/datagen.c +++ b/programs/datagen.c @@ -119,7 +119,10 @@ void RDG_genBlock(void* buffer, size_t buffSize, size_t prefixSize, double match } /* init */ - if (pos==0) buffPtr[0] = RDG_genChar(seed, lt), pos=1; + if (pos==0) { + buffPtr[0] = RDG_genChar(seed, lt); + pos=1; + } /* Generate compressible data */ while (pos < buffSize) diff --git a/programs/lz4cli.c b/programs/lz4cli.c index b4a3c14..ff489c6 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -259,8 +259,11 @@ static int exeNameMatch(const char* exeName, const char* test) static unsigned readU32FromChar(const char** stringPtr) { unsigned result = 0; - while ((**stringPtr >='0') && (**stringPtr <='9')) - result *= 10, result += **stringPtr - '0', (*stringPtr)++ ; + while ((**stringPtr >='0') && (**stringPtr <='9')) { + result *= 10; + result += **stringPtr - '0'; + (*stringPtr)++ ; + } if ((**stringPtr=='K') || (**stringPtr=='M')) { result <<= 10; if (**stringPtr=='M') result <<= 10; |