Changeset 5759


Ignore:
Timestamp:
Jan 20, 2007, 10:53:46 PM (18 years ago)
Author:
Gary Byers
Message:

Coerce arg, results when expanding an ff-call.

Location:
trunk/ccl/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/ffi-darwinppc32.lisp

    r5746 r5759  
    5757;;; integer argument "type" specifier to denote this.
    5858
    59 (defun darwin32::expand-ff-call (callform args)
     59(defun darwin32::expand-ff-call (callform args &key (arg-coerce #'null-coerce-foreign-arg) (result-coerce #'null-coerce-foreign-result))
    6060  (let* ((result-type-spec (or (car (last args)) :void))
    6161         (enclosing-form nil))
     
    106106                  (progn
    107107                    (argforms (foreign-type-to-representation-type ftype))
    108                     (argforms arg-value-form)))))))
     108                    (argforms (funcall arg-coerce arg-type-spec arg-value-form))))))))
    109109        (argforms (foreign-type-to-representation-type result-type))
    110         (let* ((call `(,@callform ,@(argforms))))
     110        (let* ((call (funcall result-coerce result-type-spec `(,@callform ,@(argforms)))))
    111111          (if enclosing-form
    112112            `(,@enclosing-form ,call)
  • trunk/ccl/lib/ffi-darwinppc64.lisp

    r5747 r5759  
    163163                                 
    164164
    165 (defun darwin64::expand-ff-call (callform args)
     165(defun darwin64::expand-ff-call (callform args &key (arg-coerce #'null-coerce-foreign-arg) (result-coerce #'null-coerce-foreign-result))
    166166  (let* ((result-type-spec (or (car (last args)) :void))
    167167         (regbuf nil)
     
    234234                      (progn
    235235                        (argforms (foreign-type-to-representation-type ftype))
    236                         (argforms arg-value-form)))))))
     236                        (argforms (funcall arg-coerce arg-type-spec arg-value-form))))))))
    237237            (argforms (foreign-type-to-representation-type result-type))
    238             (let* ((call `(,@callform ,@(argforms))))
     238            (let* ((call (funcall result-coerce result-type-spec `(,@callform ,@(argforms)))))
    239239              (when structure-arg-temp
    240240                (setq call `(let* ((,structure-arg-temp (%null-ptr)))
Note: See TracChangeset for help on using the changeset viewer.