From 6a82b0dd5fd0f087ecda5923c6ae93fcea806141 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 16 Sep 2007 00:42:47 +0200 Subject: Remember to pass self and _cmd to methods. darcs-hash:1f832c3dba42782993127d480d2cb73aabf2406c --- Objective-C/libobjcl.h | 4 +--- Objective-C/libobjcl.m | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'Objective-C') diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h index b47ab17..d2f5e76 100644 --- a/Objective-C/libobjcl.h +++ b/Objective-C/libobjcl.h @@ -51,9 +51,7 @@ objcl_invoke_method (OBJCL_OBJ_DATA receiver, ...); id -objcl_invoke_with_types (void *receiver, - SEL method_selector, - int argc, +objcl_invoke_with_types (int argc, char *return_typespec, char *arg_typespecs[], void *return_value, diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m index 7dc5de2..4fe4aef 100644 --- a/Objective-C/libobjcl.m +++ b/Objective-C/libobjcl.m @@ -268,9 +268,7 @@ objcl_invoke_method (OBJCL_OBJ_DATA receiver, #ifdef USE_LIBFFI id -objcl_invoke_with_types (void *receiver, - SEL method_selector, - int argc, +objcl_invoke_with_types (int argc, char *return_typespec, char *arg_typespecs[], void *return_value, @@ -283,6 +281,9 @@ objcl_invoke_with_types (void *receiver, ffi_type *arg_types[argc + 2]; ffi_status status; + id receiver = (id) argv[0]; + SEL method_selector = (SEL) argv[1]; + static ffi_type *id_type = NULL; static ffi_type *sel_type = NULL; @@ -294,7 +295,7 @@ objcl_invoke_with_types (void *receiver, NS_DURING { #ifdef __NEXT_RUNTIME__ - method = class_getInstanceMethod ([((id) receiver) class], method_selector)->method_imp; + method = class_getInstanceMethod ([receiver class], method_selector)->method_imp; #else method = objc_msg_lookup (receiver, method_selector); #endif @@ -319,7 +320,7 @@ objcl_invoke_with_types (void *receiver, userInfo: nil] raise]; } - ffi_call (&cif, (void *) method, return_value, argv); + ffi_call (&cif, FFI_FN (method), return_value, argv); } NS_HANDLER { -- cgit v1.2.3