Received: from [207.176.88.85] by phillip.cerious.com (NTMail 3.03.0017/7.aaxh) with ESMTP id pcrews for <pcrews@cerious.com>; Fri, 28 Apr 2000 17:03:35 -0400
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id QAA19497;
	Fri, 28 Apr 2000 16:41:38 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Fri, 28 Apr 2000 16:40:23 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id QAA19426
	for tiff-outgoing; Fri, 28 Apr 2000 16:40:23 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from pixar.pixar.com (pixar.pixar.com [138.72.10.20])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id QAA19416
	for <tiff@olympiakos.com>; Fri, 28 Apr 2000 16:40:17 -0400
Received: from moomin.pixar.com (moomin.pixar.com [138.72.27.160])
	by pixar.pixar.com (8.9.3/8.9.3) with ESMTP id NAA18858;
	Fri, 28 Apr 2000 13:39:43 -0700 (PDT)
Received: (from mccoy@localhost)
	by moomin.pixar.com (8.9.3/8.9.3) id NAA1087033;
	Fri, 28 Apr 2000 13:39:43 -0700 (PDT)
Date: Fri, 28 Apr 2000 13:39:43 -0700 (PDT)
From: Daniel McCoy <mccoy@pixar.com>
Message-Id: <200004282039.NAA1087033@moomin.pixar.com>
To: tiff@olympiakos.com, Jan Nijtmans <j.nijtmans@chello.nl>
Subject: Re: VC++ Release build causes problems
References: <006801bfb137$2daa0ce0$883367d8@pacbell.net>
Sender: owner-tiff@olympiakos.com

Peter Montgomery wrote:
>  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--;
>   }

Jan Nijtmans wrote:
>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
