In gcc/testsuite/: 2011-06-07 Nicola Pero <nicola.pero@meta-innovation.com> Iain...
authorNicola Pero <nicola.pero@meta-innovation.com>
Tue, 7 Jun 2011 20:47:12 +0000 (20:47 +0000)
committerNicola Pero <nicola@gcc.gnu.org>
Tue, 7 Jun 2011 20:47:12 +0000 (20:47 +0000)
In gcc/testsuite/:
2011-06-07  Nicola Pero  <nicola.pero@meta-innovation.com>
    Iain Sandoe  <iains@gcc.gnu.org>

* objc-obj-c++-shared/runtime.h (protocol_getMethodDescription):
Added code to deal with the case when [Protocol
-descriptionForInstanceMethod:] or [Protocol
-descriptionForClassMethod:] returns NULL.

2011-06-07  Nicola Pero  <nicola.pero@meta-innovation.com>
    Iain Sandoe  <iains@gcc.gnu.org>

* objc-obj-c++-shared/TestsuiteObject.h ([-free]): Return 'id'.
* objc-obj-c++-shared/TestsuiteObject.m ([-free]): Return 'id'.
Added cast.

Co-Authored-By: Iain Sandoe <iains@gcc.gnu.org>
From-SVN: r174766

gcc/testsuite/ChangeLog
gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h
gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m
gcc/testsuite/objc-obj-c++-shared/runtime.h

index ba89a31f9a8aa620942613fcf20fd3454c52ebec..3b5ebcf1ceac3c01c920b7db235fff190a7595a2 100644 (file)
@@ -1,3 +1,18 @@
+2011-06-07  Nicola Pero  <nicola.pero@meta-innovation.com>
+           Iain Sandoe  <iains@gcc.gnu.org>
+
+       * objc-obj-c++-shared/runtime.h (protocol_getMethodDescription):
+       Added code to deal with the case when [Protocol
+       -descriptionForInstanceMethod:] or [Protocol
+       -descriptionForClassMethod:] returns NULL.
+
+2011-06-07  Nicola Pero  <nicola.pero@meta-innovation.com>
+           Iain Sandoe  <iains@gcc.gnu.org>
+
+       * objc-obj-c++-shared/TestsuiteObject.h ([-free]): Return 'id'.
+       * objc-obj-c++-shared/TestsuiteObject.m ([-free]): Return 'id'.
+       Added cast.
+       
 2011-06-07  Xinliang David Li  <davidxl@google.com>
 
        * testsuite/gcc.dg/inline_2.c: New test.
index b6acd91f156d6197bd732bb5faac4423ff232fb6..66b68c81ec9d40f2038cac14c353d681bcb56802 100644 (file)
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 + (id) new;
 + (id) alloc;
 - (id) init;
-- (void) free;
+- (id) free;
 
 /* Auxiliary methods.  */
 + (Class) class;
index 1b033af33058fe20363c8e6e9ed2d55d3fd3bd71..2068a91643620b9751d1f306c19566e07da08b5e 100644 (file)
@@ -41,9 +41,14 @@ along with GCC; see the file COPYING3.  If not see
 {
   return self;
 }
-- (void) free
+/* We return 'id' to have the same signature as [Object -free] in
+   older runtimes and avoid warnings about conflicting signatures.  */
+- (id) free
 {
-  object_dispose (self);
+  /* Cast 'self' to 'id' because the NeXT runtime in darwin8 (Apple
+     Mac OS X 10.4) declares object_dispose to take an "Object *"
+     argument.  */
+  return object_dispose ((id)self);
 }
 + (Class) class
 {
index bdc2bff620f8795bc2a451523b77681a5f02d650..4d7d1c30b96278b51cff120ad780364720189182 100644 (file)
@@ -93,14 +93,16 @@ struct objc_method_description protocol_getMethodDescription (Protocol *protocol
   struct objc_method_description result;
 
   if (instanceMethod)
-    {
-      tmp = [protocol descriptionForInstanceMethod: selector];
-      result = *tmp;
-    }
+    tmp = [protocol descriptionForInstanceMethod: selector];
+  else
+    tmp = [protocol descriptionForClassMethod: selector];
+
+  if (tmp)
+    result = *tmp;
   else
     {
-      tmp = [protocol descriptionForClassMethod: selector];
-      result = *tmp;      
+      result.name = (SEL)0;
+      result.types = (char *)0;
     }
 
   return result;