summaryrefslogtreecommitdiff
path: root/infback.c
diff options
context:
space:
mode:
authorMika Lindqvist <postmaster@raasu.org>2016-04-25 22:59:59 +0300
committerHans Kristian Rosbach <hk-git@circlestorm.org>2017-01-31 10:53:22 +0100
commit602531cf3de544e7b1e2db8ce8f05e3ebc355ca2 (patch)
treefd5e1c39f2b23257f6f55a0f8b0963a5f99eaad8 /infback.c
parent806e48855fb41fa6797dd03eb8c99ab1abe2313a (diff)
Replace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.
Diffstat (limited to 'infback.c')
-rw-r--r--infback.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/infback.c b/infback.c
index 01b782f..4fc783f 100644
--- a/infback.c
+++ b/infback.c
@@ -20,7 +20,7 @@ static void fixedtables(struct inflate_state *state);
/*
strm provides memory allocation functions in zalloc and zfree, or
- Z_NULL to use the library memory allocation functions.
+ NULL to use the library memory allocation functions.
windowBits is in the range 8..15, and window is a user-supplied
window and output buffer that is 2**windowBits bytes.
@@ -29,19 +29,19 @@ int ZEXPORT inflateBackInit_(z_stream *strm, int windowBits, unsigned char *wind
const char *version, int stream_size) {
struct inflate_state *state;
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || stream_size != (int)(sizeof(z_stream)))
+ if (version == NULL || version[0] != ZLIB_VERSION[0] || stream_size != (int)(sizeof(z_stream)))
return Z_VERSION_ERROR;
- if (strm == Z_NULL || window == Z_NULL || windowBits < 8 || windowBits > 15)
+ if (strm == NULL || window == NULL || windowBits < 8 || windowBits > 15)
return Z_STREAM_ERROR;
- strm->msg = Z_NULL; /* in case we return an error */
- if (strm->zalloc == (alloc_func)0) {
+ strm->msg = NULL; /* in case we return an error */
+ if (strm->zalloc == NULL) {
strm->zalloc = zcalloc;
strm->opaque = NULL;
}
- if (strm->zfree == (free_func)0)
+ if (strm->zfree == NULL)
strm->zfree = zcfree;
state = (struct inflate_state *)ZALLOC(strm, 1, sizeof(struct inflate_state));
- if (state == Z_NULL)
+ if (state == NULL)
return Z_MEM_ERROR;
Tracev((stderr, "inflate: allocated\n"));
strm->state = (struct internal_state *)state;
@@ -143,7 +143,7 @@ static void fixedtables(struct inflate_state *state) {
if (have == 0) { \
have = in(in_desc, &next); \
if (have == 0) { \
- next = Z_NULL; \
+ next = NULL; \
ret = Z_BUF_ERROR; \
goto inf_leave; \
} \
@@ -223,12 +223,12 @@ static void fixedtables(struct inflate_state *state) {
in() should return zero on failure. out() should return non-zero on
failure. If either in() or out() fails, than inflateBack() returns a
- Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
+ Z_BUF_ERROR. strm->next_in can be checked for NULL to see whether it
was in() or out() that caused in the error. Otherwise, inflateBack()
returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
error, or Z_MEM_ERROR if it could not allocate memory for the state.
inflateBack() can also return Z_STREAM_ERROR if the input parameters
- are not correct, i.e. strm is Z_NULL or the state was not initialized.
+ are not correct, i.e. strm is NULL or the state was not initialized.
*/
int ZEXPORT inflateBack(z_stream *strm, in_func in, void *in_desc, out_func out, void *out_desc) {
struct inflate_state *state;
@@ -247,17 +247,17 @@ int ZEXPORT inflateBack(z_stream *strm, in_func in, void *in_desc, out_func out,
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
/* Check that the strm exists and that the state was initialized */
- if (strm == Z_NULL || strm->state == Z_NULL)
+ if (strm == NULL || strm->state == NULL)
return Z_STREAM_ERROR;
state = (struct inflate_state *)strm->state;
/* Reset the state */
- strm->msg = Z_NULL;
+ strm->msg = NULL;
state->mode = TYPE;
state->last = 0;
state->whave = 0;
next = strm->next_in;
- have = next != Z_NULL ? strm->avail_in : 0;
+ have = next != NULL ? strm->avail_in : 0;
hold = 0;
bits = 0;
put = state->window;
@@ -603,10 +603,10 @@ int ZEXPORT inflateBack(z_stream *strm, in_func in, void *in_desc, out_func out,
}
int ZEXPORT inflateBackEnd(z_stream *strm) {
- if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+ if (strm == NULL || strm->state == NULL || strm->zfree == NULL)
return Z_STREAM_ERROR;
ZFREE(strm, strm->state);
- strm->state = Z_NULL;
+ strm->state = NULL;
Tracev((stderr, "inflate: end\n"));
return Z_OK;
}