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]

libobjc: header cleanup for new API (10)


This patch fixes a typo, which is that in the new API

 objc_lookupClass()

should actually be

 objc_lookUpClass()

(that is the name of the function in the Apple/NeXT API which we're trying
to be compatible with).

The patch changes 'objc_lookupClass' to 'objc_lookUpClass' everywhere:
it fixes headers, implementation, all callers inside libobjc and testcases
too.

Committed to trunk.

Thanks

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog     (revision 168052)
+++ gcc/testsuite/ChangeLog     (working copy)
@@ -1,5 +1,11 @@
 2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * objc.dg/gnu-api-2-objc.m: Fixed test to test objc_lookUpClass,
+       not objc_lookupClass.
+       * obj-c++.dg/gnu-api-2-objc.mm: Same change.
+       
+2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        * objc.dg/gnu-api-2-objc_msg_lookup.m: New.
        * obj-c++.dg/gnu-api-2-objc_msg_lookup.mm: New. 
 
Index: gcc/testsuite/objc.dg/gnu-api-2-objc.m
===================================================================
--- gcc/testsuite/objc.dg/gnu-api-2-objc.m      (revision 168051)
+++ gcc/testsuite/objc.dg/gnu-api-2-objc.m      (working copy)
@@ -204,9 +204,9 @@
       abort ();
   }
 
-  printf ("Testing objc_lookupClass ()...\n");
+  printf ("Testing objc_lookUpClass ()...\n");
   {
-    if (strcmp (class_getName (objc_lookupClass ("MyRootClass")),
+    if (strcmp (class_getName (objc_lookUpClass ("MyRootClass")),
                "MyRootClass") != 0)
       abort ();
   }
Index: gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm
===================================================================
--- gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm  (revision 168051)
+++ gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm  (working copy)
@@ -204,9 +204,9 @@
       abort ();
   }
 
-  std::cout << "Testing objc_lookupClass ()...\n";
+  std::cout << "Testing objc_lookUpClass ()...\n";
   {
-    if (std::strcmp (class_getName (objc_lookupClass ("MyRootClass")),
+    if (std::strcmp (class_getName (objc_lookUpClass ("MyRootClass")),
                        "MyRootClass") != 0)
       abort ();
   }
Index: libobjc/sendmsg.c
===================================================================
--- libobjc/sendmsg.c   (revision 168058)
+++ libobjc/sendmsg.c   (working copy)
@@ -228,9 +228,6 @@
   return NULL;
 }
 
-/* Temporary definition until we include objc/runtime.h.  */
-objc_EXPORT Class objc_lookupClass (const char *name);
-
 /* Given a class and selector, return the selector's
    implementation.  */
 inline
@@ -292,7 +289,7 @@
                     need to obtain the class from the meta class,
                     which we do using the fact that both the class
                     and the meta-class have the same name.  */
-                 Class realClass = objc_lookupClass (class->name);
+                 Class realClass = objc_lookUpClass (class->name);
                  if (realClass)
                    res = __objc_resolve_class_method (realClass, sel);
                }
Index: libobjc/class.c
===================================================================
--- libobjc/class.c     (revision 168050)
+++ libobjc/class.c     (working copy)
@@ -501,7 +501,7 @@
 }
 
 Class
-objc_lookupClass (const char *name)
+objc_lookUpClass (const char *name)
 {
   if (name == NULL)
     return Nil;
Index: libobjc/protocols.c
===================================================================
--- libobjc/protocols.c (revision 168050)
+++ libobjc/protocols.c (working copy)
@@ -145,7 +145,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return NO;
 
   objc_mutex_lock (__objc_runtime_mutex);
@@ -174,7 +174,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return NO;
 
   /* Acquire the runtime lock because the list of protocols for a
@@ -278,7 +278,7 @@
   if (protocol->class_pointer != anotherProtocol->class_pointer)
     return NO;
   
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return NO;
 
   if (strcmp (((struct objc_protocol *)protocol)->protocol_name,
@@ -317,7 +317,7 @@
   if (protocol->class_pointer != anotherProtocol->class_pointer)
     return NO;
   
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return NO;
 
   /* Equality between formal protocols is only formal (nothing to do
@@ -346,7 +346,7 @@
 {
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return NULL;
 
   return ((struct objc_protocol *)protocol)->protocol_name;
@@ -368,7 +368,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return no_result;
 
   if (instanceMethod)
@@ -413,7 +413,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol == NULL  ||  protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol == NULL  ||  protocol->class_pointer != objc_lookUpClass ("Protocol"))
     {
       if (numberOfReturnedMethods)
        *numberOfReturnedMethods = 0;
@@ -464,7 +464,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
     return NULL;
 
   /* TODO: New ABI.  */
@@ -479,7 +479,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol == NULL  ||  protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol == NULL  ||  protocol->class_pointer != objc_lookUpClass ("Protocol"))
     {
       if (numberOfReturnedProperties)
        *numberOfReturnedProperties = 0;
@@ -506,7 +506,7 @@
 
   /* Check that it is a Protocol object before casting it to (struct
      objc_protocol *).  */
-  if (protocol == NULL  ||  protocol->class_pointer != objc_lookupClass ("Protocol"))
+  if (protocol == NULL  ||  protocol->class_pointer != objc_lookUpClass ("Protocol"))
     {
       if (numberOfReturnedProtocols)
        *numberOfReturnedProtocols = 0;
Index: libobjc/ChangeLog
===================================================================
--- libobjc/ChangeLog   (revision 168058)
+++ libobjc/ChangeLog   (working copy)
@@ -1,5 +1,15 @@
 2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * class.c (objc_lookupClass): Renamed to objc_lookUpClass.
+       * protocols.c: Updated all calls to objc_lookupClass to call
+       objc_lookUpClass instead.
+       * sendmsg.c (objc_lookupClass): Do not declare.
+       (get_imp): Update call to objc_lookupClass to call
+       objc_lookUpClass instead.
+       * objc/runtime.h (objc_lookupClass): Renamed to objc_lookUpClass.
+
+2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        * objc/runtime.h (class_ivar_set_gcinvisible): Declare.
        * sendmsg.c (_CLS_IN_CONSTRUCTION, CLS_IS_IN_CONSTRUCTION): Do not
        define.  Updated comments.
Index: libobjc/objc/runtime.h
===================================================================
--- libobjc/objc/runtime.h      (revision 168058)
+++ libobjc/objc/runtime.h      (working copy)
@@ -427,7 +427,7 @@
    the runtime.  Return Nil if not.  This function does not call the
    objc_get_unknown_class_handler function if the class is not
    found.  */
-objc_EXPORT Class objc_lookupClass (const char *name);
+objc_EXPORT Class objc_lookUpClass (const char *name);
 
 /* Return the meta class associated to the class with name 'name', if
    it is already registered with the runtime.  First, it finds the



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