Commit 82fdf2eb authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Accept 'fixnum as an element type for making foreign arrays

parent 141dbe9b
;; Methods for grid functions
;; Liam Healy 2009-12-21 11:19:00EST methods.lisp
;; Time-stamp: <2012-04-28 22:10:53EDT methods.lisp>
;; Time-stamp: <2013-12-28 12:12:51EST methods.lisp>
;; Copyright 2009, 2010, 2012 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -221,10 +221,17 @@
(declare (fixnum linearized-index) (type ,element-type value))
(set-faref value object ,array-type linearized-index))))))
(defun canonical-foreign-element-type (element-type)
"Return the given element type, possibly translating to a canonical name."
(case element-type
(fixnum (list 'signed-byte #+int64 64 #+int32 32))
(t element-type)))
(defmethod make-grid-data
((type (eql 'foreign-array)) dimensions rest-spec
&rest keys &key &allow-other-keys)
(let* ((element-type (spec-element-type rest-spec))
(let* ((element-type
(canonical-foreign-element-type (spec-element-type rest-spec)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment