zlibWrapper: support for stricter gcc warnings

This commit is contained in:
inikep 2016-06-02 18:40:41 +02:00
parent 7cab86f647
commit 614fddee6a
4 changed files with 11 additions and 10 deletions

View File

@ -18,7 +18,8 @@ endif
ZLIBWRAPPER_PATH = .
EXAMPLE_PATH = examples
CC = gcc
CFLAGS = $(LOC) -I../lib/common -I$(ZLIBDIR) -I$(ZLIBWRAPPER_PATH) -O3 -Wall -std=gnu89
CFLAGS = $(LOC) -I../lib/common -I$(ZLIBDIR) -I$(ZLIBWRAPPER_PATH) -O3 -std=gnu90
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wstrict-prototypes -Wundef
LDFLAGS = $(LOC)
RM = rm -f

View File

@ -61,8 +61,8 @@ void *myalloc(q, n, m)
void *q;
unsigned n, m;
{
q = Z_NULL;
void *buf = calloc(n, m);
q = Z_NULL;
/* printf("myalloc %p n=%d m=%d\n", buf, n, m); */
return buf;
}

View File

@ -69,9 +69,9 @@ static int g_useZSTD = ZWRAP_USE_ZSTD; /* 0 = don't use ZSTD */
void useZSTD(int turn_on) { g_useZSTD = turn_on; }
int isUsingZSTD() { return g_useZSTD; }
int isUsingZSTD(void) { return g_useZSTD; }
const char * zstdVersion() { return ZSTD_VERSION_STRING; }
const char * zstdVersion(void) { return ZSTD_VERSION_STRING; }
ZEXTERN const char * ZEXPORT z_zlibVersion OF((void)) { return zlibVersion(); }
@ -421,8 +421,8 @@ ZEXTERN int ZEXPORT z_inflate OF((z_streamp strm, int flush))
strm->avail_out = strm2.avail_out;
strm->reserved = 0; /* mark as zlib stream */
{ size_t const errorCode = ZWRAP_freeDCtx(zwd);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR; }
errorCode = ZWRAP_freeDCtx(zwd);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
if (flush == Z_INFLATE_SYNC) return inflateSync(strm);
return inflate(strm, flush);
@ -434,8 +434,8 @@ ZEXTERN int ZEXPORT z_inflate OF((z_streamp strm, int flush))
} else
zwd->zbd = ZBUFF_createDCtx();
{ size_t const errorCode = ZBUFF_decompressInit(zwd->zbd);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR; }
errorCode = ZBUFF_decompressInit(zwd->zbd);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
srcSize = ZWRAP_HEADERSIZE;
dstCapacity = 0;

View File

@ -49,8 +49,8 @@ extern "C" {
#endif
void useZSTD(int turn_on);
int isUsingZSTD();
const char * zstdVersion();
int isUsingZSTD(void);
const char * zstdVersion(void);
#if defined (__cplusplus)