summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-09-16 00:42:47 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-09-16 00:42:47 +0200
commit6a82b0dd5fd0f087ecda5923c6ae93fcea806141 (patch)
treefc4495093b9abe9ad2f6a96b3d080edb867df9ef /Objective-C
parentd9ac18064cf40f6fbbb09ec8ca74de212c012326 (diff)
Remember to pass self and _cmd to methods.
darcs-hash:1f832c3dba42782993127d480d2cb73aabf2406c
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.h4
-rw-r--r--Objective-C/libobjcl.m11
2 files changed, 7 insertions, 8 deletions
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
{