chiark / gitweb /
Added declaration to get rid of a couple of warnings.
[clg] / glib / ffi.lisp
index 759f43d27caedcdfb9e65b78849e493b2ee0837d..aa95293c21073f0df01502b960a2af901e611d43 100644 (file)
@@ -15,7 +15,7 @@
 ;; License along with this library; if not, write to the Free Software
 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-;; $Id: ffi.lisp,v 1.16 2005-02-22 17:27:25 espen Exp $
+;; $Id: ffi.lisp,v 1.17 2005-02-25 23:55:06 espen Exp $
 
 (in-package "GLIB")
 
@@ -461,6 +461,15 @@ (defmethod size-of ((type (eql 'single-float)) &rest args)
   (declare (ignore type args))
   +size-of-float+)
 
+(defmethod to-alien-form (form (type (eql 'single-float)) &rest args)
+  (declare (ignore type args))
+  `(coerce ,form 'single-float))
+
+(defmethod to-alien-function ((type (eql 'single-float)) &rest args)
+  (declare (ignore type args))
+  #'(lambda (number)
+      (coerce number 'single-float)))
+
 (defmethod writer-function ((type (eql 'single-float)) &rest args)
   (declare (ignore type args))
   #'(lambda (value location &optional (offset 0))
@@ -480,6 +489,15 @@ (defmethod size-of ((type (eql 'double-float)) &rest args)
   (declare (ignore type args))
   +size-of-double+)
 
+(defmethod to-alien-form (form (type (eql 'double-float)) &rest args)
+  (declare (ignore type args))
+  `(coerce ,form 'double-float))
+
+(defmethod to-alien-function ((type (eql 'double-float)) &rest args)
+  (declare (ignore type args))
+  #'(lambda (number)
+      (coerce number 'double-float)))
+
 (defmethod writer-function ((type (eql 'double-float)) &rest args)
   (declare (ignore type args))
   #'(lambda (value location &optional (offset 0))