2000.04.28 02:38 "VC++ Release build causes problems", by Peter Montgomery

2000.04.28 20:39 "Re: VC++ Release build causes problems", by Daniel McCoy

How about:

   code = 255;
   do {
      sp->dec_codetab[code].value = code;
      sp->dec_codetab[code].firstchar = code;
      sp->dec_codetab[code].length = 1;
      sp->dec_codetab[code].next = NULL;
   } while (code--)

It's just as efficient as the original code, and now it's save to make the "code" variable an unsigned char. Wouldn't that make everybody happy?

Excellent solution. Seems like a reasonable compromise.

Just for curiosity and and a little perspective on this situation, I browsed some code history. The first record I have of that particular loop, with int index initializing unsigned char, is dated 1989. So when blaming libtiff for something, just keep in mind that this library has been mature software for a long time.

Dan McCoy    Pixar   mccoy@pixar.com