]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Added gnu90 test
authorYann Collet <yann.collet.73@gmail.com>
Thu, 5 May 2016 01:01:13 +0000 (03:01 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Thu, 5 May 2016 01:01:13 +0000 (03:01 +0200)
work-around : disabled automatic selection of huff0 quad-decoder (see #173)

.travis.yml
Makefile
lib/compress/zstd_compress.c
lib/decompress/huf_decompress.c
programs/paramgrill.c

index fda0b05b55c6819bc82736ec8b7e2b65e4ad4483..b7faed3eba1037220f7a13b705f1764aaeccb6b9 100644 (file)
@@ -12,6 +12,7 @@ env:
   - ZSTD_TRAVIS_CI_ENV=cmaketest
   - ZSTD_TRAVIS_CI_ENV=clangtest  
   - ZSTD_TRAVIS_CI_ENV=gpptest  
+  - ZSTD_TRAVIS_CI_ENV=gnu90test
   - ZSTD_TRAVIS_CI_ENV=armtest-w-install  
   - ZSTD_TRAVIS_CI_ENV=test  
   - ZSTD_TRAVIS_CI_ENV="-C programs test32"  
index 0f6363cf5006151704d1bafa595e76a0121d557c..5aad596d14851baa19ac19f03720e370a4a8fb8a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -88,6 +88,9 @@ clangtest: clean
 gpptest: clean
        $(MAKE) all CC=g++ CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
 
+gnu90test: clean
+       $(MAKE) all CFLAGS="-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wstrict-prototypes -Wundef -Werror"
+
 bmix64test: clean
        CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(PRGDIR) test
 
index 7b07eb454b514af2f013a2d602a6b6b039694029..1bb75c68ccff56d268162d21711a65163f8dbebf 100644 (file)
@@ -852,7 +852,7 @@ MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const B
     static const BYTE* g_start = NULL;
     const U32 pos = (U32)(literals - g_start);
     if (g_start==NULL) g_start = literals;
-    if ((pos > 5810300) && (pos < 5810500))
+    if ((pos > 2587900) && (pos < 2588050))
         printf("Cpos %6u :%5u literals & match %3u bytes at distance %6u \n",
                pos, (U32)litLength, (U32)matchCode+MINMATCH, (U32)offsetCode);
 #endif
index 79e6fbae37d03b5bbcdc0d5504ac6a6ee7a1337a..7637bd9413f1b55b0e472ce7c19f6aca54e09526 100644 (file)
@@ -1118,7 +1118,7 @@ size_t HUF_decompress (void* dst, size_t dstSize, const void* cSrc, size_t cSrcS
     Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 
     if (Dtime[1] < Dtime[0]) algoNb = 1;
-    if (Dtime[2] < Dtime[algoNb]) algoNb = 2;
+    //if (Dtime[2] < Dtime[algoNb]) algoNb = 2;
 
     return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
 
index f36a6916f512e7dcc466d54cdf49677607bac345..566197f5583e2f7d58436d4910f854c06b205488 100644 (file)
@@ -44,6 +44,9 @@
 
 #if defined(_MSC_VER)
 #  define snprintf _snprintf    /* snprintf unsupported by Visual <= 2012 */
+#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
+#else
+#  define snprintf(b, s, ...) sprintf(b, __VA_ARGS__)
 #endif