Rename BAD to BAD_DATA since the first is already defined on SunOS.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 20 Oct 2008 08:45:42 +0000 (10:45 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 20 Oct 2008 08:45:42 +0000 (10:45 +0200)
lib/zlib/infback.c
lib/zlib/inffast.c
lib/zlib/inflate.c
lib/zlib/inflate.h

index 5680937..284d523 100644 (file)
@@ -309,7 +309,7 @@ void FAR *out_desc;
                 break;
             case 3:
                 strm->msg = "invalid block type";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
             }
             DROPBITS(2);
             break;
@@ -320,7 +320,7 @@ void FAR *out_desc;
             NEEDBITS(32);
             if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
                 strm->msg = "invalid stored block lengths";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->length = (unsigned)hold & 0xffff;
@@ -358,7 +358,7 @@ void FAR *out_desc;
 #ifndef PKZIP_BUG_WORKAROUND
             if (state->nlen > 286 || state->ndist > 30) {
                 strm->msg = "too many length or distance symbols";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
 #endif
@@ -380,7 +380,7 @@ void FAR *out_desc;
                                 &(state->lenbits), state->work);
             if (ret) {
                 strm->msg = "invalid code lengths set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             Tracev((stderr, "inflate:       code lengths ok\n"));
@@ -404,7 +404,7 @@ void FAR *out_desc;
                         DROPBITS(this.bits);
                         if (state->have == 0) {
                             strm->msg = "invalid bit length repeat";
-                            state->mode = BAD;
+                            state->mode = BAD_DATA;
                             break;
                         }
                         len = (unsigned)(state->lens[state->have - 1]);
@@ -427,7 +427,7 @@ void FAR *out_desc;
                     }
                     if (state->have + copy > state->nlen + state->ndist) {
                         strm->msg = "invalid bit length repeat";
-                        state->mode = BAD;
+                        state->mode = BAD_DATA;
                         break;
                     }
                     while (copy--)
@@ -436,7 +436,7 @@ void FAR *out_desc;
             }
 
             /* handle error breaks in while */
-            if (state->mode == BAD) break;
+            if (state->mode == BAD_DATA) break;
 
             /* build code tables */
             state->next = state->codes;
@@ -446,7 +446,7 @@ void FAR *out_desc;
                                 &(state->lenbits), state->work);
             if (ret) {
                 strm->msg = "invalid literal/lengths set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->distcode = (code const FAR *)(state->next);
@@ -455,7 +455,7 @@ void FAR *out_desc;
                             &(state->next), &(state->distbits), state->work);
             if (ret) {
                 strm->msg = "invalid distances set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             Tracev((stderr, "inflate:       codes ok\n"));
@@ -513,7 +513,7 @@ void FAR *out_desc;
             /* invalid code */
             if (this.op & 64) {
                 strm->msg = "invalid literal/length code";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
 
@@ -545,7 +545,7 @@ void FAR *out_desc;
             DROPBITS(this.bits);
             if (this.op & 64) {
                 strm->msg = "invalid distance code";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->offset = (unsigned)this.val;
@@ -560,7 +560,7 @@ void FAR *out_desc;
             if (state->offset > state->wsize - (state->whave < state->wsize ?
                                                 left : 0)) {
                 strm->msg = "invalid distance too far back";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             Tracevv((stderr, "inflate:         distance %u\n", state->offset));
@@ -595,7 +595,7 @@ void FAR *out_desc;
             }
             goto inf_leave;
 
-        case BAD:
+        case BAD_DATA:
             ret = Z_DATA_ERROR;
             goto inf_leave;
 
index bfc7276..687dfa0 100644 (file)
@@ -49,7 +49,7 @@
 
         LEN -- ran out of enough output space or enough available input
         TYPE -- reached end of block code, inflate() to interpret next block
-        BAD -- error in block data
+        BAD_DATA -- error in block data
 
    Notes:
 
@@ -176,7 +176,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
 #ifdef INFLATE_STRICT
                 if (dist > dmax) {
                     strm->msg = (char *)"invalid distance too far back";
-                    state->mode = BAD;
+                    state->mode = BAD_DATA;
                     break;
                 }
 #endif
@@ -188,7 +188,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
                     op = dist - op;             /* distance back in window */
                     if (op > whave) {
                         strm->msg = "invalid distance too far back";
-                        state->mode = BAD;
+                        state->mode = BAD_DATA;
                         break;
                     }
                     from = window - OFF;
@@ -264,7 +264,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
             }
             else {
                 strm->msg = "invalid distance code";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
         }
@@ -279,7 +279,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
         }
         else {
             strm->msg = "invalid literal/length code";
-            state->mode = BAD;
+            state->mode = BAD_DATA;
             break;
         }
     } while (in < last && out < end);
index ccbfac8..bcaca0d 100644 (file)
@@ -609,19 +609,19 @@ int flush;
 #endif
                 ((BITS(8) << 8) + (hold >> 8)) % 31) {
                 strm->msg = "incorrect header check";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             if (BITS(4) != Z_DEFLATED) {
                 strm->msg = "unknown compression method";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             DROPBITS(4);
             len = BITS(4) + 8;
             if (len > state->wbits) {
                 strm->msg = "invalid window size";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->dmax = 1U << len;
@@ -636,12 +636,12 @@ int flush;
             state->flags = (int)(hold);
             if ((state->flags & 0xff) != Z_DEFLATED) {
                 strm->msg = "unknown compression method";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             if (state->flags & 0xe000) {
                 strm->msg = "unknown header flags set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             if (state->head != Z_NULL)
@@ -745,7 +745,7 @@ int flush;
                 NEEDBITS(16);
                 if (hold != (state->check & 0xffff)) {
                     strm->msg = "header crc mismatch";
-                    state->mode = BAD;
+                    state->mode = BAD_DATA;
                     break;
                 }
                 INITBITS();
@@ -800,7 +800,7 @@ int flush;
                 break;
             case 3:
                 strm->msg = "invalid block type";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
             }
             DROPBITS(2);
             break;
@@ -809,7 +809,7 @@ int flush;
             NEEDBITS(32);
             if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
                 strm->msg = "invalid stored block lengths";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->length = (unsigned)hold & 0xffff;
@@ -845,7 +845,7 @@ int flush;
 #ifndef PKZIP_BUG_WORKAROUND
             if (state->nlen > 286 || state->ndist > 30) {
                 strm->msg = "too many length or distance symbols";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
 #endif
@@ -867,7 +867,7 @@ int flush;
                                 &(state->lenbits), state->work);
             if (ret) {
                 strm->msg = "invalid code lengths set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             Tracev((stderr, "inflate:       code lengths ok\n"));
@@ -891,7 +891,7 @@ int flush;
                         DROPBITS(this.bits);
                         if (state->have == 0) {
                             strm->msg = "invalid bit length repeat";
-                            state->mode = BAD;
+                            state->mode = BAD_DATA;
                             break;
                         }
                         len = state->lens[state->have - 1];
@@ -914,7 +914,7 @@ int flush;
                     }
                     if (state->have + copy > state->nlen + state->ndist) {
                         strm->msg = "invalid bit length repeat";
-                        state->mode = BAD;
+                        state->mode = BAD_DATA;
                         break;
                     }
                     while (copy--)
@@ -923,7 +923,7 @@ int flush;
             }
 
             /* handle error breaks in while */
-            if (state->mode == BAD) break;
+            if (state->mode == BAD_DATA) break;
 
             /* build code tables */
             state->next = state->codes;
@@ -933,7 +933,7 @@ int flush;
                                 &(state->lenbits), state->work);
             if (ret) {
                 strm->msg = "invalid literal/lengths set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->distcode = (code const FAR *)(state->next);
@@ -942,7 +942,7 @@ int flush;
                             &(state->next), &(state->distbits), state->work);
             if (ret) {
                 strm->msg = "invalid distances set";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             Tracev((stderr, "inflate:       codes ok\n"));
@@ -985,7 +985,7 @@ int flush;
             }
             if (this.op & 64) {
                 strm->msg = "invalid literal/length code";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->extra = (unsigned)(this.op) & 15;
@@ -1017,7 +1017,7 @@ int flush;
             DROPBITS(this.bits);
             if (this.op & 64) {
                 strm->msg = "invalid distance code";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             state->offset = (unsigned)this.val;
@@ -1032,13 +1032,13 @@ int flush;
 #ifdef INFLATE_STRICT
             if (state->offset > state->dmax) {
                 strm->msg = "invalid distance too far back";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
 #endif
             if (state->offset > state->whave + out - left) {
                 strm->msg = "invalid distance too far back";
-                state->mode = BAD;
+                state->mode = BAD_DATA;
                 break;
             }
             Tracevv((stderr, "inflate:         distance %u\n", state->offset));
@@ -1090,7 +1090,7 @@ int flush;
 #endif
                      REVERSE(hold)) != state->check) {
                     strm->msg = "incorrect data check";
-                    state->mode = BAD;
+                    state->mode = BAD_DATA;
                     break;
                 }
                 INITBITS();
@@ -1103,7 +1103,7 @@ int flush;
                 NEEDBITS(32);
                 if (hold != (state->total & 0xffffffffUL)) {
                     strm->msg = "incorrect length check";
-                    state->mode = BAD;
+                    state->mode = BAD_DATA;
                     break;
                 }
                 INITBITS();
@@ -1114,7 +1114,7 @@ int flush;
         case DONE:
             ret = Z_STREAM_END;
             goto inf_leave;
-        case BAD:
+        case BAD_DATA:
             ret = Z_DATA_ERROR;
             goto inf_leave;
         case MEM:
index 07bd3e7..25b6538 100644 (file)
@@ -45,7 +45,7 @@ typedef enum {
     CHECK,      /* i: waiting for 32-bit check value */
     LENGTH,     /* i: waiting for 32-bit length (gzip) */
     DONE,       /* finished check, done -- remain here until reset */
-    BAD,        /* got a data error -- remain here until reset */
+    BAD_DATA,        /* got a data error -- remain here until reset */
     MEM,        /* got an inflate() memory error -- remain here until reset */
     SYNC        /* looking for synchronization bytes to restart inflate() */
 } inflate_mode;
@@ -53,7 +53,7 @@ typedef enum {
 /*
     State transitions between above modes -
 
-    (most modes can go to the BAD or MEM mode -- not shown for clarity)
+    (most modes can go to the BAD_DATA or MEM mode -- not shown for clarity)
 
     Process header:
         HEAD -> (gzip) or (zlib)