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 --- Lisp/libobjcl.lisp | 2 -- Lisp/method-invocation.lisp | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Lisp') diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp index d1efe53..6cb9759 100644 --- a/Lisp/libobjcl.lisp +++ b/Lisp/libobjcl.lisp @@ -33,8 +33,6 @@ &rest) (defcfun ("objcl_invoke_with_types" %objcl-invoke-with-types) :pointer - (receiver (:pointer :void)) - (method_selector (:pointer :void)) (argc :int) (return_typespec (:pointer :char)) (arg_typespecs (:pointer (:pointer :char))) diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp index 43a3365..c44fb04 100644 --- a/Lisp/method-invocation.lisp +++ b/Lisp/method-invocation.lisp @@ -189,11 +189,15 @@ Returns: *result* --- the return value of the method invocation. (type-name->type-id return-type))) (selector (selector method-name))) (cffi:with-foreign-objects ((arg-types '(:pointer :char) (length args)) - (objc-args '(:pointer :void) (length args)) + (objc-args '(:pointer :void) (+ (length args) 2)) (return-value-cell return-c-type)) (flet ((ad-hoc-arglist->objc-arglist! (args) + (setf (cffi:mem-aref objc-args '(:pointer :void) 0) + (pointer-to receiver) + (cffi:mem-aref objc-args '(:pointer :void) 1) + (pointer-to selector)) (loop for arg in args - for i from 0 + for i from 2 do (let* ((type-name (lisp-value->type-name arg)) #+(or) (cffi-type (type-name->lisp-type type-name))) @@ -220,7 +224,7 @@ Returns: *result* --- the return value of the method invocation. (dealloc-ad-hoc-objc-arglist () (dotimes (i (length args)) (cffi:foreign-free - (cffi:mem-aref objc-args '(:pointer :void) i)) + (cffi:mem-aref objc-args '(:pointer :void) (+ i 2))) (cffi:foreign-string-free (cffi:mem-aref arg-types '(:pointer :char) i))))) (ad-hoc-arglist->objc-arglist! args) -- cgit v1.2.3