fixed declaration-after-statement warnings

This commit is contained in:
Yann Collet
2018-12-04 15:54:01 -08:00
parent aec945f0dc
commit 2fb8d1a392
+18 -8
View File
@@ -381,16 +381,24 @@ static int basicUnitTests(U32 seed, double compressibility)
DISPLAYLEVEL(3, "test%3i : decompress with null dict : ", testNb++); DISPLAYLEVEL(3, "test%3i : decompress with null dict : ", testNb++);
{ ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL); { ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL);
size_t const r = ZSTD_decompress_usingDict(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize, NULL, 0); { size_t const r = ZSTD_decompress_usingDict(dctx,
if (r != CNBuffSize) goto _output_error; decodedBuffer, CNBuffSize,
compressedBuffer, cSize,
NULL, 0);
if (r != CNBuffSize) goto _output_error;
}
ZSTD_freeDCtx(dctx); ZSTD_freeDCtx(dctx);
} }
DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "OK \n");
DISPLAYLEVEL(3, "test%3i : decompress with null DDict : ", testNb++); DISPLAYLEVEL(3, "test%3i : decompress with null DDict : ", testNb++);
{ ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL); { ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL);
size_t const r = ZSTD_decompress_usingDDict(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize, NULL); { size_t const r = ZSTD_decompress_usingDDict(dctx,
if (r != CNBuffSize) goto _output_error; decodedBuffer, CNBuffSize,
compressedBuffer, cSize,
NULL);
if (r != CNBuffSize) goto _output_error;
}
ZSTD_freeDCtx(dctx); ZSTD_freeDCtx(dctx);
} }
DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "OK \n");
@@ -1080,12 +1088,14 @@ static int basicUnitTests(U32 seed, double compressibility)
DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "OK \n");
DISPLAYLEVEL(3, "test%3i : dictionary containing only header should return error : ", testNb++); DISPLAYLEVEL(3, "test%3i : dictionary containing only header should return error : ", testNb++);
{ ZSTD_DCtx* const dctx = ZSTD_createDCtx(); assert(dctx != NULL); { ZSTD_DCtx* const dctx = ZSTD_createDCtx();
const size_t ret = ZSTD_decompress_usingDict( assert(dctx != NULL);
{ const size_t ret = ZSTD_decompress_usingDict(
dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize, dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize,
"\x37\xa4\x30\xec\x11\x22\x33\x44", 8); "\x37\xa4\x30\xec\x11\x22\x33\x44", 8);
if (ZSTD_getErrorCode(ret) != ZSTD_error_dictionary_corrupted) if (ZSTD_getErrorCode(ret) != ZSTD_error_dictionary_corrupted)
goto _output_error; goto _output_error;
}
ZSTD_freeDCtx(dctx); ZSTD_freeDCtx(dctx);
} }
DISPLAYLEVEL(3, "OK \n"); DISPLAYLEVEL(3, "OK \n");