zlibWrapper: added gcc flag -Wdeclaration-after-statement
diff --git a/programs/zbufftest.c b/programs/zbufftest.c
index 355b643..3871198 100644
--- a/programs/zbufftest.c
+++ b/programs/zbufftest.c
@@ -131,8 +131,8 @@
static void* ZBUFF_allocFunction(void* opaque, size_t size)
{
- (void)opaque;
void* address = malloc(size);
+ (void)opaque;
/* DISPLAYLEVEL(4, "alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
return address;
}
diff --git a/zlibWrapper/Makefile b/zlibWrapper/Makefile
index 962f929..edfcdf7 100644
--- a/zlibWrapper/Makefile
+++ b/zlibWrapper/Makefile
@@ -19,7 +19,7 @@
EXAMPLE_PATH = examples
CC = gcc
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
+CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
LDFLAGS = $(LOC)
RM = rm -f
diff --git a/zlibWrapper/zstd_zlibwrapper.c b/zlibWrapper/zstd_zlibwrapper.c
index 4740e0d..a4e22a1 100644
--- a/zlibWrapper/zstd_zlibwrapper.c
+++ b/zlibWrapper/zstd_zlibwrapper.c
@@ -667,9 +667,9 @@
if (!g_useZSTD)
return compress(dest, destLen, source, sourceLen);
- size_t dstCapacity = *destLen;
- LOG_WRAPPER("z_compress sourceLen=%d dstCapacity=%d\n", (int)sourceLen, (int)dstCapacity);
- { size_t const errorCode = ZSTD_compress(dest, dstCapacity, source, sourceLen, -1);
+ { size_t dstCapacity = *destLen;
+ size_t const errorCode = ZSTD_compress(dest, dstCapacity, source, sourceLen, -1);
+ LOG_WRAPPER("z_compress sourceLen=%d dstCapacity=%d\n", (int)sourceLen, (int)dstCapacity);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
*destLen = errorCode;
}
@@ -684,8 +684,8 @@
if (!g_useZSTD)
return compress2(dest, destLen, source, sourceLen, level);
- size_t dstCapacity = *destLen;
- { size_t const errorCode = ZSTD_compress(dest, dstCapacity, source, sourceLen, level);
+ { size_t dstCapacity = *destLen;
+ size_t const errorCode = ZSTD_compress(dest, dstCapacity, source, sourceLen, level);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
*destLen = errorCode;
}
@@ -709,8 +709,8 @@
// if (!g_useZSTD)
return uncompress(dest, destLen, source, sourceLen);
- size_t dstCapacity = *destLen;
- { size_t const errorCode = ZSTD_decompress(dest, dstCapacity, source, sourceLen);
+ { size_t dstCapacity = *destLen;
+ size_t const errorCode = ZSTD_decompress(dest, dstCapacity, source, sourceLen);
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
*destLen = errorCode;
}