Permalink
Browse files

* foreign-numeric-vector.lisp (defctype): changed to use

	DEFINE-FOREIGN-TYPE so that the types are automatically converted
	with recent CFFI
	(translate-to-foreign): update lambda list
  • Loading branch information...
1 parent 6623493 commit a4c5dd20aa0fe63d8b34eb00c4d6285829a0487d @evanmonroig evanmonroig committed Apr 28, 2008
Showing with 15 additions and 7 deletions.
  1. +7 −0 ChangeLog
  2. +8 −7 foreign-numeric-vector.lisp
View
7 ChangeLog
@@ -1,3 +1,10 @@
+2008-04-28 Evan Monroig <evan.monroig@gmail.com>
+
+ * foreign-numeric-vector.lisp (defctype): changed to use
+ DEFINE-FOREIGN-TYPE so that the types are automatically converted
+ with recent CFFI
+ (translate-to-foreign): update lambda list
+
2008-04-24 Evan Monroig <evan.monroig@gmail.com>
* foreign-numeric-vector.lisp (:compile-toplevel): use
View
15 foreign-numeric-vector.lisp
@@ -68,6 +68,8 @@
(over-fnv-name (ncat 'over- fnv-name))
(with-fnv-ptr-name (ncat 'with- fnv-name '-ptr))
(cffi-type (intern (symbol-name (ncat 'cffi- fnv-name)) :keyword))
+ (cffi-type-class (intern (symbol-name (ncat cffi-type '-type))
+ :keyword))
(foreign-elt-size (foreign-type-size cffi-underlying-type)))
(with-gensyms (index-sym val-sym fnv-ptr-ref-sym)
`(progn
@@ -221,10 +223,12 @@
(format str " ... ~A" (,fnv-ref f (1- length))))
(format str ">")))
-
- (defctype ,cffi-type :pointer)
+ (define-foreign-type ,cffi-type-class ()
+ ()
+ (:actual-type :pointer)
+ (:simple-parser ,cffi-type))
(defmethod translate-to-foreign ((val ,fnv-name)
- (name (eql ',cffi-type)))
+ (name ,cffi-type-class))
(fnv-foreign-pointer val))
(setf (cffi-type-to-fnv-type ',cffi-vector-name) ,cffi-type)
@@ -272,10 +276,7 @@
(export (list ',fnv-name ',make-fnv-name ',copy-fnv-name
',fnv-name-length ',fnv-ref
',in-fnv-name ',over-fnv-name ',fnv-ptr ',fnv-ptr-ref
- ',with-fnv-ptr-name))
-
-
- )))))
+ ',with-fnv-ptr-name)))))))
(make-fnv-typed-vector int32

0 comments on commit a4c5dd2

Please sign in to comment.