Re: deref-array types
Cyrus Harmon <ch-uffi-dl6SmSK5uza1Z/[email protected]> Mon, 7 Feb 2005 13:19:02 -0800
| Newsgroups | gmane.lisp.uffi.devel |
|---|---|
| Message-ID | <[email protected]> |
On Feb 7, 2005, at 12:53 PM, Kevin Rosenberg wrote:
> I don't have my powerpc system operational to test this.
> But, I do see that the test array.1 in test/arrays.lisp has a very
> similar form. Does this test work on your system?
Indeed, it does. So it looks like '(:array :int) and :int both work (on
OpenMCL) but '(* :int) fails.
>> Furthermore, 18 of the 61 tests in the UFFI test suite fail on
>> OpenMCL.
>> I can't be the first one to have run this. Has anyone else seen this?
>
> Yes, that's known. Edi added some foreign variable accessing routines
> to UFFI to support his cl-gd package. However, no one has added
> support for this to openmcl. Those are the tests that I'm aware that
> openmcl fails. Last I checked, though, the deref-array stuff worked on
> openmcl. Still, perhaps you found a bug.
So the test works, but there's still a problem WRT the docs, which is
that the def-array-pointer syntax doesn't work:
(uffi:def-array-pointer int-array-pointer :int)
(defun test-deref-array ()
(let ((fa (uffi:allocate-foreign-object :int 32)))
(dotimes (i 32)
(setf (uffi:deref-array fa 'int-array-pointer i) (* i i)))
(dotimes (i 32)
(print (uffi:deref-array fa '(:array :int) i)))))
the second deref-array works, but the first one (with the
'int-array-pointer) doesn't.
The docs suggest the method that fails, the tests use the method that
works. I'm still not clear on the difference between * and :array
though...
Thanks,
Cyrus