From: Even Rouault Date: Tue, 19 Sep 2017 16:35:31 +0000 (+0200) Subject: Workaroudn cppcheck (correct) warning about same code in then and else branches X-Git-Tag: v2.3.0~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c22ea12219c711031ef9b5823f2d9eb1081261e9;p=openjpeg Workaroudn cppcheck (correct) warning about same code in then and else branches --- diff --git a/src/lib/openjp2/sparse_array.c b/src/lib/openjp2/sparse_array.c index e7efdc96..73192924 100644 --- a/src/lib/openjp2/sparse_array.c +++ b/src/lib/openjp2/sparse_array.c @@ -170,6 +170,7 @@ static OPJ_BOOL opj_sparse_array_int32_read_or_write( if (x_incr == 4) { /* Same code as general branch, but the compiler */ /* can have an efficient memcpy() */ + (void)(x_incr); /* trick to silent cppcheck duplicateBranch warning */ for (j = 0; j < y_incr; j++) { memcpy(dest_ptr, src_ptr, sizeof(OPJ_INT32) * x_incr); dest_ptr += buf_line_stride; @@ -249,6 +250,7 @@ static OPJ_BOOL opj_sparse_array_int32_read_or_write( if (x_incr == 4) { /* Same code as general branch, but the compiler */ /* can have an efficient memcpy() */ + (void)(x_incr); /* trick to silent cppcheck duplicateBranch warning */ for (j = 0; j < y_incr; j++) { memcpy(dest_ptr, src_ptr, sizeof(OPJ_INT32) * x_incr); dest_ptr += block_width;