Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* 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...
commit a4c5dd20aa0fe63d8b34eb00c4d6285829a0487d 1 parent 6623493
evanmonroig authored April 28, 2008
7  ChangeLog
... ...
@@ -1,3 +1,10 @@
  1
+2008-04-28  Evan Monroig  <evan.monroig@gmail.com>
  2
+
  3
+	* foreign-numeric-vector.lisp (defctype): changed to use
  4
+	DEFINE-FOREIGN-TYPE so that the types are automatically converted
  5
+	with recent CFFI
  6
+	(translate-to-foreign): update lambda list
  7
+
1 8
 2008-04-24  Evan Monroig  <evan.monroig@gmail.com>
2 9
 
3 10
 	* foreign-numeric-vector.lisp (:compile-toplevel): use
15  foreign-numeric-vector.lisp
@@ -68,6 +68,8 @@
68 68
 	   (over-fnv-name (ncat 'over- fnv-name))
69 69
 	   (with-fnv-ptr-name (ncat 'with- fnv-name '-ptr))
70 70
 	   (cffi-type (intern (symbol-name (ncat 'cffi- fnv-name)) :keyword))
  71
+           (cffi-type-class (intern (symbol-name (ncat cffi-type '-type))
  72
+                                    :keyword))
71 73
 	   (foreign-elt-size (foreign-type-size cffi-underlying-type)))
72 74
       (with-gensyms (index-sym val-sym fnv-ptr-ref-sym)
73 75
 	`(progn
@@ -221,10 +223,12 @@
221 223
 		(format str " ... ~A" (,fnv-ref f (1- length))))
222 224
 	      (format str ">")))
223 225
 	  
224  
-
225  
-	  (defctype ,cffi-type :pointer)
  226
+          (define-foreign-type ,cffi-type-class ()
  227
+            ()
  228
+            (:actual-type :pointer)
  229
+            (:simple-parser ,cffi-type))
226 230
 	  (defmethod translate-to-foreign ((val ,fnv-name) 
227  
-					   (name (eql ',cffi-type)))
  231
+					   (name ,cffi-type-class))
228 232
 	    (fnv-foreign-pointer val))
229 233
 	  
230 234
 	  (setf (cffi-type-to-fnv-type ',cffi-vector-name) ,cffi-type)
@@ -272,10 +276,7 @@
272 276
 	  (export (list ',fnv-name ',make-fnv-name ',copy-fnv-name
273 277
 		   ',fnv-name-length ',fnv-ref
274 278
 		   ',in-fnv-name ',over-fnv-name ',fnv-ptr ',fnv-ptr-ref
275  
-		   ',with-fnv-ptr-name))
276  
-	  
277  
-	  
278  
-	  )))))
  279
+		   ',with-fnv-ptr-name)))))))
279 280
 
280 281
 
281 282
 (make-fnv-typed-vector int32

0 notes on commit a4c5dd2

Please sign in to comment.
Something went wrong with that request. Please try again.