Patch for DEREF-ARRAY

Edi Weitz <[email protected]> 26 Aug 2003 12:42:17 +0200
Newsgroups gmane.lisp.uffi.general
Message-ID <[email protected]>
Completely unrelated to my last message here's a patch for LW. Without
the patch array elements can only be of primitive type, i.e. you get
an error message like, say,

  CL-GD 14 > (deref-array *a* '(:array gd-point) 2)
  Error: Attempted to dereference a pointer to aggregate type (:STRUCT GD-POINT).

Cheers,
Edi.



edi@bird:/tmp > diff -u uffi-1.3.1/src/aggregates.lisp /usr/local/lisp/source/uffi/src/aggregates.lisp
--- uffi-1.3.1/src/aggregates.lisp      Thu Aug 14 21:35:49 2003
+++ /usr/local/lisp/source/uffi/src/aggregates.lisp     Tue Aug 26 12:32:31 2003
@@ -162,7 +162,7 @@
   #+(or lispworks cmu sbcl scl) (declare (ignore type))
   #+(or cmu scl)  `(alien:deref ,obj ,i)
   #+sbcl  `(sb-alien:deref ,obj ,i)
-  #+lispworks `(fli:dereference ,obj :index ,i)
+  #+lispworks `(fli:dereference ,obj :index ,i :copy-foreign-object nil)
   #+allegro `(ff:fslot-value-typed (quote ,(convert-from-uffi-type type :type)) :c ,obj ,i)
   #+mcl
   (let* ((array-type (array-type type))