From 8c5f730bddb827eaca240ed97bf396250caee30c Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 14 Feb 2008 22:02:21 +0100 Subject: Simplify the type handling API. darcs-hash:9e2c0c2caf9589869f7894c3522a776748df38fd --- Lisp/method-invocation.lisp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'Lisp/method-invocation.lisp') diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp index c0e44ac..2389a9f 100644 --- a/Lisp/method-invocation.lisp +++ b/Lisp/method-invocation.lisp @@ -309,12 +309,12 @@ easier to use with __apply__. (defun typespec->c-type (typespec) - (case (car typespec) + (case (typespec-primary-type typespec) ((:pointer pointer struct union id objective-c-class exception array selector) :pointer) ((:string) :string) - (otherwise (car typespec)))) + (otherwise (typespec-primary-type typespec)))) (defun low-level-invoke (receiver selector return-typestring return-type @@ -428,22 +428,15 @@ easier to use with __apply__. objc-arg-ptrs))) (unless (cffi:null-pointer-p error-cell) (error (make-condition 'exception :pointer error-cell))) - (case (let ((nominal-type (find-if #'(lambda (x) - (and (consp x) - (eq (car x) 'nominally))) - (cadr return-type)))) - ;; Do the modifiers include something like - ;; (NOMINALLY :UNSIGNED-CHAR)? - (if nominal-type - (cadr nominal-type) - (car return-type))) + (case (or (typespec-nominal-type return-type) + (typespec-primary-type return-type)) ((id objective-c-class exception selector) (let ((*skip-retaining* (or *skip-retaining* (constructor-name-p (selector-name selector))))) (make-pointer-wrapper (car return-type) - :pointer (cffi:mem-ref objc-return-value-cell - return-c-type)))) + :pointer (cffi:mem-ref objc-return-value-cell + return-c-type)))) ((:char :unsigned-char) ;; FIXME: This is non-trivial. See policy.lisp for ;; details. -- cgit v1.2.3