[cups.bugs] [MOD] STR #1193: Byte swapping issue in

Helge Blischke h.blischke at srz.de
Tue Jun 7 11:23:44 PDT 2005


"jlovell.apple" wrote:
> 
> [STR New]
> 
> The big-endian/little-endian swapping code in cups_raster_read_header is
> broken; the attached patch fixes it.
> 
> Thanks!
> 
> Link: http://www.cups.org/str.php?L1193
> Version: 1.2-current
> 
>   ------------------------------------------------------------------------
> 
>    raster.c.patchName: raster.c.patch
>                  Type: Plain Text (text/plain)

Just a footnote:
a couple of years ago I wrote a set of preprocessor macros that hide the
details
of byte swapping from the user in a very convenient way: once you have
set an
indicator if to swap bytes or not, you simply use macros like SHORT,
USHORT, LONG,
ULONG, INT, etc, like
	long a,b;
	short s;
/*...*/
	if (s == SHORT(0x00fe))
		a = LONG(LONG(b) + 5;

etc.

If there is interest, I may post that stuff.

Helge

-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de




More information about the cups-devel mailing list