Subject: Re: CVS commit: pkgsrc
To: None <source-changes@netbsd.org, toshii@netbsd.org>
From: Wolfgang Solfrank <ws@tools.de>
List: source-changes
Date: 01/02/2001 16:03:09
Hi,

> Module Name:	pkgsrc
> Committed By:	toshii
> Date:		Mon Jan  1 07:51:10 UTC 2001
> 
> Modified Files:
> 	pkgsrc/graphics/clanlib/files: patch-sum
> 	pkgsrc/graphics/clanlib/patches: patch-aj
> 
> Log Message:
> Make this package work on arches where char is signed.

Hmm, I stumbled over this problem just yesterday.

Apart from your change, the patch is wrong anyway.  The order of evaluation
of the two read_* routines in those assignements isn't defined (at least not
in C; I'm not 100% sure whether this is true for C++, too, but I'd be very
surprised if it wasn't).

The correct fix would be something along the lines of:

	short xmin = datafile->read_uchar8();
	xmin |= datafile->read_char8() << 8;

	short ymin = datafile->read_uchar8();
	ymin |= datafile->read_char8() << 8;

	short xmax = datafile->read_uchar8();
	xmax |= datafile->read_char8() << 8;

	short ymax = datafile->read_uchar8();
	ymax |= datafile->read_char8() << 8;

Ciao,
Wolfgang
-- 
ws@TooLs.DE     Wolfgang Solfrank, TooLs GmbH 	+49-228-985800