@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2021 Jonathan Schleifer + * Copyright (c) 2008-2022 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -39,15 +39,16 @@ if (!(object_getClass(object)->info & OBJC_CLASS_INFO_INITIALIZED)) { Class class = (isClass ? (Class)object : object_getClass(object)); - objc_initialize_class(class); + objc_initializeClass(class); if (!(class->info & OBJC_CLASS_INFO_SETUP)) - OBJC_ERROR("Could not dispatch message for incomplete " - "class %s!", class_getName(class)); + OBJC_ERROR("Could not dispatch message %s for " + "incomplete class %s!", + sel_getName(selector), class_getName(class)); /* * We don't need to handle the case that super was called. * The reason for this is that a call to super is not possible * before a message to the class has been sent and it thus has @@ -95,18 +96,18 @@ (isClass ? '+' : '-'), sel_getName(selector), object_getClassName(object)); } IMP -objc_method_not_found(id object, SEL selector) +objc_methodNotFound(id object, SEL selector) { return commonMethodNotFound(object, selector, objc_msg_lookup, forwardHandler); } IMP -objc_method_not_found_stret(id object, SEL selector) +objc_methodNotFound_stret(id object, SEL selector) { return commonMethodNotFound(object, selector, objc_msg_lookup_stret, stretForwardHandler); } @@ -121,11 +122,11 @@ class_respondsToSelector(Class class, SEL selector) { if (class == Nil) return false; - return (objc_dtable_get(class->DTable, + return (objc_dtable_get(class->dTable, (uint32_t)selector->UID) != (IMP)0); } #ifndef OF_ASM_LOOKUP static id @@ -140,11 +141,11 @@ IMP imp; if (object == nil) return (IMP)nilMethod; - imp = objc_dtable_get(object_getClass(object)->DTable, + imp = objc_dtable_get(object_getClass(object)->dTable, (uint32_t)selector->UID); if (imp == (IMP)0) return notFound(object, selector); @@ -152,17 +153,17 @@ } IMP objc_msg_lookup(id object, SEL selector) { - return commonLookup(object, selector, objc_method_not_found); + return commonLookup(object, selector, objc_methodNotFound); } IMP objc_msg_lookup_stret(id object, SEL selector) { - return commonLookup(object, selector, objc_method_not_found_stret); + return commonLookup(object, selector, objc_methodNotFound_stret); } static OF_INLINE IMP commonSuperLookup(struct objc_super *super, SEL selector, IMP (*notFound)(id, SEL)) @@ -170,11 +171,11 @@ IMP imp; if (super->self == nil) return (IMP)nilMethod; - imp = objc_dtable_get(super->class->DTable, (uint32_t)selector->UID); + imp = objc_dtable_get(super->class->dTable, (uint32_t)selector->UID); if (imp == (IMP)0) return notFound(super->self, selector); return imp; @@ -181,14 +182,14 @@ } IMP objc_msg_lookup_super(struct objc_super *super, SEL selector) { - return commonSuperLookup(super, selector, objc_method_not_found); + return commonSuperLookup(super, selector, objc_methodNotFound); } IMP objc_msg_lookup_super_stret(struct objc_super *super, SEL selector) { - return commonSuperLookup(super, selector, objc_method_not_found_stret); + return commonSuperLookup(super, selector, objc_methodNotFound_stret); } #endif