IF_DESKTOP(long long total_written = 0;)
IF_DESKTOP(long long) int retval = -1;
unsigned char *stackp;
- long code;
int finchar;
long oldcode;
long incode;
/* As above, initialize the first 256 entries in the table. */
/*clear_tab_prefixof(); - done by xzalloc */
- for (code = 255; code >= 0; --code) {
- tab_suffixof(code) = (unsigned char) code;
+ {
+ int i;
+ for (i = 255; i >= 0; --i)
+ tab_suffixof(i) = (unsigned char) i;
}
do {
(insize << 3) - (n_bits - 1));
while (inbits > posbits) {
+ long code;
+
if (free_ent > maxcode) {
posbits =
((posbits - 1) +
}
{
unsigned char *p = &inbuf[posbits >> 3];
-
- code = ((((long) (p[0])) | ((long) (p[1]) << 8) |
- ((long) (p[2]) << 16)) >> (posbits & 0x7)) & bitmask;
+ code = ((p[0]
+ | ((long) (p[1]) << 8)
+ | ((long) (p[2]) << 16)) >> (posbits & 0x7)) & bitmask;
}
posbits += n_bits;
-
if (oldcode == -1) {
if (code >= 256)
bb_error_msg_and_die("corrupted data"); /* %ld", code); */
}
/* Generate output characters in reverse order */
- while ((long) code >= (long) 256) {
+ while (code >= 256) {
if (stackp <= &htabof(0))
bb_error_msg_and_die("corrupted data");
*--stackp = tab_suffixof(code);
}
/* Generate the new entry. */
- code = free_ent;
- if (code < maxmaxcode) {
- tab_prefixof(code) = (unsigned short) oldcode;
- tab_suffixof(code) = (unsigned char) finchar;
- free_ent = code + 1;
+ if (free_ent < maxmaxcode) {
+ tab_prefixof(free_ent) = (unsigned short) oldcode;
+ tab_suffixof(free_ent) = (unsigned char) finchar;
+ free_ent++;
}
/* Remember previous code. */