r1588: Added array allocation to allocate-foreign-objects
[uffi.git] / tests / array-2d.cl
index 9e344db55f2882182e20e89d0aea01b9a6c2cdd0..5a9522098a9cba540ede849e73214dd7dff81d5e 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: array-2d.cl,v 1.1 2002/03/18 02:27:32 kevin Exp $
+;;;; $Id: array-2d.cl,v 1.2 2002/03/18 22:47:57 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 
 (uffi:def-constant +column-length+ 10)
 
-(uffi:def-array long-array (:long 10))
-
 (defun test-array-2d ()
   "Tests 2d array"
-  (let ((a (uffi:allocate-foreign-object long-array)))
+  (let ((a (uffi:allocate-foreign-object :long +column-length+)))
     (dotimes (i +column-length+)
-      (setf (uffi:deref-array a :long i) (* i i)))
+      (setf (uffi:deref-array a '(:array :long) i) (* i i)))
     (dotimes (i +column-length+)
-      (format "~&~D => ~D" i (uffi:deref-array a 'long-array i)))
-    (uffi:free-foreign-object a)))
+      (format t "~&~D => ~D" i (uffi:deref-array a '(:array :long) i)))
+    (uffi:free-foreign-object a))
+  (values))
 
 #+test-uffi
 (test-array-2d)