From patchwork Sun Dec 19 15:14:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 76133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3C2EFB70A3 for ; Mon, 20 Dec 2010 02:14:21 +1100 (EST) Received: (qmail 28835 invoked by alias); 19 Dec 2010 15:14:20 -0000 Received: (qmail 28821 invoked by uid 22791); 19 Dec 2010 15:14:18 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL, BAYES_05, SARE_SUB_ENC_UTF8, TW_BJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Dec 2010 15:14:13 +0000 Received: from eggs.gnu.org ([140.186.70.92]:53793) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PUKxd-00076j-7I for gcc-patches@gnu.org; Sun, 19 Dec 2010 10:14:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUKxe-0005Tb-Hg for gcc-patches@gnu.org; Sun, 19 Dec 2010 10:14:12 -0500 Received: from smtp191.iad.emailsrvr.com ([207.97.245.191]:59091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUKxe-0005TW-CY for gcc-patches@gnu.org; Sun, 19 Dec 2010 10:14:10 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp39.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id ADBBD9815D for ; Sun, 19 Dec 2010 10:14:09 -0500 (EST) Received: from dynamic1.wm-web.iad.mlsrvr.com (dynamic1.wm-web.iad1a.rsapps.net [192.168.2.150]) by smtp39.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 9A5B89814F for ; Sun, 19 Dec 2010 10:14:09 -0500 (EST) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic1.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 6286FC98070 for ; Sun, 19 Dec 2010 10:14:09 -0500 (EST) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Sun, 19 Dec 2010 16:14:09 +0100 (CET) Date: Sun, 19 Dec 2010 16:14:09 +0100 (CET) Subject: =?UTF-8?Q?libobjc:=20header=20cleanup=20for=20new=20API=20(10)?= From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1292771649.394711829@192.168.2.227> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 + * 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 + * 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 + * 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 + * 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