version 1.1.1.2, 2013/10/14 07:51:14
|
version 1.1.1.3, 2021/03/17 00:32:36
|
Line 54 unsigned short FAR *work;
|
Line 54 unsigned short FAR *work;
|
code FAR *next; /* next available space in table */ |
code FAR *next; /* next available space in table */ |
const unsigned short FAR *base; /* base value table to use */ |
const unsigned short FAR *base; /* base value table to use */ |
const unsigned short FAR *extra; /* extra bits table to use */ |
const unsigned short FAR *extra; /* extra bits table to use */ |
int end; /* use base and extra for symbol > end */ | unsigned match; /* use base and extra for symbol >= match */ |
unsigned short count[MAXBITS+1]; /* number of codes of each length */ |
unsigned short count[MAXBITS+1]; /* number of codes of each length */ |
unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ |
unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ |
static const unsigned short lbase[31] = { /* Length codes 257..285 base */ |
static const unsigned short lbase[31] = { /* Length codes 257..285 base */ |
Line 181 unsigned short FAR *work;
|
Line 181 unsigned short FAR *work;
|
switch (type) { |
switch (type) { |
case CODES: |
case CODES: |
base = extra = work; /* dummy value--not used */ |
base = extra = work; /* dummy value--not used */ |
end = 19; | match = 20; |
break; |
break; |
case LENS: |
case LENS: |
base = lbase; |
base = lbase; |
base -= 257; |
|
extra = lext; |
extra = lext; |
extra -= 257; | match = 257; |
end = 256; | |
break; |
break; |
default: /* DISTS */ |
default: /* DISTS */ |
base = dbase; |
base = dbase; |
extra = dext; |
extra = dext; |
end = -1; | match = 0; |
} |
} |
|
|
/* initialize state for loop */ |
/* initialize state for loop */ |
Line 216 unsigned short FAR *work;
|
Line 214 unsigned short FAR *work;
|
for (;;) { |
for (;;) { |
/* create table entry */ |
/* create table entry */ |
here.bits = (unsigned char)(len - drop); |
here.bits = (unsigned char)(len - drop); |
if ((int)(work[sym]) < end) { | if (work[sym] + 1u < match) { |
here.op = (unsigned char)0; |
here.op = (unsigned char)0; |
here.val = work[sym]; |
here.val = work[sym]; |
} |
} |
else if ((int)(work[sym]) > end) { | else if (work[sym] >= match) { |
here.op = (unsigned char)(extra[work[sym]]); | here.op = (unsigned char)(extra[work[sym] - match]); |
here.val = base[work[sym]]; | here.val = base[work[sym] - match]; |
} |
} |
else { |
else { |
here.op = (unsigned char)(32 + 64); /* end of block */ |
here.op = (unsigned char)(32 + 64); /* end of block */ |