This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: [libobjc] Make GNU runtime headers (more) ObjC++ friendly


I shall commit this as super-obvious.

2004-03-05 Ziemowit Laski <zlaski@apple.com>

        * objc/hash.h (hash_string, compare_strings):
        Add type-casts to make Objective-C++ happy.
        * objc/typedstream.h (objc_get_stream_class_version):
        Rename parameter from 'class' to 'class_name' to make
        Objective-C++ happy.

Index: libobjc/objc/hash.h
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/objc/hash.h,v
retrieving revision 1.7
diff -u -3 -p -r1.7 hash.h
--- libobjc/objc/hash.h 20 Oct 2003 21:50:13 -0000      1.7
+++ libobjc/objc/hash.h 5 Mar 2004 20:58:44 -0000
@@ -172,7 +172,7 @@ hash_string (cache_ptr cache, const void
 {
   unsigned int ret = 0;
   unsigned int ctr = 0;
-  const char *ckey = key;
+  const char *ckey = (const char *) key;

   while (*ckey) {
     ret ^= *ckey++ << ctr;
@@ -200,7 +200,7 @@ compare_strings (const void *k1, const v
   else if (k1 == 0 || k2 == 0)
     return 0;
   else
-    return ! strcmp (k1, k2);
+    return ! strcmp ((const char *) k1, (const char *) k2);
 }


Index: libobjc/objc/typedstream.h =================================================================== RCS file: /cvs/gcc/gcc/libobjc/objc/typedstream.h,v retrieving revision 1.3 diff -u -3 -p -r1.3 typedstream.h --- libobjc/objc/typedstream.h 23 May 2003 20:04:58 -0000 1.3 +++ libobjc/objc/typedstream.h 5 Mar 2004 20:58:44 -0000 @@ -99,7 +99,7 @@ int objc_read_types (TypedStream* stream int objc_write_object_reference (TypedStream* stream, id object); int objc_write_root_object (TypedStream* stream, id object);

-long objc_get_stream_class_version (TypedStream* stream, Class class);
+long objc_get_stream_class_version (TypedStream* stream, Class class_type);



/*



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]