Received: by cthulhu.engr.sgi.com (941129.SGI.8.6.9/911001.SGI)
	for tiff-list id JAA05617; Thu, 22 Dec 1994 09:58:43 -0800
Return-Path: <owner-tiff>
Received: from sgi.sgi.com by cthulhu.engr.sgi.com via ESMTP (941129.SGI.8.6.9/911001.SGI)
	for <tiff-relay@cthulhu.engr.sgi.com> id JAA05609; Thu, 22 Dec 1994 09:58:37 -0800
Received: from netcomsv.netcom.com by sgi.sgi.com via ESMTP (941129.SGI.8.6.9/910110.SGI)
	for <tiff@sgi.com> id JAA01930; Thu, 22 Dec 1994 09:58:32 -0800
Received: from lia.UUCP by netcomsv.netcom.com with UUCP (8.6.4/SMI-4.1)
	id JAA26987; Thu, 22 Dec 1994 09:40:01 -0800
Received: from dolly.div7 (dolly-gw) by lia.com (4.1/SMI-4.1/LIA1.1)
	id AA16520; Thu, 22 Dec 94 08:20:47 PST
Received: by dolly.div7 (4.1/SMI-4.1)
	id AA16014; Thu, 22 Dec 94 08:20:46 PST
Date: Thu, 22 Dec 94 08:20:46 PST
From: glenn@lia.com (Glenn Herteg)
Message-Id: <9412221620.AA16014@dolly.div7>
To: tiff@sgi.sgi.com
Subject: type of tif_typemask
Sender: owner-tiff@sgi.sgi.com
Precedence: bulk

The SunPro C 3.0 compiler, under strict checking options, emits the
following warnings:

acc -Xc -vc -fast -native  -I.   -c  tif_open.c
"tif_open.c", line 35: warning: constant promoted to unsigned long
"tif_open.c", line 35: warning: initializer does not fit: 0xffffffff
"tif_open.c", line 37: warning: constant promoted to unsigned long
"tif_open.c", line 37: warning: initializer does not fit: 0xffffffff
"tif_open.c", line 38: warning: constant promoted to unsigned long
"tif_open.c", line 38: warning: initializer does not fit: 0xffffffff
"tif_open.c", line 42: warning: constant promoted to unsigned long
"tif_open.c", line 42: warning: initializer does not fit: 0xffffffff
"tif_open.c", line 43: warning: constant promoted to unsigned long
"tif_open.c", line 43: warning: initializer does not fit: 0xffffffff
"tif_open.c", line 44: warning: constant promoted to unsigned long
"tif_open.c", line 44: warning: initializer does not fit: 0xffffffff
"tif_open.c", line 45: warning: constant promoted to unsigned long
"tif_open.c", line 45: warning: initializer does not fit: 0xffffffff

The warnings are generated to indicate that an unsigned value with
the high bit set cannot be truly represented as a signed value.
These messages may be eliminated by converting the tif_typemask member
of a struct tiff to an unsigned value as it is actually used, with the
changes noted below to the tiffiop.h and tif_open.c files.


*** tiffiop.h_orig	Thu Sep 29 17:01:29 1994
--- tiffiop.h	Wed Dec 21 08:22:14 1994
***************
*** 261,267 ****
  	TIFFDirectory	tif_dir;	/* internal rep of current directory */
  	TIFFHeader	tif_header;	/* file's header block */
  	const int*	tif_typeshift;	/* data type shift counts */
! 	const long*	tif_typemask;	/* data type masks */
  	uint32		tif_row;	/* current scanline */
  	tdir_t		tif_curdir;	/* current directory (index) */
  	tstrip_t	tif_curstrip;	/* current strip for read/write */
--- 261,267 ----
  	TIFFDirectory	tif_dir;	/* internal rep of current directory */
  	TIFFHeader	tif_header;	/* file's header block */
  	const int*	tif_typeshift;	/* data type shift counts */
! 	const uint32*	tif_typemask;	/* data type masks */
  	uint32		tif_row;	/* current scanline */
  	tdir_t		tif_curdir;	/* current directory (index) */
  	tstrip_t	tif_curstrip;	/* current strip for read/write */


*** tif_open.c_orig	Thu Sep 29 17:01:40 1994
--- tif_open.c	Wed Dec 21 08:22:22 1994
***************
*** 29,48 ****
   */
  #include "tiffiop.h"
  
! static const long typemask[13] = {
! 	0L,		/* TIFF_NOTYPE */
! 	0x000000ffL,	/* TIFF_BYTE */
! 	0xffffffffL,	/* TIFF_ASCII */
! 	0x0000ffffL,	/* TIFF_SHORT */
! 	0xffffffffL,	/* TIFF_LONG */
! 	0xffffffffL,	/* TIFF_RATIONAL */
! 	0x000000ffL,	/* TIFF_SBYTE */
! 	0x000000ffL,	/* TIFF_UNDEFINED */
! 	0x0000ffffL,	/* TIFF_SSHORT */
! 	0xffffffffL,	/* TIFF_SLONG */
! 	0xffffffffL,	/* TIFF_SRATIONAL */
! 	0xffffffffL,	/* TIFF_FLOAT */
! 	0xffffffffL,	/* TIFF_DOUBLE */
  };
  static const int bigTypeshift[13] = {
  	0,		/* TIFF_NOTYPE */
--- 29,48 ----
   */
  #include "tiffiop.h"
  
! static const uint32 typemask[13] = {
! 	0UL,		/* TIFF_NOTYPE */
! 	0x000000ffUL,	/* TIFF_BYTE */
! 	0xffffffffUL,	/* TIFF_ASCII */
! 	0x0000ffffUL,	/* TIFF_SHORT */
! 	0xffffffffUL,	/* TIFF_LONG */
! 	0xffffffffUL,	/* TIFF_RATIONAL */
! 	0x000000ffUL,	/* TIFF_SBYTE */
! 	0x000000ffUL,	/* TIFF_UNDEFINED */
! 	0x0000ffffUL,	/* TIFF_SSHORT */
! 	0xffffffffUL,	/* TIFF_SLONG */
! 	0xffffffffUL,	/* TIFF_SRATIONAL */
! 	0xffffffffUL,	/* TIFF_FLOAT */
! 	0xffffffffUL,	/* TIFF_DOUBLE */
  };
  static const int bigTypeshift[13] = {
  	0,		/* TIFF_NOTYPE */

Glenn Herteg
IA Corporation
glenn@lia.com


