Patch to fix a signedness problem in libobjc

Daniel Jacobowitz drow@false.org
Fri Mar 26 21:30:00 GMT 1999


On powerpc-*-linux-*, characters are unsigned by default.  Fix a minor
nit in libobjc.

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|     CMU, CS class of 2002      |
|   Debian GNU/Linux Developer    __   Part-Time Systems Programmer  |
|         dan@debian.org         |  |        drow@cs.cmu.edu         |
\--------------------------------/  \--------------------------------/



Sat Mar 27 00:26:23 1999  Daniel Jacobowitz <dan@debian.org>

	* archive.c (__objc_code_char, objc_write_char, objc_write_type):
	Make signed explicit on char.

Index: libobjc/archive.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libobjc/archive.c,v
retrieving revision 1.2
diff -u -r1.2 archive.c
--- archive.c	1998/10/01 21:35:20	1.2
+++ archive.c	1999/03/27 05:01:04
@@ -91,7 +91,7 @@
 }
 
 static __inline__ int
-__objc_code_char (unsigned char* buf, char val)
+__objc_code_char (unsigned char* buf, signed char val)
 {
   if (val >= 0)
     return __objc_code_unsigned_char (buf, val);
@@ -104,7 +104,7 @@
 }
 
 int
-objc_write_char (struct objc_typed_stream* stream, char value)
+objc_write_char (struct objc_typed_stream* stream, signed char value)
 {
   unsigned char buf[sizeof (char)+1];
   int len = __objc_code_char (buf, value);
@@ -1000,7 +1000,7 @@
     break;
 
   case _C_CHR:
-    return objc_write_char(stream, *(char*)data);
+    return objc_write_char(stream, *(signed char*)data);
     break;
     
   case _C_UCHR:


More information about the Gcc-patches mailing list