made nbits a long

This commit is contained in:
ceriel 1988-06-13 17:57:39 +00:00
parent ed5868aa06
commit be8815e2b7
2 changed files with 5 additions and 6 deletions

View file

@ -80,7 +80,7 @@ extern item_t *fb_ptr[4*FB_SIZE];
#ifdef THREE_PASS #ifdef THREE_PASS
extern char bittab[BITMAX>>3]; extern char bittab[BITMAX>>3];
/* one bit per small-large decision */ /* one bit per small-large decision */
extern short nbits; /* number of decisions so far */ extern long nbits; /* number of decisions so far */
#endif #endif
#ifdef LISTING #ifdef LISTING

View file

@ -179,15 +179,14 @@ small(fitsmall, gain)
nosect(); nosect();
if (bflag) if (bflag)
return(0); return(0);
if ((bit = nbits++) >= BITMAX) { if (nbits == BITMAX) {
if (bit != BITMAX)
nbits--; /* prevent wraparound */
else if (pass == PASS_1) else if (pass == PASS_1)
warning("bit table overflow"); warning("bit table overflow");
return(0); return(0);
} }
p = &bittab[bit>>3]; p = &bittab[(int) (nbits>>3)];
bit = 1 << (bit&7); bit = 1 << ((int)nbits&7);
nbits++;
switch (pass) { switch (pass) {
case PASS_1: case PASS_1:
return(0); return(0);