Small cleanups from last commit.

main
theraven 16 years ago
parent 8ce32fd1c9
commit 0abdc2a574

@ -27,7 +27,7 @@ static void createNSBlockSubclass(Class superclass, Class newClass,
// Set up the new class // Set up the new class
newClass->class_pointer = metaClass; newClass->class_pointer = metaClass;
newClass->super_class = superclass->name; newClass->super_class = (Class)superclass->name;
newClass->name = name; newClass->name = name;
newClass->info = _CLS_CLASS; newClass->info = _CLS_CLASS;
newClass->dtable = __objc_uninstalled_dtable; newClass->dtable = __objc_uninstalled_dtable;

@ -66,7 +66,7 @@ void __objc_init_class_tables(void)
class_table = class_table_internal_create(16); class_table = class_table_internal_create(16);
} }
static void objc_resolve_class(Class cls) void objc_resolve_class(Class cls)
{ {
// Skip this if the class is already resolved. // Skip this if the class is already resolved.
if (CLS_ISRESOLV(cls)) { return; } if (CLS_ISRESOLV(cls)) { return; }

@ -856,7 +856,7 @@ const char *object_getClassName(id obj)
} }
void __objc_add_class_to_hash(Class cls); void __objc_add_class_to_hash(Class cls);
void __objc_resolve_class_links(void); void objc_resolve_class(Class cls);
void objc_registerClassPair(Class cls) void objc_registerClassPair(Class cls)
{ {
@ -865,8 +865,8 @@ void objc_registerClassPair(Class cls)
__objc_update_dispatch_table_for_class(metaClass); __objc_update_dispatch_table_for_class(metaClass);
__objc_update_dispatch_table_for_class(cls); __objc_update_dispatch_table_for_class(cls);
__objc_add_class_to_hash(cls); __objc_add_class_to_hash(cls);
// Add pointer from super class objc_resolve_class(cls);
__objc_resolve_class_links();
} }
static id objectNew(id cls) static id objectNew(id cls)

@ -30,19 +30,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "objc/encoding.h" #include "objc/encoding.h"
#include "lock.h" #include "lock.h"
/* This is how we hack STRUCT_VALUE to be 1 or 0. */ void objc_resolve_class(Class);
#define gen_rtx(args...) 1
#define gen_rtx_MEM(args...) 1
#define gen_rtx_REG(args...) 1
/* Alread defined in gcc/coretypes.h. So prevent double definition warning. */
#undef rtx
#define rtx int
#if ! defined (STRUCT_VALUE) || STRUCT_VALUE == 0
#define INVISIBLE_STRUCT_RETURN 1
#else
#define INVISIBLE_STRUCT_RETURN 0
#endif
/* The uninstalled dispatch table */ /* The uninstalled dispatch table */
struct sarray *__objc_uninstalled_dtable = 0; /* !T:MUTEX */ struct sarray *__objc_uninstalled_dtable = 0; /* !T:MUTEX */
@ -414,7 +402,7 @@ __objc_send_initialize (Class class)
* held so that we can create the premature dtable. */ * held so that we can create the premature dtable. */
LOCK(&initialize_lock); LOCK(&initialize_lock);
if (! CLS_ISRESOLV (class)) if (! CLS_ISRESOLV (class))
__objc_resolve_class_links (); objc_resolve_class(class);
/* Create the garbage collector type memory description */ /* Create the garbage collector type memory description */
@ -555,7 +543,7 @@ static struct sarray *create_dtable_for_class (Class class)
/* If the class has not yet had its class links resolved, we must /* If the class has not yet had its class links resolved, we must
re-compute all class links */ re-compute all class links */
if (! CLS_ISRESOLV (class)) if (! CLS_ISRESOLV (class))
__objc_resolve_class_links (); objc_resolve_class(class);
super = class->super_class; super = class->super_class;

Loading…
Cancel
Save