aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-12-29 00:15:44 -0800
committerMark Adler <madler@alumni.caltech.edu>2011-12-29 00:15:44 -0800
commit19761b8506f15d6eeeb6ccfab33a11abce0f40e7 (patch)
treecdc30a695e75ce713f6688b0c95c1cb411e2e55c
parent9d55abc96968db80749df5ebf412d36e2d66de26 (diff)
downloadzlib-19761b8506f15d6eeeb6ccfab33a11abce0f40e7.tar.gz
zlib-19761b8506f15d6eeeb6ccfab33a11abce0f40e7.tar.bz2
zlib-19761b8506f15d6eeeb6ccfab33a11abce0f40e7.zip
Permit Z_NULL arguments to deflatePending.
This avoids having to create useless variables for return values that aren't needed.
-rw-r--r--deflate.c6
-rw-r--r--zlib.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/deflate.c b/deflate.c
index 159e665..eed6ed8 100644
--- a/deflate.c
+++ b/deflate.c
@@ -451,8 +451,10 @@ int ZEXPORT deflatePending (strm, pending, bits)
451 z_streamp strm; 451 z_streamp strm;
452{ 452{
453 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; 453 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
454 *pending = strm->state->pending; 454 if (pending != Z_NULL)
455 *bits = strm->state->bi_valid; 455 *pending = strm->state->pending;
456 if (bits != Z_NULL)
457 *bits = strm->state->bi_valid;
456 return Z_OK; 458 return Z_OK;
457} 459}
458 460
diff --git a/zlib.h b/zlib.h
index 9ca20d7..20e13db 100644
--- a/zlib.h
+++ b/zlib.h
@@ -715,7 +715,8 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
715 been generated, but not yet provided in the available output. The bytes not 715 been generated, but not yet provided in the available output. The bytes not
716 provided would be due to the available output space having being consumed. 716 provided would be due to the available output space having being consumed.
717 The number of bits of output not provided are between 0 and 7, where they 717 The number of bits of output not provided are between 0 and 7, where they
718 await more bits to join them in order to fill out a full byte. 718 await more bits to join them in order to fill out a full byte. If pending
719 or bits are Z_NULL, then those values are not set.
719 720
720 deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source 721 deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
721 stream state was inconsistent. 722 stream state was inconsistent.