1 Patch origin: in-house
   2 Patch status: inffast.c part: submitted back to community without feedback
   3 Patch status: deflate.c part: Solaris-specific; not suitable for upstream
   4 
   5 --- zlib-1.2.8/zlib.h   2013-04-28 17:23:49.000000000 -0700
   6 +++ zlib-1.2.8/zlib.h   2014-04-18 05:32:31.316290241 -0700
   7 @@ -37,8 +37,8 @@
   8  extern "C" {
   9  #endif
  10  
  11 -#define ZLIB_VERSION "1.2.8"
  12 -#define ZLIB_VERNUM 0x1280
  13 +#define ZLIB_VERSION "1.2.8-T4mods"
  14 +#define ZLIB_VERNUM 0x128f
  15  #define ZLIB_VER_MAJOR 1
  16  #define ZLIB_VER_MINOR 2
  17  #define ZLIB_VER_REVISION 8
  18 --- zlib-1.2.8/inffast.c        2013-03-24 22:47:59.000000000 -0700
  19 +++ zlib-1.2.8/inffast.c        2014-02-28 01:57:57.075708259 -0800
  20 @@ -87,7 +87,7 @@
  21      code const FAR *dcode;      /* local strm->distcode */
  22      unsigned lmask;             /* mask for first level of length codes */
  23      unsigned dmask;             /* mask for first level of distance codes */
  24 -    code here;                  /* retrieved table entry */
  25 +    code *here;                 /* retrieved table entry */
  26      unsigned op;                /* code bits, operation, extra bits, or */
  27                                  /*  window position, window bytes to copy */
  28      unsigned len;               /* match length, unused bytes */
  29 @@ -124,20 +124,20 @@
  30              hold += (unsigned long)(PUP(in)) << bits;
  31              bits += 8;
  32          }
  33 -        here = lcode[hold & lmask];
  34 +        here = (code *)(&(lcode[hold & lmask]));
  35        dolen:
  36 -        op = (unsigned)(here.bits);
  37 +        op = (unsigned)(here->bits);
  38          hold >>= op;
  39          bits -= op;
  40 -        op = (unsigned)(here.op);
  41 +        op = (unsigned)(here->op);
  42          if (op == 0) {                          /* literal */
  43 -            Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  44 +            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  45                      "inflate:         literal '%c'\n" :
  46 -                    "inflate:         literal 0x%02x\n", here.val));
  47 -            PUP(out) = (unsigned char)(here.val);
  48 +                    "inflate:         literal 0x%02x\n", here->val));
  49 +            PUP(out) = (unsigned char)(here->val);
  50          }
  51          else if (op & 16) {                     /* length base */
  52 -            len = (unsigned)(here.val);
  53 +            len = (unsigned)(here->val);
  54              op &= 15;                           /* number of extra bits */
  55              if (op) {
  56                  if (bits < op) {
  57 @@ -155,14 +155,14 @@
  58                  hold += (unsigned long)(PUP(in)) << bits;
  59                  bits += 8;
  60              }
  61 -            here = dcode[hold & dmask];
  62 +            here = (code *)(&(dcode[hold & dmask]));
  63            dodist:
  64 -            op = (unsigned)(here.bits);
  65 +            op = (unsigned)(here->bits);
  66              hold >>= op;
  67              bits -= op;
  68 -            op = (unsigned)(here.op);
  69 +            op = (unsigned)(here->op);
  70              if (op & 16) {                      /* distance base */
  71 -                dist = (unsigned)(here.val);
  72 +                dist = (unsigned)(here->val);
  73                  op &= 15;                       /* number of extra bits */
  74                  if (bits < op) {
  75                      hold += (unsigned long)(PUP(in)) << bits;
  76 @@ -281,7 +281,7 @@
  77                  }
  78              }
  79              else if ((op & 64) == 0) {          /* 2nd level distance code */
  80 -                here = dcode[here.val + (hold & ((1U << op) - 1))];
  81 +                here = (code *)(&(dcode[here->val + (hold & ((1U << op) - 1))]));
  82                  goto dodist;
  83              }
  84              else {
  85 @@ -291,7 +291,7 @@
  86              }
  87          }
  88          else if ((op & 64) == 0) {              /* 2nd level length code */
  89 -            here = lcode[here.val + (hold & ((1U << op) - 1))];
  90 +            here = (code *)(&(lcode[here->val + (hold & ((1U << op) - 1))]));
  91              goto dolen;
  92          }
  93          else if (op & 32) {                     /* end-of-block */
  94 --- zlib-1.2.8/deflate.c        2013-04-28 15:57:10.000000000 -0700
  95 +++ zlib-1.2.8/deflate.c        2014-02-28 02:32:02.517988885 -0800
  96 @@ -60,6 +60,7 @@
  97    copyright string in the executable of your product.
  98   */
  99  
 100 +#ifndef LONGEST_MATCH_ONLY
 101  /* ===========================================================================
 102   *  Function prototypes.
 103   */
 104 @@ -89,13 +90,18 @@
 105        void match_init OF((void)); /* asm code initialization */
 106        uInt longest_match  OF((deflate_state *s, IPos cur_match));
 107  #else
 108 +#ifdef ORIG_LONGEST_MATCH
 109  local uInt longest_match  OF((deflate_state *s, IPos cur_match));
 110 +#else
 111 +uInt longest_match  OF((deflate_state *s, IPos cur_match));
 112 +#endif
 113  #endif
 114  
 115  #ifdef DEBUG
 116  local  void check_match OF((deflate_state *s, IPos start, IPos match,
 117                              int length));
 118  #endif
 119 +#endif /* ! LONGEST_MATCH_ONLY */
 120  
 121  /* ===========================================================================
 122   * Local data
 123 @@ -104,6 +110,7 @@
 124  #define NIL 0
 125  /* Tail of hash chains */
 126  
 127 +#ifndef LONGEST_MATCH_ONLY
 128  #ifndef TOO_FAR
 129  #  define TOO_FAR 4096
 130  #endif
 131 @@ -1130,7 +1137,9 @@
 132  #endif
 133  #endif
 134  }
 135 +#endif /* ! LONGEST_MATCH_ONLY */
 136  
 137 +#if defined(ORIG_LONGEST_MATCH) || defined(ORIG_LONGEST_MATCH_GLOBAL)
 138  #ifndef FASTEST
 139  /* ===========================================================================
 140   * Set match_start to the longest match starting at the given string and
 141 @@ -1145,7 +1154,11 @@
 142  /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
 143   * match.S. The code will be functionally equivalent.
 144   */
 145 +#ifdef ORIG_LONGEST_MATCH_GLOBAL
 146 +uInt longest_match(s, cur_match)
 147 +#else
 148  local uInt longest_match(s, cur_match)
 149 +#endif
 150      deflate_state *s;
 151      IPos cur_match;                             /* current match */
 152  {
 153 @@ -1288,6 +1301,7 @@
 154      return s->lookahead;
 155  }
 156  #endif /* ASMV */
 157 +#endif /* ORIG_LONGEST_MATCHT */
 158  
 159  #else /* FASTEST */
 160  
 161 @@ -1349,6 +1363,7 @@
 162  
 163  #endif /* FASTEST */
 164  
 165 +#ifndef LONGEST_MATCH_ONLY
 166  #ifdef DEBUG
 167  /* ===========================================================================
 168   * Check that the match at match_start is indeed a match.
 169 @@ -1965,3 +1980,4 @@
 170          FLUSH_BLOCK(s, 0);
 171      return block_done;
 172  }
 173 +#endif /* ! LONGEST_MATCH_ONLY */