Fixed : some minor Visual warnings
authorYann Collet <yann.collet.73@gmail.com>
Sun, 30 Nov 2014 11:58:00 +0000 (12:58 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Sun, 30 Nov 2014 11:58:00 +0000 (12:58 +0100)
lz4.c
lz4hc.c
programs/Makefile

diff --git a/lz4.c b/lz4.c
index 9439b36..fb84955 100644 (file)
--- a/lz4.c
+++ b/lz4.c
@@ -369,7 +369,7 @@ static unsigned LZ4_NbCommonBytes (register size_t val)
         {
 #       if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT)
             unsigned long r = 0;
-            _BitScanReverse( &r, val );
+            _BitScanReverse( &r, (unsigned long)val );
             return (unsigned)(r>>3);
 #       elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT)
             return (__builtin_clz(val) >> 3);
diff --git a/lz4hc.c b/lz4hc.c
index a798cab..89f0db0 100644 (file)
--- a/lz4hc.c
+++ b/lz4hc.c
@@ -57,6 +57,10 @@ You can contact the author at :
 #  pragma clang diagnostic ignored "-Wunused-function"
 #endif
 
+#if defined(_MSC_VER)    /* Visual Studio */
+#  pragma warning(disable : 4201)        /* disable: C4201: unnamed struct/union*/
+#endif
+
 
 /**************************************
    Common LZ4 definition
index fcfb32c..8a3ed95 100644 (file)
@@ -193,7 +193,7 @@ test-mem: lz4 datagen fuzzer frametest
        ./datagen -g16MB > tmp
        valgrind --leak-check=yes ./lz4 -9 -B5D -f tmp /dev/null
        ./datagen -g256MB > tmp
-       valgrind --leak-check=yes ./lz4 -B4D -f tmp /dev/null
+       valgrind --leak-check=yes ./lz4 -B4D -f -vq tmp /dev/null
        rm tmp
        valgrind --leak-check=yes ./fuzzer -i50 -t0
        valgrind --leak-check=yes ./frametest -i100