diff --git a/category.h b/category.h index 3878ca6..4a3b685 100644 --- a/category.h +++ b/category.h @@ -37,7 +37,7 @@ struct objc_category struct objc_property_list *class_properties; }; -struct objc_category_legacy +struct objc_category_gcc { /** * The name of this category. @@ -50,11 +50,11 @@ struct objc_category_legacy /** * The list of instance methods to add to the class. */ - struct objc_method_list_legacy *instance_methods; + struct objc_method_list_gcc *instance_methods; /** * The list of class methods to add to the class. */ - struct objc_method_list_legacy *class_methods; + struct objc_method_list_gcc *class_methods; /** * The list of protocols adopted by this category. */ diff --git a/class.h b/class.h index bfd6b11..0c3df08 100644 --- a/class.h +++ b/class.h @@ -144,7 +144,7 @@ struct objc_class }; // end: objc_class -struct legacy_gnustep_objc_class +struct objc_class_gsv1 { /** * Pointer to the metaclass for this class. The metaclass defines the @@ -187,12 +187,12 @@ struct legacy_gnustep_objc_class /** * Metadata describing the instance variables in this class. */ - struct objc_ivar_list_legacy *ivars; + struct objc_ivar_list_gcc *ivars; /** * Metadata for for defining the mappings from selectors to IMPs. Linked * list of method list structures, one per class and one per category. */ - struct objc_method_list_legacy *methods; + struct objc_method_list_gcc *methods; /** * The dispatch table for this class. Intialized and maintained by the * runtime. @@ -283,7 +283,7 @@ struct legacy_gnustep_objc_class * same fields, and you can test the new abi flag to tell whether it is safe to * access the subsequent fields. */ -struct legacy_gcc_objc_class +struct objc_class_gcc { struct objc_class *isa; struct objc_class *super_class; @@ -291,7 +291,7 @@ struct legacy_gcc_objc_class long version; unsigned long info; long instance_size; - struct objc_ivar_list_legacy *ivars; + struct objc_ivar_list_gcc *ivars; struct objc_method_list *methods; void *dtable; struct objc_class *subclass_list; @@ -375,7 +375,7 @@ static inline BOOL objc_test_class_flag(struct objc_class *aClass, return (aClass->info & (unsigned long)flag) == (unsigned long)flag; } -static inline BOOL objc_test_class_flag_legacy(struct legacy_gnustep_objc_class *aClass, +static inline BOOL objc_test_class_flag_legacy(struct objc_class_gsv1 *aClass, enum objc_class_flags flag) { return (aClass->info & (unsigned long)flag) == (unsigned long)flag; @@ -396,7 +396,7 @@ static inline int objc_get_class_version(struct objc_class *aClass) return aClass->abi_version + 1; } -static inline int objc_get_class_version_legacy(struct legacy_gnustep_objc_class *aClass) +static inline int objc_get_class_version_legacy(struct objc_class_gsv1 *aClass) { if (!objc_test_class_flag_legacy(aClass, objc_class_flag_new_abi)) { diff --git a/class_table.c b/class_table.c index f49276a..1d3c11f 100644 --- a/class_table.c +++ b/class_table.c @@ -167,7 +167,7 @@ PRIVATE BOOL objc_resolve_class(Class cls) } else { - struct legacy_gnustep_objc_class *ocls = objc_legacy_class_for_class(cls); + struct objc_class_gsv1 *ocls = objc_legacy_class_for_class(cls); if (ocls != NULL) { const char *super_name = (const char*)ocls->super_class; @@ -258,7 +258,7 @@ PRIVATE BOOL objc_resolve_class(Class cls) // Fix up the ivar offsets objc_compute_ivar_offsets(cls); - struct legacy_gnustep_objc_class *oldCls = objc_legacy_class_for_class(cls); + struct objc_class_gsv1 *oldCls = objc_legacy_class_for_class(cls); if (oldCls) { oldCls->super_class = cls->super_class; diff --git a/ivar.c b/ivar.c index 614fe6b..73f0a24 100644 --- a/ivar.c +++ b/ivar.c @@ -91,7 +91,7 @@ PRIVATE void objc_compute_ivar_offsets(Class class) } // If we have a legacy ivar list, update the offset in it too - // code from older compilers may access this directly! - struct legacy_gnustep_objc_class* legacy = objc_legacy_class_for_class(class); + struct objc_class_gsv1* legacy = objc_legacy_class_for_class(class); if (legacy) { for (i = 0 ; i < class->ivars->count ; i++) diff --git a/ivar.h b/ivar.h index 4ab592e..6170dca 100644 --- a/ivar.h +++ b/ivar.h @@ -75,7 +75,7 @@ static inline ivar_ownership ivarGetOwnership(Ivar ivar) /** * Legacy ivar structure, inherited from the GCC ABI. */ -struct objc_ivar_legacy +struct objc_ivar_gcc { /** * Name of this instance variable. @@ -123,7 +123,7 @@ struct objc_ivar_list /** * Legacy version of the ivar list */ -struct objc_ivar_list_legacy +struct objc_ivar_list_gcc { /** * The number of instance variables in this list. @@ -133,6 +133,6 @@ struct objc_ivar_list_legacy * An array of instance variable metadata structures. Note that this array * has count elements. */ - struct objc_ivar_legacy ivar_list[]; + struct objc_ivar_gcc ivar_list[]; }; diff --git a/legacy.c b/legacy.c index 7d64c26..8c99730 100644 --- a/legacy.c +++ b/legacy.c @@ -12,7 +12,7 @@ PRIVATE size_t lengthOfTypeEncoding(const char *types); -static ivar_ownership ownershipForIvar(struct legacy_gnustep_objc_class *cls, int idx) +static ivar_ownership ownershipForIvar(struct objc_class_gsv1 *cls, int idx) { if (objc_get_class_version_legacy(cls) < 2) { @@ -29,9 +29,9 @@ static ivar_ownership ownershipForIvar(struct legacy_gnustep_objc_class *cls, in return ownership_unsafe; } -static struct objc_ivar_list *upgradeIvarList(struct legacy_gnustep_objc_class *cls) +static struct objc_ivar_list *upgradeIvarList(struct objc_class_gsv1 *cls) { - struct objc_ivar_list_legacy *l = cls->ivars; + struct objc_ivar_list_gcc *l = cls->ivars; if (l == NULL) { return NULL; @@ -69,7 +69,7 @@ static struct objc_ivar_list *upgradeIvarList(struct legacy_gnustep_objc_class * return n; } -static struct objc_method_list *upgradeMethodList(struct objc_method_list_legacy *old) +static struct objc_method_list *upgradeMethodList(struct objc_method_list_gcc *old) { if (old == NULL) { @@ -246,12 +246,12 @@ static struct objc_property_list *upgradePropertyList(struct objc_property_list_ static int legacy_key; -PRIVATE struct legacy_gnustep_objc_class* objc_legacy_class_for_class(Class cls) +PRIVATE struct objc_class_gsv1* objc_legacy_class_for_class(Class cls) { - return (struct legacy_gnustep_objc_class*)objc_getAssociatedObject((id)cls, &legacy_key); + return (struct objc_class_gsv1*)objc_getAssociatedObject((id)cls, &legacy_key); } -PRIVATE Class objc_upgrade_class(struct legacy_gnustep_objc_class *oldClass) +PRIVATE Class objc_upgrade_class(struct objc_class_gsv1 *oldClass) { Class cls = calloc(sizeof(struct objc_class), 1); cls->isa = oldClass->isa; @@ -268,16 +268,16 @@ PRIVATE Class objc_upgrade_class(struct legacy_gnustep_objc_class *oldClass) objc_register_selectors_from_class(cls); if (!objc_test_class_flag(cls, objc_class_flag_meta)) { - cls->isa = objc_upgrade_class((struct legacy_gnustep_objc_class*)cls->isa); + cls->isa = objc_upgrade_class((struct objc_class_gsv1*)cls->isa); objc_setAssociatedObject((id)cls, &legacy_key, (id)oldClass, OBJC_ASSOCIATION_ASSIGN); } return cls; } -PRIVATE struct objc_category *objc_upgrade_category(struct objc_category_legacy *old) +PRIVATE struct objc_category *objc_upgrade_category(struct objc_category_gcc *old) { struct objc_category *cat = calloc(1, sizeof(struct objc_category)); - memcpy(cat, old, sizeof(struct objc_category_legacy)); + memcpy(cat, old, sizeof(struct objc_category_gcc)); cat->instance_methods = upgradeMethodList(old->instance_methods); cat->class_methods = upgradeMethodList(old->class_methods); return cat; diff --git a/legacy.h b/legacy.h index f6cd5da..a132619 100644 --- a/legacy.h +++ b/legacy.h @@ -5,10 +5,10 @@ #include "category.h" #include "protocol.h" -PRIVATE Class objc_upgrade_class(struct legacy_gnustep_objc_class *oldClass); -PRIVATE struct objc_category *objc_upgrade_category(struct objc_category_legacy *); +PRIVATE Class objc_upgrade_class(struct objc_class_gsv1 *oldClass); +PRIVATE struct objc_category *objc_upgrade_category(struct objc_category_gcc *); -PRIVATE struct legacy_gnustep_objc_class* objc_legacy_class_for_class(Class); +PRIVATE struct objc_class_gsv1* objc_legacy_class_for_class(Class); PRIVATE struct objc_protocol *objc_upgrade_protocol_gcc(struct objc_protocol_gcc*); PRIVATE struct objc_protocol *objc_upgrade_protocol_gsv1(struct objc_protocol_gsv1*); diff --git a/method_list.h b/method_list.h index c9f56da..99a64aa 100644 --- a/method_list.h +++ b/method_list.h @@ -17,7 +17,7 @@ struct objc_method const char *types; }; -struct objc_method_legacy +struct objc_method_gcc { /** * Selector used to send messages to this method. The type encoding of @@ -66,12 +66,12 @@ struct objc_method_list /** * Legacy version of the method list. */ -struct objc_method_list_legacy +struct objc_method_list_gcc { /** * The next group of methods in the list. */ - struct objc_method_list_legacy *next; + struct objc_method_list_gcc *next; /** * The number of methods in this list. */ @@ -79,5 +79,5 @@ struct objc_method_list_legacy /** * An array of methods. Note that the actual size of this is count. */ - struct objc_method_legacy methods[]; + struct objc_method_gcc methods[]; };