summaryrefslogtreecommitdiff
path: root/Lisp/method-invocation.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-09-18 11:08:42 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-09-18 11:08:42 +0200
commit01fd2213c11ae1455ef305803cdc5ae674e2e75b (patch)
treecabe203165416469c8af11cd394517909e32030b /Lisp/method-invocation.lisp
parent812ce570c5712dcf0006a1bbd88c026b6953d4e0 (diff)
Really support arrays, structs, and unions.
darcs-hash:fe9faa15004fae4ab16f95f4ba9a6edf8e260945
Diffstat (limited to 'Lisp/method-invocation.lisp')
-rw-r--r--Lisp/method-invocation.lisp20
1 files changed, 17 insertions, 3 deletions
diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp
index 1db5794..edbdc17 100644
--- a/Lisp/method-invocation.lisp
+++ b/Lisp/method-invocation.lisp
@@ -373,11 +373,25 @@ Returns: *result* --- the return value of the method invocation.
;; structs actually just give us pointers to them,
;; so we just put those pointers back into the
;; functions as arguments.
- (setf (argref :pointer i) arg))
+ ;;
+ ;; Note that the target type is a struct/union,
+ ;; not a pointer. This means that we actually
+ ;; have to pass a struct/union as an argument. We
+ ;; therefore ignore the memory space reserved for
+ ;; argument cells in the argument buffer and
+ ;; simply set the argument pointer directly.
+ (setf (cffi:mem-aref objc-arg-ptrs :pointer i)
+ arg))
((array)
;; This, too, might someday be ripped out and
- ;; replaced with something better.
- (setf (argref arg-c-type i) arg))
+ ;; replaced with something more flexible. For
+ ;; now, it's the same as for structs and unions.
+ ;; That's the nice thing about opaque C data
+ ;; structures: As a binding writer, we just pass
+ ;; them around without caring about their
+ ;; structure.
+ (setf (cffi:mem-aref objc-arg-ptrs :pointer i)
+ arg))
((id)
;; This case is actually interesting. We can do a
;; lot of automatic conversion between different