Add casts and consts to ease user conversion to C++.

You would still need to run zlib2ansi on all of the *.c files.
This commit is contained in:
Mark Adler
2013-03-24 15:18:02 -07:00
parent 0aac8cf7c4
commit e9f0b78443
6 changed files with 17 additions and 16 deletions

View File

@@ -19,7 +19,7 @@ local int gz_init(state)
z_streamp strm = &(state->strm);
/* allocate input buffer */
state->in = malloc(state->want);
state->in = (unsigned char *)malloc(state->want);
if (state->in == NULL) {
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
@@ -28,7 +28,7 @@ local int gz_init(state)
/* only need output buffer and deflate state if compressing */
if (!state->direct) {
/* allocate output buffer */
state->out = malloc(state->want);
state->out = (unsigned char *)malloc(state->want);
if (state->out == NULL) {
free(state->in);
gz_error(state, Z_MEM_ERROR, "out of memory");