@@ -21,15 +21,15 @@ #import "runtime.h" #import "runtime-private.h" #import "macros.h" -static void *forward_handler = NULL; -static void *forward_handler_stret = NULL; +static IMP forward_handler = (IMP)0; +static IMP forward_handler_stret = (IMP)0; static IMP -common_method_not_found(id obj, SEL sel, IMP (*lookup)(id, SEL), void *forward) +common_method_not_found(id obj, SEL sel, IMP (*lookup)(id, SEL), IMP forward) { /* * obj might be a dummy object (see class_getMethodImplementation), so * don't access obj directly unless it's a class! */ @@ -87,11 +87,11 @@ return lookup(obj, sel); } } - if (forward != NULL) + if (forward != (IMP)0) return forward; OBJC_ERROR("Selector %c[%s] is not implemented for class %s!", (is_class ? '+' : '-'), sel_getName(sel), object_getClassName(obj)); } @@ -109,11 +109,11 @@ return common_method_not_found(obj, sel, objc_msg_lookup_stret, forward_handler_stret); } void -objc_setForwardHandler(void *forward, void *forward_stret) +objc_setForwardHandler(IMP forward, IMP forward_stret) { forward_handler = forward; forward_handler_stret = forward_stret; } @@ -121,11 +121,11 @@ class_respondsToSelector(Class cls, SEL sel) { if (cls == Nil) return false; - return (objc_sparsearray_get(cls->dtable, (uint32_t)sel->uid) != NULL); + return (objc_dtable_get(cls->dtable, (uint32_t)sel->uid) != (IMP)0); } #ifndef OF_ASM_LOOKUP static id nil_method(id self, SEL _cmd) @@ -139,14 +139,13 @@ IMP imp; if (obj == nil) return (IMP)nil_method; - imp = objc_sparsearray_get(object_getClass(obj)->dtable, - (uint32_t)sel->uid); + imp = objc_dtable_get(object_getClass(obj)->dtable, (uint32_t)sel->uid); - if (imp == NULL) + if (imp == (IMP)0) return not_found(obj, sel); return imp; } @@ -169,13 +168,13 @@ IMP imp; if (super->self == nil) return (IMP)nil_method; - imp = objc_sparsearray_get(super->cls->dtable, (uint32_t)sel->uid); + imp = objc_dtable_get(super->cls->dtable, (uint32_t)sel->uid); - if (imp == NULL) + if (imp == (IMP)0) return not_found(super->self, sel); return imp; }