Skip to content

Commit

Permalink
Use %lu instead of %ld to fprintf unsigned longs.
Browse files Browse the repository at this point in the history
Fixes a cppcheck warning. Possibly we should just convert
the array type to `long` since that's what oggpack_look()
returns, using negative values to report error.

However, none of the compared values are out of range
for either type so it doesn't really matter.

Signed-off-by: Erik de Castro Lopo <[email protected]>
Signed-off-by: Ralph Giles <[email protected]>
  • Loading branch information
Quipyowert2 authored and rillian committed Mar 19, 2019
1 parent 6f5e79a commit f7dadaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bitwise.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ int main(void){
for(i=0;i<test2size;i++){
if(oggpack_look(&r,32)==-1)report("out of data. failed!");
if(oggpack_look(&r,32)!=large[i]){
fprintf(stderr,"%ld != %ld (%lx!=%lx):",oggpack_look(&r,32),large[i],
fprintf(stderr,"%ld != %lu (%lx!=%lx):",oggpack_look(&r,32),large[i],
oggpack_look(&r,32),large[i]);
report("read incorrect value!\n");
}
Expand Down Expand Up @@ -999,7 +999,7 @@ int main(void){
for(i=0;i<test2size;i++){
if(oggpackB_look(&r,32)==-1)report("out of data. failed!");
if(oggpackB_look(&r,32)!=large[i]){
fprintf(stderr,"%ld != %ld (%lx!=%lx):",oggpackB_look(&r,32),large[i],
fprintf(stderr,"%ld != %lu (%lx!=%lx):",oggpackB_look(&r,32),large[i],
oggpackB_look(&r,32),large[i]);
report("read incorrect value!\n");
}
Expand Down

0 comments on commit f7dadaa

Please sign in to comment.