Received: by whizzer.wpd.sgi.com (921026.SGI.NOSTRIP/911001.SGI)
	 id AA29569; Tue, 21 Sep 93 17:47:45 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (921026.SGI.NOSTRIP/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA29562; Tue, 21 Sep 93 10:47:43 -0700
Received: from guardian.apple.com by sgi.sgi.com via SMTP (920330.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA27439; Tue, 21 Sep 93 10:47:41 -0700
Received: from [90.1.0.8] by guardian.apple.com with SMTP (5.65/22-Jun-1993-eef)
	id AA14199; Tue, 21 Sep 93 10:33:01 -0700
	for 
Received: by alink-gw.apple.com (921113.SGI.UNSUPPORTED_PROTOTYPE/28-May-1993-eef)
	id AA26991; Tue, 21 Sep 93 10:32:33 -0700
	for TIFF@SGI.COM
Date: 21 Sep 93 17:23 GMT
From: LS.BANZAI@AppleLink.Apple.COM (Lightsource Computer Images,PRT)
Subject: Revised diffs for tif_lzw
To: TIFF@sgi.sgi.com
Message-Id: <748632752.3424021@AppleLink.Apple.COM>
Sender: tiff-owner@sgi.sgi.com

Attn: Tiff Bugs
SentBy: Eric Herrmann
 
 Revised diffs for tif_lzw.c for Windows
 9/21/93                                         10:12 AM
This is a correction of my earlier mail about tif_lzw.c for Microsoft Visual
C++ 1.0 for Windows.
 
Thank you to Soren (PINGEL@DAIMI.AAU.DK) who points out that the code field in
hash_t need only be a 16 bit int. (I apparently did not get an earlier mail
about this.) This produces the following revised diff for 3.30 beta of the
Tiff library.
 
Eric Herrmann
Light Source
LS.BANZAI@Applelink.Apple.Com
 
--------------------- tif_lzw.c:
65c65
< #define MAXCODE(n)   ((1<<(n))-1)
---
> #define MAXCODE(n)   ((1L<<(n))-1)
77c77,85
< #define  HSIZE       9001        /* 91% occupancy */
---
> #define  HSIZE       9001L       /* 91% occupancy */
>
> #ifdef _WINDOWS
> /*
>  * Must do some special pointer arithmetic.
>  */
> #include <windows.h>
> #endif
>
144c152
<  long    code;
---
>  int     code;
334c342
<      tif->tif_data = _TIFFmalloc(sizeof (LZWDecodeState));
---
>      tif->tif_data = (tidata_t)_TIFFmalloc(sizeof (LZWDecodeState));
891c899
<      tif->tif_data = _TIFFmalloc(sizeof (LZWEncodeState));
---
>      tif->tif_data = (tidata_t)_TIFFmalloc(sizeof (LZWEncodeState));
1012a1021,1035
> #ifdef _WINDOWS
>              /*
>               * 64K segment pointer arithmetic! Yuk!
>               * Subtracting a value from a pointer can easily become
>               * negative, but with a segment:offset pointer the
>               * offset is unsigned and thus wraps around.
>               * This code is for MSVC 1.0.
>               */
>              register long   offset;
>
>              offset = (long) OFFSETOF( hp ) - disp * sizeof( hash_t );
>              if ( offset < FIELDOFFSET( LZWEncodeState, enc_hashtab ) )
>                  offset += HSIZE * sizeof( hash_t);
>              hp = (hash_t *) MAKELP( SELECTOROF( hp ), offset );
> #else
1014a1038
> #endif
1218a1243
>
 
 



