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

2000.04.28 18:33 "Re: VC++ Release build causes problems", by Jan Nijtmans

unsigned char VCCCompilerFix;

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

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?

I didn't test this code with VC++ 5.0, but theoretically it should work.

Regards,

Jan Nijtmans, CMG Arnhem B.V.
email: j.nijtmans@chello.nl (private)
       jan.nijtmans@cmg.nl  (work)
url:   http://purl.oclc.org/net/nijtmans/