]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Stricter gnu90 tests
authorYann Collet <yann.collet.73@gmail.com>
Thu, 5 May 2016 02:59:53 +0000 (04:59 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Thu, 5 May 2016 02:59:53 +0000 (04:59 +0200)
Makefile
lib/common/zstd_internal.h
lib/legacy/zstd_v01.c
lib/legacy/zstd_v02.c
lib/legacy/zstd_v03.c

index 5aad596d14851baa19ac19f03720e370a4a8fb8a..7d1ae713f182c5ea914305695f5a43366229c58f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,7 +89,10 @@ 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"
+       $(MAKE) all CFLAGS="-std=gnu90 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wstrict-prototypes -Wundef -Wdeclaration-after-statement -Werror"
+
+c90test: clean
+       $(MAKE) all CFLAGS="-std=c90 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wstrict-prototypes -Wundef -Werror"   # will fail, due to // and long long
 
 bmix64test: clean
        CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(PRGDIR) test
index d5cc255a914c4af79c95696189b3c78ceddf3d14..4c9a7615ae6b7546a1e6ced4ffb39a87163808ab 100644 (file)
@@ -203,10 +203,10 @@ typedef struct {
     #include ".debug/zstd_stats.h"
 #else
     typedef struct { U32  unused; } ZSTD_stats_t;
-    MEM_STATIC void ZSTD_statsPrint(ZSTD_stats_t* stats, U32 searchLength) { (void)stats; (void)searchLength; };
-    MEM_STATIC void ZSTD_statsInit(ZSTD_stats_t* stats) { (void)stats; };
-    MEM_STATIC void ZSTD_statsResetFreqs(ZSTD_stats_t* stats) { (void)stats; };
-    MEM_STATIC void ZSTD_statsUpdatePrices(ZSTD_stats_t* stats, size_t litLength, const BYTE* literals, size_t offset, size_t matchLength) { (void)stats; (void)litLength; (void)literals; (void)offset; (void)matchLength; };
+    MEM_STATIC void ZSTD_statsPrint(ZSTD_stats_t* stats, U32 searchLength) { (void)stats; (void)searchLength; }
+    MEM_STATIC void ZSTD_statsInit(ZSTD_stats_t* stats) { (void)stats; }
+    MEM_STATIC void ZSTD_statsResetFreqs(ZSTD_stats_t* stats) { (void)stats; }
+    MEM_STATIC void ZSTD_statsUpdatePrices(ZSTD_stats_t* stats, size_t litLength, const BYTE* literals, size_t offset, size_t matchLength) { (void)stats; (void)litLength; (void)literals; (void)offset; (void)matchLength; }
 #endif
 
 typedef struct {
index 2fcf188851b2fb8f5dccebc18f36bbb680d13b73..d62367df29c23eb91101cfd2eaf128db6a01fed3 100644 (file)
@@ -407,7 +407,7 @@ FORCE_INLINE unsigned FSE_highbit32 (register U32 val)
 
 static U32 FSE_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
 
-#define FSE_DECODE_TYPE FSE_TYPE_NAME(FSE_decode_t, FSE_FUNCTION_EXTENSION)
+#define FSE_DECODE_TYPE FSE_decode_t
 
 
 typedef struct {
@@ -415,7 +415,7 @@ typedef struct {
     U16 fastMode;
 } FSE_DTableHeader;   /* sizeof U32 */
 
-static size_t FSE_FUNCTION_NAME(FSE_buildDTable, FSE_FUNCTION_EXTENSION)
+static size_t FSE_buildDTable
 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
 {
     void* ptr = dt;
index 860df94a6fd8ca34569fb4a8974e2fcd0e2f5216..89501111edd94740b7a20f292ce37591fe3dca4d 100644 (file)
@@ -1266,11 +1266,11 @@ typedef U32 DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)];
 
 /* Function templates */
 
-#define FSE_DECODE_TYPE FSE_TYPE_NAME(FSE_decode_t, FSE_FUNCTION_EXTENSION)
+#define FSE_DECODE_TYPE FSE_decode_t
 
 static U32 FSE_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
 
-static size_t FSE_FUNCTION_NAME(FSE_buildDTable, FSE_FUNCTION_EXTENSION)
+static size_t FSE_buildDTable
 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
 {
     void* ptr = dt+1;
index 6a048fd273b1732305005edd0490fd18ceb178e8..32be1c8dde5c9fd4996d9ca3f6c5a018d8a6ffea 100644 (file)
@@ -1266,11 +1266,11 @@ typedef U32 DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)];
 
 /* Function templates */
 
-#define FSE_DECODE_TYPE FSE_TYPE_NAME(FSE_decode_t, FSE_FUNCTION_EXTENSION)
+#define FSE_DECODE_TYPE FSE_decode_t
 
 static U32 FSE_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
 
-static size_t FSE_FUNCTION_NAME(FSE_buildDTable, FSE_FUNCTION_EXTENSION)
+static size_t FSE_buildDTable
 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
 {
     void* ptr = dt+1;