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.
diff --git a/bzip2.c b/bzip2.c
index 59f59ff..854a2bb 100644
--- a/bzip2.c
+++ b/bzip2.c
@@ -554,7 +554,7 @@
Bool testStream ( FILE *zStream )
{
BZFILE* bzf = NULL;
- Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
+ Int32 bzerr, bzerr_dummy, ret, streamNo, i;
UChar obuf[5000];
UChar unused[BZ_MAX_UNUSED];
Int32 nUnused;
@@ -577,7 +577,7 @@
streamNo++;
while (bzerr == BZ_OK) {
- nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
+ BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
}
if (bzerr != BZ_STREAM_END) goto errhandler;