diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:20:15 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:20:15 -0700 |
commit | c34c1fcbb19852ca35216ad66276f4f86af3fc22 (patch) | |
tree | 4bd0972d6c682e474725eca372f6551d539f8768 /inffast.c | |
parent | 02b6cf579f02ec78c052735020a5d3c5723ed641 (diff) | |
download | zlib-c34c1fcbb19852ca35216ad66276f4f86af3fc22.tar.gz zlib-c34c1fcbb19852ca35216ad66276f4f86af3fc22.tar.bz2 zlib-c34c1fcbb19852ca35216ad66276f4f86af3fc22.zip |
zlib 1.1.2v1.1.2
Diffstat (limited to 'inffast.c')
-rw-r--r-- | inffast.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -13,14 +13,12 @@ | |||
13 | struct inflate_codes_state {int dummy;}; /* for buggy compilers */ | 13 | struct inflate_codes_state {int dummy;}; /* for buggy compilers */ |
14 | 14 | ||
15 | /* simplify the use of the inflate_huft type with some defines */ | 15 | /* simplify the use of the inflate_huft type with some defines */ |
16 | #define base more.Base | ||
17 | #define next more.Next | ||
18 | #define exop word.what.Exop | 16 | #define exop word.what.Exop |
19 | #define bits word.what.Bits | 17 | #define bits word.what.Bits |
20 | 18 | ||
21 | /* macros for bit input with no checking and for returning unused bytes */ | 19 | /* macros for bit input with no checking and for returning unused bytes */ |
22 | #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}} | 20 | #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}} |
23 | #define UNGRAB {n+=(c=k>>3);p-=c;k&=7;} | 21 | #define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;} |
24 | 22 | ||
25 | /* Called with number of bytes left to write in window at least 258 | 23 | /* Called with number of bytes left to write in window at least 258 |
26 | (the maximum string length) and number of input bytes available | 24 | (the maximum string length) and number of input bytes available |
@@ -120,7 +118,10 @@ z_streamp z; | |||
120 | break; | 118 | break; |
121 | } | 119 | } |
122 | else if ((e & 64) == 0) | 120 | else if ((e & 64) == 0) |
123 | e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop; | 121 | { |
122 | t += t->base; | ||
123 | e = (t += ((uInt)b & inflate_mask[e]))->exop; | ||
124 | } | ||
124 | else | 125 | else |
125 | { | 126 | { |
126 | z->msg = (char*)"invalid distance code"; | 127 | z->msg = (char*)"invalid distance code"; |
@@ -133,7 +134,8 @@ z_streamp z; | |||
133 | } | 134 | } |
134 | if ((e & 64) == 0) | 135 | if ((e & 64) == 0) |
135 | { | 136 | { |
136 | if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0) | 137 | t += t->base; |
138 | if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) | ||
137 | { | 139 | { |
138 | DUMPBITS(t->bits) | 140 | DUMPBITS(t->bits) |
139 | Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? | 141 | Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? |