r9320: add THE declaration to DEREF array, fix convert-to-uffi-type to make unsized...
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 12 May 2004 18:43:31 +0000 (18:43 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 12 May 2004 18:43:31 +0000 (18:43 +0000)
src/aggregates.lisp
src/primitives.lisp

index 523bd4f72983eadee80b0aa91ef86c6e3bae09ca..255e226ea70e86574daab2166954577499a1d6af 100644 (file)
@@ -159,9 +159,9 @@ of the enum-name name, separator-string, and field-name"
 
 (defmacro deref-array (obj type i)
   "Returns a field from a row"
-  #+(or lispworks cmu sbcl scl) (declare (ignore type))
-  #+(or cmu scl)  `(alien:deref ,obj ,i)
-  #+sbcl  `(sb-alien:deref ,obj ,i)
+  #+(or lispworks scl) (declare (ignore type))
+  #+(or cmu scl)  `(alien:deref (the (alien:alien ,(convert-from-uffi-type type :declare)) ,obj) ,i)
+  #+sbcl  `(sb-alien:deref (the (sb-alien:alien ,(convert-from-uffi-type type :declare)) ,obj) ,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)
   #+openmcl
index c430894f711922ace55c007c5e25b1e660128575..26737bdce30205db01bcb2bee0eab4a6fa27ff67 100644 (file)
@@ -277,6 +277,15 @@ supports takes advantage of this optimization."
   (let ((result (%convert-from-uffi-type type context)))
     (cond
      ((atom result) result)
+     ;; Arrays without size are really pointers to type on SBCL/CMUCL
+     #+sbcl
+     ((and (consp type) (= 2 (length type)) (eq :array (car type)))
+      (setf (car result) 'sb-alien:*)
+      result)
+     #+cmu
+     ((and (consp type) (= 2 (length type)) (eq :array (car type)))
+      (setf (car result) 'alien:*)
+      result)
      #+openmcl
      ((eq (car result) :address)
       (if (eq context :struct)