From: Fiona Trahe Date: Fri, 19 Apr 2019 16:52:48 +0000 (+0100) Subject: test/compress: fix build X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0e7d65181ae4382584855422c1e970c40372e598;p=dpdk.git test/compress: fix build Fixed the compilation error: app/test/test_compressdev.c:1949:11: note: previous definition of 'i' was here app/test/test_compressdev.c:1992:2: error: 'for' loop initial declarations are only allowed in C99 mode app/test/test_compressdev.c:1992:2: note: use option -std=c99 or -std=gnu99 to compile your code app/test/test_compressdev.c:1996:19: warning: assignment from incompatible pointer type [enabled by default] Fixes: 355b02eedc65 ("test/compress: add max mbuf size test case") Signed-off-by: Tomasz Jozwiak Signed-off-by: Fiona Trahe --- diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c index 404b98f60d..8d6dbf00d5 100644 --- a/app/test/test_compressdev.c +++ b/app/test/test_compressdev.c @@ -1948,6 +1948,7 @@ test_compressdev_deflate_stateless_dynamic_big(void) struct comp_testsuite_params *ts_params = &testsuite_params; uint16_t i = 0; int ret = TEST_SUCCESS; + int j; const struct rte_compressdev_capabilities *capab; char *test_buffer = NULL; @@ -1970,7 +1971,7 @@ test_compressdev_deflate_stateless_dynamic_big(void) struct interim_data_params int_data = { (const char * const *)&test_buffer, 1, - NULL, + &i, &ts_params->def_comp_xform, &ts_params->def_decomp_xform, 1 @@ -1989,11 +1990,9 @@ test_compressdev_deflate_stateless_dynamic_big(void) /* fill the buffer with data based on rand. data */ srand(BIG_DATA_TEST_SIZE); - for (uint32_t i = 0; i < BIG_DATA_TEST_SIZE - 1; ++i) - test_buffer[i] = (uint8_t)(rand() % ((uint8_t)-1)) | 1; - + for (j = 0; j < BIG_DATA_TEST_SIZE - 1; ++j) + test_buffer[j] = (uint8_t)(rand() % ((uint8_t)-1)) | 1; test_buffer[BIG_DATA_TEST_SIZE-1] = 0; - int_data.buf_idx = &i; /* Compress with compressdev, decompress with Zlib */ test_data.zlib_dir = ZLIB_DECOMPRESS;