mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
zlibWrapper: added gcc flag -Wdeclaration-after-statement
This commit is contained in:
@ -131,8 +131,8 @@ static unsigned FUZ_highbit32(U32 v32)
|
|||||||
|
|
||||||
static void* ZBUFF_allocFunction(void* opaque, size_t size)
|
static void* ZBUFF_allocFunction(void* opaque, size_t size)
|
||||||
{
|
{
|
||||||
(void)opaque;
|
|
||||||
void* address = malloc(size);
|
void* address = malloc(size);
|
||||||
|
(void)opaque;
|
||||||
/* DISPLAYLEVEL(4, "alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
|
/* DISPLAYLEVEL(4, "alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ ZLIBWRAPPER_PATH = .
|
|||||||
EXAMPLE_PATH = examples
|
EXAMPLE_PATH = examples
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = $(LOC) -I../lib/common -I$(ZLIBDIR) -I$(ZLIBWRAPPER_PATH) -O3 -std=gnu90
|
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)
|
LDFLAGS = $(LOC)
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
|
@ -667,9 +667,9 @@ ZEXTERN int ZEXPORT z_compress OF((Bytef *dest, uLongf *destLen,
|
|||||||
if (!g_useZSTD)
|
if (!g_useZSTD)
|
||||||
return compress(dest, destLen, source, sourceLen);
|
return compress(dest, destLen, source, sourceLen);
|
||||||
|
|
||||||
size_t dstCapacity = *destLen;
|
{ 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 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;
|
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
|
||||||
*destLen = errorCode;
|
*destLen = errorCode;
|
||||||
}
|
}
|
||||||
@ -684,8 +684,8 @@ ZEXTERN int ZEXPORT z_compress2 OF((Bytef *dest, uLongf *destLen,
|
|||||||
if (!g_useZSTD)
|
if (!g_useZSTD)
|
||||||
return compress2(dest, destLen, source, sourceLen, level);
|
return compress2(dest, destLen, source, sourceLen, level);
|
||||||
|
|
||||||
size_t dstCapacity = *destLen;
|
{ size_t dstCapacity = *destLen;
|
||||||
{ size_t const errorCode = ZSTD_compress(dest, dstCapacity, source, sourceLen, level);
|
size_t const errorCode = ZSTD_compress(dest, dstCapacity, source, sourceLen, level);
|
||||||
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
|
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
|
||||||
*destLen = errorCode;
|
*destLen = errorCode;
|
||||||
}
|
}
|
||||||
@ -709,8 +709,8 @@ ZEXTERN int ZEXPORT z_uncompress OF((Bytef *dest, uLongf *destLen,
|
|||||||
// if (!g_useZSTD)
|
// if (!g_useZSTD)
|
||||||
return uncompress(dest, destLen, source, sourceLen);
|
return uncompress(dest, destLen, source, sourceLen);
|
||||||
|
|
||||||
size_t dstCapacity = *destLen;
|
{ size_t dstCapacity = *destLen;
|
||||||
{ size_t const errorCode = ZSTD_decompress(dest, dstCapacity, source, sourceLen);
|
size_t const errorCode = ZSTD_decompress(dest, dstCapacity, source, sourceLen);
|
||||||
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
|
if (ZSTD_isError(errorCode)) return Z_MEM_ERROR;
|
||||||
*destLen = errorCode;
|
*destLen = errorCode;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user