From d9e5bb32782a70e01c4c5ee545556393a76fbbb2 Mon Sep 17 00:00:00 2001 From: Liam Healy <liam@thinkpad.local> Date: Tue, 11 Nov 2008 21:46:44 -0500 Subject: [PATCH] New function #'cl-cffi renamed from #'cl-ffa To make terminology consistent, the "C standard" form of type, also what I call "CFFI" form, is called that instead of "FFA" in some places. Specifically, #'cl-cffi is renamed from #'cl-ffa and now the name matches the already-existing #'cffi-cl. --- data/data.lisp | 11 ++++++----- data/maref.lisp | 6 +++--- init/defmfun.lisp | 6 +++--- init/element-types.lisp | 25 ++++++++++++------------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/data/data.lisp b/data/data.lisp index 21f79743..a7e7b7b7 100644 --- a/data/data.lisp +++ b/data/data.lisp @@ -1,6 +1,7 @@ -;; Data using ffa -;; Liam Healy 2008-04-06 21:23:41EDT data-ffa.lisp -;; Time-stamp: <2008-11-02 17:38:20EST data.lisp> +;; "Data" is bulk arrayed data, like vectors, matrices, permutations, +;; combinations, or histograms. +;; Liam Healy 2008-04-06 21:23:41EDT +;; Time-stamp: <2008-11-11 21:37:21EST data.lisp> ;; $Id$ (in-package :gsl) @@ -58,7 +59,7 @@ (defun element-size (object) "The size of each element as stored in C." - (cffi:foreign-type-size (cl-ffa (element-type object)))) + (cffi:foreign-type-size (cl-cffi (element-type object)))) ;;;;**************************************************************************** ;;;; Definition of specific data classes @@ -134,7 +135,7 @@ ;;;;**************************************************************************** (defun component-type (eltype) - (cl-ffa (component-float-type eltype))) + (cl-cffi (component-float-type eltype))) (defun component-size (object) (if (subtypep (element-type object) 'complex) diff --git a/data/maref.lisp b/data/maref.lisp index a5373727..2c5f5723 100644 --- a/data/maref.lisp +++ b/data/maref.lisp @@ -1,6 +1,6 @@ ;; Get/set array or elements: cl-array, maref ;; Liam Healy 2008-08-27 22:43:10EDT maref.lisp -;; Time-stamp: <2008-08-31 11:07:34EDT maref.lisp> +;; Time-stamp: <2008-11-11 21:37:44EST maref.lisp> ;; $Id: $ (in-package :gsl) @@ -128,8 +128,8 @@ category tp) ,@ffrestargs ,@(if value-symbol - (list (cl-ffa tp) value-symbol) - (list (cl-ffa tp)))))) + (list (cl-cffi tp) value-symbol) + (list (cl-cffi tp)))))) *array-element-types*)))) (defmethod maref diff --git a/init/defmfun.lisp b/init/defmfun.lisp index 4b2b365c..ccb7d325 100644 --- a/init/defmfun.lisp +++ b/init/defmfun.lisp @@ -1,6 +1,6 @@ ;; Macro for defining GSL functions. ;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp -;; Time-stamp: <2008-11-09 11:11:50EST defmfun.lisp> +;; Time-stamp: <2008-11-11 21:37:46EST defmfun.lisp> ;; $Id$ (in-package :gsl) @@ -263,7 +263,7 @@ gsl-function-name))) (remf key-args :documentation) (when (eq c-return :element-c-type) - (setf (getf key-args :c-return) (cl-ffa eltype))) + (setf (getf key-args :c-return) (cl-cffi eltype))) (when (eq c-return :component-float-type) (setf (getf key-args :c-return) (component-type eltype))) (if (and (llkp arglist) (listp (first gsl-name))) ; ad-hoc detection! @@ -396,7 +396,7 @@ (make-st (st-symbol v) (if (eq (st-type v) :component-float-type) (component-type element-type) - (cl-ffa element-type))) + (cl-cffi element-type))) v)) c-arguments)) diff --git a/init/element-types.lisp b/init/element-types.lisp index cb40b84e..4650b9b7 100644 --- a/init/element-types.lisp +++ b/init/element-types.lisp @@ -1,19 +1,19 @@ ;; Mapping of element type names ;; Liam Healy 2008-04-13 11:22:46EDT element-types.lisp -;; Time-stamp: <2008-09-14 18:09:39EDT element-types.lisp> +;; Time-stamp: <2008-11-11 21:34:47EST element-types.lisp> ;; $Id$ ;;; The different element type forms: -;;; C standard full :unsigned-char -;;; GSL splice name "uchar" -;;; C explicit :uint8 (not used here) -;;; CL '(unsigned-byte 8) -;;; Single 'unsigned-byte-8 +;;; C standard full, or "CFFI" :unsigned-char +;;; GSL splice name "uchar" +;;; C explicit :uint8 (not used here) +;;; CL '(unsigned-byte 8) +;;; Single 'unsigned-byte-8 ;;; Functions to perform conversions ;;; CL -> single in function #'cl-single ;;; CL -> GSL in function #'cl-gsl -;;; CL -> Cstd in function #'cl-ffa +;;; CL -> CFFI (Cstd) in function #'cl-cffi ;;; CFFI (Cstd) -> CL in function #'cffi-cl ;;; Sources of equivalence @@ -181,12 +181,12 @@ (concatenate 'string "_" string) string))) -(defun cl-ffa (cl-type) - "The FFA/CFFI element type from the CL type." +(defun cl-cffi (cl-type) + "The CFFI element type from the CL type." (lookup-type (clean-type cl-type) *cstd-cl-type-mapping* t)) (defun cffi-cl (cffi-type) - "The CL type from the FFA/CFFI element type." + "The CL type from the CFFI element type." (unless (eq cffi-type :pointer) (lookup-type cffi-type *cstd-cl-type-mapping*))) @@ -238,9 +238,9 @@ (cerror "Accept gibberish." "Cannot pass complex scalars to and from GSL functions (structs passed by value).") (let* ((cleantype (clean-type (type-of number))) - (comptype (cl-ffa (second cleantype))) + (comptype (cl-cffi (second cleantype))) (datslot - (cffi:foreign-slot-pointer gsl (cl-ffa cleantype) 'dat))) + (cffi:foreign-slot-pointer gsl (cl-cffi cleantype) 'dat))) (setf (cffi:mem-aref datslot comptype 0) (realpart number) (cffi:mem-aref datslot comptype 1) (imagpart number)) gsl)) @@ -280,7 +280,6 @@ (defparameter *array-element-types* (remove-duplicates (all-types *cstd-cl-type-mapping* t) :test 'equal) - ;;(all-types ffa::*cffi-and-lisp-types* t) "All the array element types supported.") (defparameter *array-element-types-no-complex* -- GitLab