From a154628e709f5ac3591266ecef7be763826c6add Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 14 Jul 2014 23:29:40 +0100 Subject: Makefile : added -Wstrict-prototype, as suggested by Larry Doolittle --- Makefile | 2 +- lz4.c | 8 ++++---- programs/Makefile | 2 +- programs/bench.c | 6 +++--- programs/bench.h | 2 +- programs/datagen.c | 2 +- programs/fullbench.c | 6 +++--- programs/fuzzer.c | 8 ++++---- programs/lz4cli.c | 10 +++++----- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index d82c124..28a0bfc 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) DESTDIR= PREFIX = /usr CC := $(CC) -CFLAGS+= -I. -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -DLZ4_VERSION=\"$(RELEASE)\" +CFLAGS+= -I. -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\" LIBDIR?= $(PREFIX)/lib INCLUDEDIR=$(PREFIX)/include diff --git a/lz4.c b/lz4.c index e24cf5c..2484fc6 100644 --- a/lz4.c +++ b/lz4.c @@ -300,7 +300,7 @@ typedef enum { full = 0, partial = 1 } earlyEnd_directive; ****************************/ #if LZ4_ARCH64 -int LZ4_NbCommonBytes (register U64 val) +static int LZ4_NbCommonBytes (register U64 val) { # if defined(LZ4_BIG_ENDIAN) # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) @@ -332,7 +332,7 @@ int LZ4_NbCommonBytes (register U64 val) #else -int LZ4_NbCommonBytes (register U32 val) +static int LZ4_NbCommonBytes (register U32 val) { # if defined(LZ4_BIG_ENDIAN) # if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) @@ -742,7 +742,7 @@ int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize) } -void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, const BYTE* src) +static void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, const BYTE* src) { if ((LZ4_dict->currentOffset > 0x80000000) || ((size_t)LZ4_dict->currentOffset > (size_t)src)) /* address space overflow */ @@ -1180,7 +1180,7 @@ int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int LZ4_sizeofStreamState() { return LZ4_STREAMSIZE; } -void LZ4_init(LZ4_stream_t_internal* lz4ds, const BYTE* base) +static void LZ4_init(LZ4_stream_t_internal* lz4ds, const BYTE* base) { MEM_INIT(lz4ds, 0, LZ4_STREAMSIZE); lz4ds->bufferStart = base; diff --git a/programs/Makefile b/programs/Makefile index c62366c..5127c5d 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -34,7 +34,7 @@ RELEASE=rc120 DESTDIR= PREFIX=/usr CC:=$(CC) -CFLAGS+= -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -DLZ4_VERSION=\"$(RELEASE)\" +CFLAGS+= -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\" FLAGS= -I.. $(CFLAGS) BINDIR=$(PREFIX)/bin diff --git a/programs/bench.c b/programs/bench.c index 8d68098..6af86ac 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -32,7 +32,7 @@ // Unix Large Files support (>4GB) #define _FILE_OFFSET_BITS 64 #if (defined(__sun__) && (!defined(__LP64__))) // Sun Solaris 32-bits requires specific definitions -# define _LARGEFILE_SOURCE +# define _LARGEFILE_SOURCE #elif ! defined(__LP64__) // No point defining Large file for 64 bit # define _LARGEFILE64_SOURCE #endif @@ -155,7 +155,7 @@ void BMK_SetNbIterations(int nbLoops) DISPLAY("- %i iterations -\n", nbIterations); } -void BMK_SetPause() { BMK_pause = 1; } +void BMK_SetPause(void) { BMK_pause = 1; } //********************************************************* @@ -178,7 +178,7 @@ static int BMK_GetMilliStart() #else -static int BMK_GetMilliStart() +static int BMK_GetMilliStart(void) { // Based on newer gettimeofday() // Use GetMilliSpan to correct for rollover diff --git a/programs/bench.h b/programs/bench.h index a0b7ed2..7e59e52 100644 --- a/programs/bench.h +++ b/programs/bench.h @@ -32,7 +32,7 @@ int BMK_benchFile(char** fileNamesTable, int nbFiles, int cLevel); // Parameters void BMK_SetBlocksize(int bsize); void BMK_SetNbIterations(int nbLoops); -void BMK_SetPause(); +void BMK_SetPause(void); diff --git a/programs/datagen.c b/programs/datagen.c index 0109d54..706c30f 100644 --- a/programs/datagen.c +++ b/programs/datagen.c @@ -184,7 +184,7 @@ static void CDG_generate(U64 size, U32* seed, double proba) } -int CDG_usage() +int CDG_usage(void) { DISPLAY( "Compressible data generator\n"); DISPLAY( "Usage :\n"); diff --git a/programs/fullbench.c b/programs/fullbench.c index 0ed8488..dd02357 100644 --- a/programs/fullbench.c +++ b/programs/fullbench.c @@ -167,7 +167,7 @@ void BMK_SetNbIterations(int nbLoops) DISPLAY("- %i iterations -\n", nbIterations); } -void BMK_SetPause() +void BMK_SetPause(void) { BMK_pause = 1; } @@ -192,7 +192,7 @@ static int BMK_GetMilliStart() #else -static int BMK_GetMilliStart() +static int BMK_GetMilliStart(void) { // Based on newer gettimeofday() // Use GetMilliSpan to correct for rollover @@ -631,7 +631,7 @@ int usage(char* exename) return 0; } -int usage_advanced() +int usage_advanced(void) { DISPLAY( "\nAdvanced options :\n"); DISPLAY( " -c# : test only compression function # [1-%i]\n", NB_COMPRESSION_ALGORITHMS); diff --git a/programs/fuzzer.c b/programs/fuzzer.c index 0f74f40..b302078 100644 --- a/programs/fuzzer.c +++ b/programs/fuzzer.c @@ -103,7 +103,7 @@ static int displayLevel = 2; /********************************************************* Fuzzer functions *********************************************************/ -static int FUZ_GetMilliStart() +static int FUZ_GetMilliStart(void) { struct timeb tb; int nCount; @@ -174,7 +174,7 @@ void FUZ_fillCompressibleNoiseBuffer(void* buffer, int bufferSize, double proba, // No longer useful; included into issue 134 -int FUZ_Issue52() +int FUZ_Issue52(void) { char* output; char* input; @@ -199,7 +199,7 @@ int FUZ_Issue52() #define MAX_NB_BUFF_I134 150 #define BLOCKSIZE_I134 (32 MB) -int FUZ_Issue134() +int FUZ_Issue134(void) { char* buffers[MAX_NB_BUFF_I134+1] = {0}; int i, nbBuff=0; @@ -648,7 +648,7 @@ _output_error: } -int FUZ_usage() +int FUZ_usage(void) { DISPLAY( "Usage :\n"); DISPLAY( " %s [args]\n", programName); diff --git a/programs/lz4cli.c b/programs/lz4cli.c index e6e6740..e9b7506 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -175,7 +175,7 @@ int LZ4IO_compressFilename_Legacy(char* input_filename, char* output_filename, i //**************************** // Functions //**************************** -int usage() +int usage(void) { DISPLAY( "Usage :\n"); DISPLAY( " %s [arg] [input] [output]\n", programName); @@ -192,7 +192,7 @@ int usage() return 0; } -int usage_advanced() +int usage_advanced(void) { DISPLAY(WELCOME_MESSAGE); usage(); @@ -223,7 +223,7 @@ int usage_advanced() return 0; } -int usage_longhelp() +int usage_longhelp(void) { DISPLAY( "\n"); DISPLAY( "Which values can get [output] ? \n"); @@ -273,7 +273,7 @@ int usage_longhelp() return 0; } -int badusage() +int badusage(void) { DISPLAYLEVEL(1, "Incorrect parameters\n"); if (displayLevel >= 1) usage(); @@ -281,7 +281,7 @@ int badusage() } -void waitEnter() +void waitEnter(void) { DISPLAY("Press enter to continue...\n"); getchar(); -- cgit v0.12