chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aee2ecd
)
Modified DEFCALLBACK to avoid unnecessary variable bindings.
author
espen
<espen>
Sun, 13 Mar 2005 18:06:51 +0000
(18:06 +0000)
committer
espen
<espen>
Sun, 13 Mar 2005 18:06:51 +0000
(18:06 +0000)
glib/ffi.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/ffi.lisp
b/glib/ffi.lisp
index aa95293c21073f0df01502b960a2af901e611d43..385a7c4f121e2949f1ef0fe7aeab0090334b1b87 100644
(file)
--- a/
glib/ffi.lisp
+++ b/
glib/ffi.lisp
@@
-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
;; 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.1
7 2005-02-25 23:55:06
espen Exp $
+;; $Id: ffi.lisp,v 1.1
8 2005-03-13 18:06:51
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-207,10
+207,14
@@
(defmacro defcallback (name (return-type &rest args) &body body)
`(,name ,(alien-type type))))
args))
,(to-alien-form
`(,name ,(alien-type type))))
args))
,(to-alien-form
- `(let (,@(mapcar #'(lambda (arg)
- (destructuring-bind (name type) arg
- `(,name ,(from-alien-form name type))))
- args))
+ `(let (,@(delete nil
+ (mapcar #'(lambda (arg)
+ (destructuring-bind (name type) arg
+ (let ((from-alien
+ (from-alien-form name type)))
+ (unless (eq name from-alien)
+ `(,name ,from-alien)))))
+ args)))
,@body)
return-type))))
,@body)
return-type))))
@@
-218,6
+222,8
@@
(defmacro defcallback (name (return-type &rest args) &body body)
(defun callback (af)
(sb-alien:alien-function-sap af))
(defun callback (af)
(sb-alien:alien-function-sap af))
+#+sbcl
+(deftype callback () 'sb-alien:alien-function)
;;;; Definitons and translations of fundamental types
;;;; Definitons and translations of fundamental types