]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fixed a few minor visual analyzer warnings
authorYann Collet <yann.collet.73@gmail.com>
Sun, 5 Jul 2015 07:20:56 +0000 (23:20 -0800)
committerYann Collet <yann.collet.73@gmail.com>
Sun, 5 Jul 2015 07:20:56 +0000 (23:20 -0800)
programs/datagen.c
programs/fileio.c
programs/fullbench.c
programs/fuzzer.c
programs/zstdcli.c

index 9df9da84197bb68d162a760804445ae6b862cde8..50daaa0772dab3c1ab1a715b51d5e66663a80654 100644 (file)
@@ -56,7 +56,7 @@
 #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
 #  include <fcntl.h>   /* _O_BINARY */
 #  include <io.h>      /* _setmode, _isatty */
-#  define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY)
+#  define SET_BINARY_MODE(file) {int unused = _setmode(_fileno(file), _O_BINARY); (void)unused; }
 #else
 #  define SET_BINARY_MODE(file)
 #endif
index 04d938fa4a384542680cd8b2dca5a1c9e19e94a5..ee23dc01cf9182bf989f8ef57ee3cc00ac7f8d3a 100644 (file)
@@ -65,7 +65,7 @@
 #  ifdef __MINGW32__
    /* int _fileno(FILE *stream);   // seems no longer useful // MINGW somehow forgets to include this windows declaration into <stdio.h> */
 #  endif
-#  define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY)
+#  define SET_BINARY_MODE(file) { int unused = _setmode(_fileno(file), _O_BINARY); (void)unused; }
 #  define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
 #else
 #  include <unistd.h>   /* isatty */
index 11d9b62d1df3072184855bdb4c905956af8212c4..b7ecc8db1dc82dc27b2d15714ad4ec6800ecc4e6 100644 (file)
@@ -653,7 +653,7 @@ int main(int argc, char** argv)
         result = benchSample(benchNb);
     else result = benchFiles(argv+filenamesStart, argc-filenamesStart, benchNb);
 
-    if (main_pause) { printf("press enter...\n"); getchar(); }
+    if (main_pause) { int unused; printf("press enter...\n"); unused = getchar(); (void)unused; }
 
     return result;
 }
index 8d48dcd2dbd69ead90ab1d7bcb05ca730e6c4367..db4bc65fa1d4c94332bfee039c718f4baa6b1c4c 100644 (file)
@@ -512,8 +512,10 @@ int main(int argc, char** argv)
         result = fuzzerTests(seed, nbTests, testNb, ((double)proba) / 100);
     if (mainPause)
     {
+        int unused;
         DISPLAY("Press Enter \n");
-        getchar();
+        unused = getchar();
+        (void)unused;
     }
     return result;
 }
index e39266d456335265197c23f46039a6e9727e4196..7687218c4b57c56ec5b789f4a12ad5fbe273b38b 100644 (file)
@@ -150,8 +150,10 @@ static int badusage(const char* programName)
 
 static void waitEnter(void)
 {
+    int unused;
     DISPLAY("Press enter to continue...\n");
-    getchar();
+    unused = getchar();
+    (void)unused;
 }