Workaroudn cppcheck (correct) warning about same code in then and else branches

This commit is contained in:
Even Rouault 2017-09-19 18:35:31 +02:00
parent c84e594cff
commit c22ea12219
1 changed files with 2 additions and 0 deletions

View File

@ -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;