Xref: utzoo comp.unix.aix:153 gnu.emacs.bug:1243 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!xanth!mcnc!rti!xyzzy!dg-rtp!meissner From: meissner@twohot.rtp.dg.com (Michael Meissner) Newsgroups: comp.unix.aix,gnu.emacs.bug Subject: Re: GNU Emacs 18.55 and AIX PS/2 1.1 Message-ID: Date: 16 Oct 89 15:49:34 GMT References: <347@synsys.UUCP> <34525@srcsip.UUCP> <2896@netcom.UUCP> Sender: usenet@xyzzy.UUCP Distribution: na Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 20 In-reply-to: hue@netcom.UUCP's message of 12 Oct 89 05:27:01 GMT In article <2896@netcom.UUCP> hue@netcom.UUCP (Jonathan Hue) writes: > It's not a bug - chars are unsigned in the PS/2's compiler. It shouldn't > extend the sign when promoting to an int. When I brought up 18.52 I used > something like the following: > > #define SIGN_EXTEND_CHAR(x) ((x) & 0x80 ? ((x) - 255) : (x)) A usually more efficent way of sign extending characters (depending on how much branches cost in terms of hardware speed or compiler optimizations) is: #define SIGN_EXTEND_CHAR(a) ((((a) & 0xFF) ^ 0x80) - 0x80) The & 0xFF can be eliminated if you are sure that a is in fact a char variable and not an integer, since that automatically occurs in promoting an unsigned char to int. -- Michael Meissner, Data General. If compiles where much Uucp: ...!mcnc!rti!xyzzy!meissner faster, when would we Internet: meissner@dg-rtp.DG.COM have time for netnews?