From 73ca06d6c103bae75e837e2966c757a42d3a7969 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sat, 15 Sep 2007 18:08:56 +0200 Subject: Objective-C layer: Simplify the interface of objcl_invoke_with_types. darcs-hash:0f8730bc7a0fe966016fda8582a52a2b5f3e667d --- Objective-C/libobjcl.h | 3 +-- Objective-C/libobjcl.m | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h index 236cd3a..b47ab17 100644 --- a/Objective-C/libobjcl.h +++ b/Objective-C/libobjcl.h @@ -50,10 +50,9 @@ objcl_invoke_method (OBJCL_OBJ_DATA receiver, int argc, ...); -void +id objcl_invoke_with_types (void *receiver, SEL method_selector, - id *exception, int argc, char *return_typespec, char *arg_typespecs[], diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m index 18b76ad..d89693a 100644 --- a/Objective-C/libobjcl.m +++ b/Objective-C/libobjcl.m @@ -267,20 +267,17 @@ objcl_invoke_method (OBJCL_OBJ_DATA receiver, #ifdef USE_LIBFFI -void +id objcl_invoke_with_types (void *receiver, SEL method_selector, - id *exception, int argc, char *return_typespec, char *arg_typespecs[], void *return_value, void **argv) { - va_list arglist; IMP method; int i; - void *tmp_arg; ffi_cif cif; ffi_type *return_type; ffi_type *arg_types[argc + 2]; @@ -302,7 +299,6 @@ objcl_invoke_with_types (void *receiver, method = objc_msg_lookup (receiver, method_selector); #endif - *exception = NULL; return_type = objcl_pyobjc_signature_to_ffi_return_type (return_typespec); arg_types[0] = id_type; arg_types[1] = sel_type; @@ -322,10 +318,11 @@ objcl_invoke_with_types (void *receiver, } NS_HANDLER { - *exception = localException; - NS_VOIDRETURN; + NS_VALUERETURN (localException, id); } NS_ENDHANDLER + + return NULL; } #endif -- cgit v1.2.3