;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;; $Id: basic-types.lisp,v 1.7 2007-06-01 06:22:05 espen Exp $
+;; $Id: basic-types.lisp,v 1.9 2007-06-20 09:49:06 espen Exp $
(in-package "GFFI")
(define-type-method writer-function ((type single-float) &key temp (inlined t))
(declare (ignore temp))
(assert-inlined type inlined)
- #'(setf ref-single-float))
+ #'(lambda (number location &optional (offset 0))
+ (setf (ref-single-float location offset) (coerce number 'single-float))))
(define-type-method reader-function ((type single-float) &key ref (inlined t))
(declare (ignore ref))
(define-type-method to-alien-function ((type static) &optional copy-p)
(if (not copy-p)
(to-alien-function (second (type-expand-to 'static type)) t)
- (error "COPY-P argument to TO-ALIEN-FUNCTION should always be NIL for type ~A" type)))
+ (error "COPY-P argument to TO-ALIEN-FUNCTION should always be NIL for type ~A" type)))
(define-type-method to-alien-form ((type static) &optional copy-p)
(if (not copy-p)
- (to-alien-function (second (type-expand-to 'static type)) t)
- (error "COPY-P argument to TO-ALIEN-FORM should always be NIL for type ~A" type)))
+ (to-alien-form (second (type-expand-to 'static type)) t)
+ (error "COPY-P argument to TO-ALIEN-FORM should always be NIL for type ~A" type)))
(define-type-method reader-function ((type static) &key (ref :read) (inlined nil inlined-p))
(if inlined-p