bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text drawing bug - gaps after 16th character in scaled view


From: Alexander Malmberg
Subject: Re: Text drawing bug - gaps after 16th character in scaled view
Date: Tue, 01 Jul 2003 01:15:34 +0200

Fred Kiefer wrote:
[snip]
> The actual fix solves a problem on systems where
> unsigned int == unsigned short
> does not hold. I think that this is indendent of the endianess of the
> system (You rather expect it to fail on a 16 bit or 64 bit machine).

On little-endian systems with 16-bit shorts and 32-bit ints, the lower
16 bits of the int will occupy the same memory with the same format as
the 16 bits of the short and the code will give the correct result for
characters <=65535.

(Eg. U-1234 will be stored as:

34 12 00 00

and the short would grab the first two bytes and get the correct value.
On a big-endian system, it would be stored as:

00 00 12 34

and the result would be 0 for all characters <=65535. Being able to cast
pointers to ints of different widths into each other is a nice feature
of little-endian systems, but you can't use it in portable code.)

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]