From: Richard Kenner Date: Wed, 26 Apr 1995 23:16:05 +0000 (-0400) Subject: Changed Class * to Class in order to match NEXTSTEP and OpenStep X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0994488a6b5c574eb7f0b5d20379014fd4972b53;p=gcc.git Changed Class * to Class in order to match NEXTSTEP and OpenStep runtime. From-SVN: r9497 --- diff --git a/gcc/objc/Object.h b/gcc/objc/Object.h index e2722dc18fb..cb8e00fecdb 100644 --- a/gcc/objc/Object.h +++ b/gcc/objc/Object.h @@ -1,5 +1,5 @@ /* Interface for the Object class for Objective-C. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -35,7 +35,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ */ @interface Object { - Class* isa; /* A pointer to the instance's class structure */ + Class isa; /* A pointer to the instance's class structure */ } /* Initializing classes and instances */ @@ -52,9 +52,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - deepCopy; /* Identifying classes */ -- (Class*)class; -- (Class*)superClass; -- (MetaClass*)metaClass; +- (Class)class; +- (Class)superClass; +- (MetaClass)metaClass; - (const char *)name; /* Identifying and comparing objects */ @@ -69,8 +69,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - (BOOL)isInstance; /* Testing inheritance relationships */ -- (BOOL)isKindOf:(Class*)aClassObject; -- (BOOL)isMemberOf:(Class*)aClassObject; +- (BOOL)isKindOf:(Class)aClassObject; +- (BOOL)isMemberOf:(Class)aClassObject; - (BOOL)isKindOfClassNamed:(const char *)aClassName; - (BOOL)isMemberOfClassNamed:(const char *)aClassName; @@ -97,8 +97,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame; /* Posing */ -+ poseAs:(Class*)aClassObject; -- (Class*)transmuteClassTo:(Class*)aClassObject; ++ poseAs:(Class)aClassObject; +- (Class)transmuteClassTo:(Class)aClassObject; /* Enforcing intentions */ - subclassResponsibility:(SEL)aSel; diff --git a/gcc/objc/Object.m b/gcc/objc/Object.m index 1716d1d37c3..6187c9663ba 100644 --- a/gcc/objc/Object.m +++ b/gcc/objc/Object.m @@ -1,5 +1,5 @@ /* The implementation of class Object for Objective-C. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -81,17 +81,17 @@ extern int errno; return [self copy]; } -- (Class*)class +- (Class)class { return object_get_class(self); } -- (Class*)superClass +- (Class)superClass { return object_get_super_class(self); } -- (MetaClass*)metaClass +- (MetaClass)metaClass { return object_get_meta_class(self); } @@ -143,9 +143,9 @@ extern int errno; return object_is_instance(self); } -- (BOOL)isKindOf:(Class*)aClassObject +- (BOOL)isKindOf:(Class)aClassObject { - Class* class; + Class class; for (class = self->isa; class!=Nil; class = class_get_super_class(class)) if (class==aClassObject) @@ -153,14 +153,14 @@ extern int errno; return NO; } -- (BOOL)isMemberOf:(Class*)aClassObject +- (BOOL)isMemberOf:(Class)aClassObject { return self->isa==aClassObject; } - (BOOL)isKindOfClassNamed:(const char *)aClassName { - Class* class; + Class class; if (aClassName!=NULL) for (class = self->isa; class!=Nil; class = class_get_super_class(class)) @@ -204,7 +204,7 @@ extern int errno; struct objc_protocol_list* proto_list; id parent; - for (proto_list = ((Class*)self)->protocols; + for (proto_list = ((Class)self)->protocols; proto_list; proto_list = proto_list->next) { for (i=0; i < proto_list->count; i++) @@ -280,19 +280,19 @@ extern int errno; return objc_msg_sendv(self, aSel, argFrame); } -+ poseAs:(Class*)aClassObject ++ poseAs:(Class)aClassObject { return class_pose_as(self, aClassObject); } -- (Class*)transmuteClassTo:(Class*)aClassObject +- (Class)transmuteClassTo:(Class)aClassObject { if (object_is_instance(self)) if (class_is_class(aClassObject)) if (class_get_instance_size(aClassObject)==class_get_instance_size(isa)) if ([self isKindOf:aClassObject]) { - Class* old_isa = isa; + Class old_isa = isa; isa = aClassObject; return old_isa; } diff --git a/gcc/objc/archive.c b/gcc/objc/archive.c index f2d5f714e4c..42a4a004cf8 100644 --- a/gcc/objc/archive.c +++ b/gcc/objc/archive.c @@ -1,22 +1,21 @@ /* GNU Objective C Runtime archiving - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2, or (at your option) any later version. +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. You should have received a copy of the GNU General Public License along with - GNU CC; see the file COPYING. If not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +GNU CC; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable @@ -45,7 +44,7 @@ extern int fflush(FILE*); /* Declare some functions... */ static int -objc_read_class (struct objc_typed_stream* stream, Class** class); +objc_read_class (struct objc_typed_stream* stream, Class* class); int objc_sizeof_type(const char* type); @@ -796,7 +795,7 @@ objc_read_object (struct objc_typed_stream* stream, id* object) if (buf[0] == (_B_EXT | _BX_OBJECT)) { - Class* class; + Class class; /* get class */ len = objc_read_class (stream, &class); @@ -849,7 +848,7 @@ objc_read_object (struct objc_typed_stream* stream, id* object) } static int -objc_read_class (struct objc_typed_stream* stream, Class** class) +objc_read_class (struct objc_typed_stream* stream, Class* class) { unsigned char buf[sizeof (unsigned int)]; int len; @@ -958,7 +957,7 @@ objc_write_type(TypedStream* stream, const char* type, const void* data) break; case _C_CLASS: - return objc_write_class (stream, *(Class**)data); + return objc_write_class (stream, *(Class*)data); break; case _C_SEL: @@ -1052,7 +1051,7 @@ objc_read_type(TypedStream* stream, const char* type, void* data) break; case _C_CLASS: - return objc_read_class (stream, (Class**)data); + return objc_read_class (stream, (Class*)data); break; case _C_SEL: @@ -1153,7 +1152,7 @@ objc_write_types (TypedStream* stream, const char* type, ...) break; case _C_CLASS: - res = objc_write_class (stream, *va_arg(args, Class**)); + res = objc_write_class (stream, *va_arg(args, Class*)); break; case _C_SEL: @@ -1252,7 +1251,7 @@ objc_read_types(TypedStream* stream, const char* type, ...) break; case _C_CLASS: - res = objc_read_class(stream, va_arg(args, Class**)); + res = objc_read_class(stream, va_arg(args, Class*)); break; case _C_SEL: @@ -1589,7 +1588,7 @@ objc_flush_typed_stream (TypedStream* stream) } long -objc_get_stream_class_version (TypedStream* stream, Class* class) +objc_get_stream_class_version (TypedStream* stream, Class class) { if (stream->class_table) return PTR2LONG(hash_value_for_key (stream->class_table, class->name)); diff --git a/gcc/objc/class.c b/gcc/objc/class.c index 4d674fe363b..0e7d49b1403 100644 --- a/gcc/objc/class.c +++ b/gcc/objc/class.c @@ -1,22 +1,21 @@ /* GNU Objective C Runtime class related functions - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup, Dennis Glatting + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup and Dennis Glatting. This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2, or (at your option) any later version. +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. You should have received a copy of the GNU General Public License along with - GNU CC; see the file COPYING. If not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +GNU CC; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable @@ -33,7 +32,7 @@ static cache_ptr __objc_class_hash = 0; /* This is a hook which is called by objc_get_class and objc_lookup_class if the runtime is not able to find the class. This may e.g. try to load in the class using dynamic loading */ -Class* (*_objc_lookup_class)(const char* name) = 0; +Class (*_objc_lookup_class)(const char* name) = 0; /* True when class links has been resolved */ @@ -59,9 +58,9 @@ void __objc_init_class_tables() /* This function adds a class to the class hash table, and assigns the class a number, unless it's already known */ void -__objc_add_class_to_hash(Class* class) +__objc_add_class_to_hash(Class class) { - Class* h_class; + Class h_class; /* make sure the table is there */ assert(__objc_class_hash); @@ -88,9 +87,9 @@ __objc_add_class_to_hash(Class* class) /* Get the class object for the class named NAME. If NAME does not identify a known class, the hook _objc_lookup_class is called. If this fails, nil is returned */ -Class* objc_lookup_class (const char* name) +Class objc_lookup_class (const char* name) { - Class* class; + Class class; /* Make sure the class hash table exists. */ assert (__objc_class_hash); @@ -109,10 +108,10 @@ Class* objc_lookup_class (const char* name) /* Get the class object for the class named NAME. If NAME does not identify a known class, the hook _objc_lookup_class is called. If this fails, an error message is issued and the system aborts */ -Class* +Class objc_get_class (const char *name) { - Class* class; + Class class; /* Make sure the class hash table exists. */ assert (__objc_class_hash); @@ -132,7 +131,7 @@ objc_get_class (const char *name) abort(); } -MetaClass* +MetaClass objc_get_meta_class(const char *name) { return objc_get_class(name)->class_pointer; @@ -147,7 +146,7 @@ objc_get_meta_class(const char *name) while ((class = objc_next_class(&es))) ... do something with class; */ -Class* +Class objc_next_class(void **enum_state) { /* make sure the table is there */ @@ -157,7 +156,7 @@ objc_next_class(void **enum_state) hash_next(__objc_class_hash, *(node_ptr*)enum_state); if (*(node_ptr*)enum_state) return (*(node_ptr*)enum_state)->value; - return (Class*)0; + return (Class)0; } /* Resolve super/subclass links for all classes. The only thing we @@ -166,7 +165,7 @@ objc_next_class(void **enum_state) void __objc_resolve_class_links() { node_ptr node; - Class* object_class = objc_get_class ("Object"); + Class object_class = objc_get_class ("Object"); assert(object_class); @@ -174,7 +173,7 @@ void __objc_resolve_class_links() for (node = hash_next (__objc_class_hash, NULL); node; node = hash_next (__objc_class_hash, node)) { - Class* class1 = node->value; + Class class1 = node->value; /* Make sure we have what we think we have. */ assert (CLS_ISCLASS(class1)); @@ -190,7 +189,7 @@ void __objc_resolve_class_links() if(class1->super_class) { - Class* a_super_class + Class a_super_class = objc_get_class ((char *) class1->super_class); assert (a_super_class); @@ -225,8 +224,8 @@ void __objc_resolve_class_links() for (node = hash_next (__objc_class_hash, NULL); node; node = hash_next (__objc_class_hash, node)) { - Class* class1 = node->value; - Class* sub_class; + Class class1 = node->value; + Class sub_class; for (sub_class = class1->subclass_list; sub_class; sub_class = sub_class->sibling_class) { @@ -241,11 +240,11 @@ void __objc_resolve_class_links() #define CLASSOF(c) ((c)->class_pointer) -Class* -class_pose_as (Class* impostor, Class* super_class) +Class +class_pose_as (Class impostor, Class super_class) { node_ptr node; - Class* class1; + Class class1; if (!CLS_ISRESOLV (impostor)) __objc_resolve_class_links (); @@ -259,16 +258,16 @@ class_pose_as (Class* impostor, Class* super_class) assert (impostor->instance_size == super_class->instance_size); { - Class **subclass = &(super_class->subclass_list); + Class *subclass = &(super_class->subclass_list); /* move subclasses of super_class to impostor */ while (*subclass) { - Class *nextSub = (*subclass)->sibling_class; + Class nextSub = (*subclass)->sibling_class; if (*subclass != impostor) { - Class *sub = *subclass; + Class sub = *subclass; /* classes */ sub->sibling_class = impostor->subclass_list; @@ -311,7 +310,7 @@ class_pose_as (Class* impostor, Class* super_class) for (node = hash_next (__objc_class_hash, NULL); node; node = hash_next (__objc_class_hash, node)) { - class1 = (Class*)node->value; + class1 = (Class)node->value; if (class1 == super_class) { node->value = impostor; /* change hash table value */ diff --git a/gcc/objc/encoding.c b/gcc/objc/encoding.c index 27b4b8a4d0d..7f64046a487 100644 --- a/gcc/objc/encoding.c +++ b/gcc/objc/encoding.c @@ -1,7 +1,6 @@ /* Encoding of types for Objective C. - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup This file is part of GNU CC. @@ -64,7 +63,7 @@ objc_sizeof_type(const char* type) break; case _C_CLASS: - return sizeof(Class*); + return sizeof(Class); break; case _C_SEL: @@ -171,7 +170,7 @@ objc_alignof_type(const char* type) break; case _C_CLASS: - return __alignof__(Class*); + return __alignof__(Class); break; case _C_SEL: diff --git a/gcc/objc/objc.h b/gcc/objc/objc.h index 2b74a1b7af4..93655e6c7ed 100644 --- a/gcc/objc/objc.h +++ b/gcc/objc/objc.h @@ -1,5 +1,5 @@ /* Basic data types for Objective C. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -76,7 +76,7 @@ typedef id (*IMP)(id, SEL, ...); ** More simple types... */ #define nil (id)0 /* id of Nil instance */ -#define Nil (Class*)0 /* id of Nil class */ +#define Nil (Class)0 /* id of Nil class */ typedef char *STR; /* String alias */ /* @@ -89,10 +89,10 @@ typedef char *STR; /* String alias */ ** change type. The compiler generates "char* const" and places a string in ** the following member variables: super_class. */ -typedef struct objc_class MetaClass; -typedef struct objc_class Class; +typedef struct objc_class *MetaClass; +typedef struct objc_class *Class; struct objc_class { - MetaClass* class_pointer; /* Pointer to the class's + MetaClass class_pointer; /* Pointer to the class's meta class. */ struct objc_class* super_class; /* Pointer to the super class. NULL for class diff --git a/gcc/objc/objects.c b/gcc/objc/objects.c index 5c64fdaaf51..ed0899eb77e 100644 --- a/gcc/objc/objects.c +++ b/gcc/objc/objects.c @@ -1,22 +1,21 @@ /* GNU Objective C Runtime class related functions - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2, or (at your option) any later version. +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. You should have received a copy of the GNU General Public License along with - GNU CC; see the file COPYING. If not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +GNU CC; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable @@ -27,16 +26,16 @@ You should have received a copy of the GNU General Public License along with #include "../tconfig.h" /* include defs of bzero for target */ #include "runtime.h" /* the kitchen sink */ -id __objc_object_alloc(Class*); +id __objc_object_alloc(Class); id __objc_object_dispose(id); id __objc_object_copy(id); -id (*_objc_object_alloc)(Class*) = __objc_object_alloc; +id (*_objc_object_alloc)(Class) = __objc_object_alloc; id (*_objc_object_dispose)(id) = __objc_object_dispose; id (*_objc_object_copy)(id) = __objc_object_copy; id -class_create_instance(Class* class) +class_create_instance(Class class) { id new = nil; if (CLS_ISCLASS(class)) @@ -71,7 +70,7 @@ object_dispose(id object) return nil; } -id __objc_object_alloc(Class* class) +id __objc_object_alloc(Class class) { return (id)__objc_xmalloc(class->instance_size); } diff --git a/gcc/objc/runtime.h b/gcc/objc/runtime.h index 224c4490011..8086b25b15b 100644 --- a/gcc/objc/runtime.h +++ b/gcc/objc/runtime.h @@ -1,22 +1,21 @@ /* GNU Objective C Runtime internal declarations - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2, or (at your option) any later version. +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. You should have received a copy of the GNU General Public License along with - GNU CC; see the file COPYING. If not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +GNU CC; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable @@ -41,15 +40,15 @@ You should have received a copy of the GNU General Public License along with #include "objc/hash.h" /* hash structures */ #include "objc/list.h" /* linear lists */ -extern void __objc_add_class_to_hash(Class*); /* (objc-class.c) */ +extern void __objc_add_class_to_hash(Class); /* (objc-class.c) */ extern void __objc_init_selector_tables(); /* (objc-sel.c) */ -extern void __objc_init_class_tables(); /* (objc-class.c) */ +extern void __objc_init_class_tables(); /* (objc-class.c) */ extern void __objc_init_dispatch_tables(); /* (objc-dispatch.c) */ -extern void __objc_install_premature_dtable(Class*); /* (objc-dispatch.c) */ -extern void __objc_resolve_class_links(); /* (objc-class.c) */ -extern void __objc_register_selectors_from_class(Class*); /* (objc-sel.c) */ -extern void __objc_update_dispatch_table_for_class (Class*);/* (objc-msg.c) */ -extern void class_add_method_list(Class*, MethodList_t); +extern void __objc_install_premature_dtable(Class); /* (objc-dispatch.c) */ +extern void __objc_resolve_class_links(); /* (objc-class.c) */ +extern void __objc_register_selectors_from_class(Class); /* (objc-sel.c) */ +extern void __objc_update_dispatch_table_for_class (Class);/* (objc-msg.c) */ +extern void class_add_method_list(Class, MethodList_t); extern void objc_error(id object, const char* fmt, va_list); extern void (*_objc_error)(id, const char*, va_list); diff --git a/gcc/objc/selector.c b/gcc/objc/selector.c index 5f7ac213dfb..9adb56a2948 100644 --- a/gcc/objc/selector.c +++ b/gcc/objc/selector.c @@ -1,22 +1,21 @@ /* GNU Objective C Runtime selector related functions - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2, or (at your option) any later version. +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. You should have received a copy of the GNU General Public License along with - GNU CC; see the file COPYING. If not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +GNU CC; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable @@ -54,7 +53,7 @@ void __objc_init_selector_tables() /* This routine is given a class and records all of the methods in its class structure in the record table. */ void -__objc_register_selectors_from_class (Class* class) +__objc_register_selectors_from_class (Class class) { MethodList_t method_list; diff --git a/gcc/objc/sendmsg.c b/gcc/objc/sendmsg.c index 81854857898..9f252d8ffa5 100644 --- a/gcc/objc/sendmsg.c +++ b/gcc/objc/sendmsg.c @@ -1,22 +1,21 @@ /* GNU Objective C Runtime message lookup - Copyright (C) 1993 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup + Copyright (C) 1993, 1995 Free Software Foundation, Inc. + Contributed by Kresten Krab Thorup This file is part of GNU CC. GNU CC is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2, or (at your option) any later version. +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. You should have received a copy of the GNU General Public License along with - GNU CC; see the file COPYING. If not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +GNU CC; see the file COPYING. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable @@ -43,9 +42,9 @@ You should have received a copy of the GNU General Public License along with struct sarray* __objc_uninstalled_dtable = 0; /* Send +initialize to class */ -static void __objc_send_initialize(Class*); +static void __objc_send_initialize(Class); -static void __objc_install_dispatch_table_for_class (Class*); +static void __objc_install_dispatch_table_for_class (Class); /* Forward declare some functions */ static void __objc_init_install_dtable(id, SEL); @@ -57,7 +56,7 @@ static __big static id #endif __objc_block_forward(id, SEL, ...); -static Method_t search_for_method_in_hierarchy (Class* class, SEL sel); +static Method_t search_for_method_in_hierarchy (Class class, SEL sel); static Method_t search_for_method_in_list(MethodList_t list, SEL op); id nil_method(id, SEL, ...); @@ -70,7 +69,7 @@ nil_method(id receiver, SEL op, ...) /* Given a class and selector, return the selector's implementation. */ __inline__ IMP -get_imp (Class* class, SEL sel) +get_imp (Class class, SEL sel) { IMP impl; void* res = sarray_get (class->dtable, (size_t) sel->sel_id); @@ -187,16 +186,16 @@ static void __objc_init_install_dtable(id receiver, SEL op) else { /* receiver is a class object */ - assert(CLS_ISCLASS((Class*)receiver)); + assert(CLS_ISCLASS((Class)receiver)); assert(CLS_ISMETA(receiver->class_pointer)); /* Install real dtable for factory methods */ __objc_install_dispatch_table_for_class (receiver->class_pointer); if (strcmp (sel_get_name (op), "initialize")) - __objc_send_initialize((Class*)receiver); + __objc_send_initialize((Class)receiver); else - CLS_SETINITIALIZED((Class*)receiver); + CLS_SETINITIALIZED((Class)receiver); } allready_initialized: @@ -215,14 +214,14 @@ allready_initialized: /* Install dummy table for class which causes the first message to that class (or instances hereof) to be initialized properly */ -void __objc_install_premature_dtable(Class* class) +void __objc_install_premature_dtable(Class class) { assert(__objc_uninstalled_dtable); class->dtable = __objc_uninstalled_dtable; } /* Send +initialize to class if not already done */ -static void __objc_send_initialize(Class* class) +static void __objc_send_initialize(Class class) { /* This *must* be a class object */ assert(CLS_ISCLASS(class)); @@ -264,9 +263,9 @@ static void __objc_send_initialize(Class* class) } static void -__objc_install_dispatch_table_for_class (Class* class) +__objc_install_dispatch_table_for_class (Class class) { - Class* super; + Class super; MethodList_t mlist; int counter; @@ -302,9 +301,9 @@ __objc_install_dispatch_table_for_class (Class* class) } } -void __objc_update_dispatch_table_for_class (Class* class) +void __objc_update_dispatch_table_for_class (Class class) { - Class* next; + Class next; /* not yet installed -- skip it */ if (class->dtable == __objc_uninstalled_dtable) @@ -329,7 +328,7 @@ void __objc_update_dispatch_table_for_class (Class* class) methods installed rightaway, and their selectors are made into SEL's by the function __objc_register_selectors_from_class. */ void -class_add_method_list (Class* class, MethodList_t list) +class_add_method_list (Class class, MethodList_t list) { int i; static SEL initialize_sel = 0; @@ -370,13 +369,13 @@ class_add_method_list (Class* class, MethodList_t list) Method_t -class_get_instance_method(Class* class, SEL op) +class_get_instance_method(Class class, SEL op) { return search_for_method_in_hierarchy(class, op); } Method_t -class_get_class_method(MetaClass* class, SEL op) +class_get_class_method(MetaClass class, SEL op) { return search_for_method_in_hierarchy(class, op); } @@ -387,10 +386,10 @@ class_get_class_method(MetaClass* class, SEL op) otherwise. */ static Method_t -search_for_method_in_hierarchy (Class* cls, SEL sel) +search_for_method_in_hierarchy (Class cls, SEL sel) { Method_t method = NULL; - Class* class; + Class class; if (! sel_is_mapped (sel)) return NULL; diff --git a/gcc/objc/typedstream.h b/gcc/objc/typedstream.h index f3d7cd987cb..f02a6fd1a4b 100644 --- a/gcc/objc/typedstream.h +++ b/gcc/objc/typedstream.h @@ -1,5 +1,5 @@ /* GNU Objective-C Typed Streams interface. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -98,7 +98,7 @@ int objc_read_types (TypedStream* stream, const char* type, ...); 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); /*