summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-06-23 23:52:03 +0200
committerMark Wielaard <mark@klomp.org>2019-06-23 23:52:03 +0200
commit02fe3ca2349e45eee6dff6ca46bf9a9187f382c5 (patch)
tree5fd51ce2ae7b2d54afa62b916d6d839b87d039a1
parentAdd release-update.sh script. (diff)
downloadbzip2-02fe3ca2349e45eee6dff6ca46bf9a9187f382c5.tar.gz
bzip2-02fe3ca2349e45eee6dff6ca46bf9a9187f382c5.tar.bz2
bzip2-02fe3ca2349e45eee6dff6ca46bf9a9187f382c5.tar.xz
bzip2.c (testStream): Remove set, but not used nread variable.
Modern GCC warns: bzip2.c: In function ‘testStream’: bzip2.c:557:37: warning: variable ‘nread’ set but not used [-Wunused-but-set-variable] Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; ^~~~~ GCC is correct. In testStream we don't care about the number of bytes read by BZ2_bzRead. So just remove the variable and the assignment.
-rw-r--r--bzip2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bzip2.c b/bzip2.c
index 59f59ff..854a2bb 100644
--- a/bzip2.c
+++ b/bzip2.c
@@ -554,7 +554,7 @@ static
554Bool testStream ( FILE *zStream ) 554Bool testStream ( FILE *zStream )
555{ 555{
556 BZFILE* bzf = NULL; 556 BZFILE* bzf = NULL;
557 Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; 557 Int32 bzerr, bzerr_dummy, ret, streamNo, i;
558 UChar obuf[5000]; 558 UChar obuf[5000];
559 UChar unused[BZ_MAX_UNUSED]; 559 UChar unused[BZ_MAX_UNUSED];
560 Int32 nUnused; 560 Int32 nUnused;
@@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream )
577 streamNo++; 577 streamNo++;
578 578
579 while (bzerr == BZ_OK) { 579 while (bzerr == BZ_OK) {
580 nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); 580 BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
581 if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; 581 if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
582 } 582 }
583 if (bzerr != BZ_STREAM_END) goto errhandler; 583 if (bzerr != BZ_STREAM_END) goto errhandler;