From: Wayne Davison Date: Thu, 7 Jul 2005 19:31:23 +0000 (+0000) Subject: Changed zBAD back to BAD (with a simpler kluge for AIX). X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/9819f005b667f938f6853636492665cac761c54f Changed zBAD back to BAD (with a simpler kluge for AIX). --- diff --git a/zlib/infblock.c b/zlib/infblock.c index aab3dc87..38f90fc8 100644 --- a/zlib/infblock.c +++ b/zlib/infblock.c @@ -176,7 +176,7 @@ int r; break; case 3: /* illegal */ DUMPBITS(3) - s->mode = zBAD; + s->mode = BAD; z->msg = (char*)"invalid block type"; r = Z_DATA_ERROR; LEAVE @@ -186,7 +186,7 @@ int r; NEEDBITS(32) if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) { - s->mode = zBAD; + s->mode = BAD; z->msg = (char*)"invalid stored block lengths"; r = Z_DATA_ERROR; LEAVE @@ -219,7 +219,7 @@ int r; #ifndef PKZIP_BUG_WORKAROUND if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) { - s->mode = zBAD; + s->mode = BAD; z->msg = (char*)"too many length or distance symbols"; r = Z_DATA_ERROR; LEAVE @@ -253,7 +253,7 @@ int r; if (r == Z_DATA_ERROR) { ZFREE(z, s->sub.trees.blens); - s->mode = zBAD; + s->mode = BAD; } LEAVE } @@ -291,7 +291,7 @@ int r; (c == 16 && i < 1)) { ZFREE(z, s->sub.trees.blens); - s->mode = zBAD; + s->mode = BAD; z->msg = (char*)"invalid bit length repeat"; r = Z_DATA_ERROR; LEAVE @@ -320,7 +320,7 @@ int r; if (t == (uInt)Z_DATA_ERROR) { ZFREE(z, s->sub.trees.blens); - s->mode = zBAD; + s->mode = BAD; } r = t; LEAVE @@ -359,7 +359,7 @@ int r; case DONE: r = Z_STREAM_END; LEAVE - case zBAD: + case BAD: r = Z_DATA_ERROR; LEAVE default: diff --git a/zlib/inflate.c b/zlib/inflate.c index b6eff488..dfb2e867 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -22,7 +22,7 @@ typedef enum { CHECK2, /* two check bytes to go */ CHECK1, /* one check byte to go */ DONE, /* finished check, done */ - zBAD} /* got an error--stay here */ + BAD} /* got an error--stay here */ inflate_mode; /* inflate private state */ @@ -38,7 +38,7 @@ struct internal_state { uLong was; /* computed check value */ uLong need; /* stream check value */ } check; /* if CHECK, check values to compare */ - uInt marker; /* if zBAD, inflateSync's marker bytes count */ + uInt marker; /* if BAD, inflateSync's marker bytes count */ } sub; /* submode */ /* mode independent information */ @@ -164,14 +164,14 @@ int f; NEEDBYTE if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) { - z->state->mode = zBAD; + z->state->mode = BAD; z->msg = (char*)"unknown compression method"; z->state->sub.marker = 5; /* can't try inflateSync */ break; } if ((z->state->sub.method >> 4) + 8 > z->state->wbits) { - z->state->mode = zBAD; + z->state->mode = BAD; z->msg = (char*)"invalid window size"; z->state->sub.marker = 5; /* can't try inflateSync */ break; @@ -182,7 +182,7 @@ int f; b = NEXTBYTE; if (((z->state->sub.method << 8) + b) % 31) { - z->state->mode = zBAD; + z->state->mode = BAD; z->msg = (char*)"incorrect header check"; z->state->sub.marker = 5; /* can't try inflateSync */ break; @@ -213,7 +213,7 @@ int f; z->state->mode = DICT0; return Z_NEED_DICT; case DICT0: - z->state->mode = zBAD; + z->state->mode = BAD; z->msg = (char*)"need dictionary"; z->state->sub.marker = 0; /* can try inflateSync */ return Z_STREAM_ERROR; @@ -221,7 +221,7 @@ int f; r = inflate_blocks(z->state->blocks, z, r); if (r == Z_DATA_ERROR) { - z->state->mode = zBAD; + z->state->mode = BAD; z->state->sub.marker = 0; /* can try inflateSync */ break; } @@ -255,7 +255,7 @@ int f; if (z->state->sub.check.was != z->state->sub.check.need) { - z->state->mode = zBAD; + z->state->mode = BAD; z->msg = (char*)"incorrect data check"; z->state->sub.marker = 5; /* can't try inflateSync */ break; @@ -264,7 +264,7 @@ int f; z->state->mode = DONE; case DONE: return Z_STREAM_END; - case zBAD: + case BAD: return Z_DATA_ERROR; default: return Z_STREAM_ERROR; @@ -310,9 +310,9 @@ z_streamp z; /* set up */ if (z == Z_NULL || z->state == Z_NULL) return Z_STREAM_ERROR; - if (z->state->mode != zBAD) + if (z->state->mode != BAD) { - z->state->mode = zBAD; + z->state->mode = BAD; z->state->sub.marker = 0; } if ((n = z->avail_in) == 0) diff --git a/zlib/infutil.h b/zlib/infutil.h index 5f0294ea..c07d1552 100644 --- a/zlib/infutil.h +++ b/zlib/infutil.h @@ -11,6 +11,10 @@ #ifndef _INFUTIL_H #define _INFUTIL_H +#ifdef BAD /* For AIX */ +#undef BAD +#endif + typedef enum { TYPE, /* get type bits (3, including end bit) */ LENS, /* get lengths for stored */ @@ -21,7 +25,7 @@ typedef enum { CODES, /* processing fixed or dynamic block */ DRY, /* output remaining window bytes */ DONE, /* finished last block, done */ - zBAD} /* got a data error--stuck here */ + BAD} /* got a data error--stuck here */ inflate_block_mode; /* inflate blocks semi-private state */