[cells-gtk-cvs] CVS root/gtk-ffi
pdenno
pdenno at common-lisp.net
Thu Feb 16 18:07:50 UTC 2006
Update of /project/cells-gtk/cvsroot/root/gtk-ffi
In directory common-lisp:/tmp/cvs-serv9113/root/gtk-ffi
Modified Files:
gtk-utilities.lisp
Log Message:
A few nils should have been +c-null+, use cffi:foreign-alloc
--- /project/cells-gtk/cvsroot/root/gtk-ffi/gtk-utilities.lisp 2006/02/11 03:48:09 1.17
+++ /project/cells-gtk/cvsroot/root/gtk-ffi/gtk-utilities.lisp 2006/02/16 18:07:50 1.18
@@ -26,13 +26,13 @@
(defun g-signal-connect-data (self detailed-signal c-handler data destroy-data after)
(uffi:with-cstrings ((c-detailed-signal detailed-signal))
- (let ((p4 (or data c-null)))
+ (let ((p4 (or data +c-null+)))
(g_signal_connect_data
self
c-detailed-signal
(wrap-func c-handler)
p4
- (or destroy-data c-null)
+ (or destroy-data +c-null+)
(if after 1 0)))))
(uffi:def-function ("g_signal_connect_data" g_signal_connect_data)
@@ -44,7 +44,7 @@
(or func-address 0))
-(defun gtk-signal-connect-swap (widget signal fun &key (after t) data destroy-data)
+(defun gtk-signal-connect-swap (widget signal fun &key (after t) data (destroy-data +c-null+)) ; pod 0216
(g-signal-connect-closure widget signal
(g-cclosure-new-swap (wrap-func fun) data destroy-data) after))
@@ -68,12 +68,12 @@
:null-terminated-p t)
#-(or allegro lispworks)
(with-foreign-object (bytes-written :int)
- (g-locale-from-utf8 pointer -1 nil bytes-written nil)))))
+ (g-locale-from-utf8 pointer -1 +c-null+ bytes-written +c-null+)))))
(defun to-gtk-string (str)
"!!!! remember to free returned str pointer"
(with-foreign-object (bytes-written :int)
- (g-locale-to-utf8 str -1 c-null bytes-written c-null)))
+ (g-locale-to-utf8 str -1 +c-null+ bytes-written +c-null+)))
(defmacro with-gdk-threads (&rest body)
`(unwind-protect
@@ -101,7 +101,7 @@
:data menu))
(defun gtk-list-store-new (col-types)
- (let ((c-types (cffi:foreign-alloc :int :count (length col-types)))) ;(ffx:fgn-alloc :int (length col-types))))
+ (let ((c-types (cffi:foreign-alloc :int :count (length col-types))))
(loop for type in col-types
for n upfrom 0
do (setf (cffi:mem-aref c-types :int n) (coerce (as-gtk-type type) 'integer)))
@@ -146,7 +146,7 @@
(gvi :post-set))))
(defun gtk-tree-store-new (col-types)
- (let ((gtk-types (cffi:foreign-alloc :int :count (length col-types)))) ;(ffx:fgn-alloc :int (length col-types))
+ (let ((gtk-types (cffi:foreign-alloc :int :count (length col-types))))
(loop for type in col-types
for tn upfrom 0
do (setf (cffi:mem-aref gtk-types :int tn) (coerce (as-gtk-type type) 'integer)))
More information about the Cells-gtk-cvs
mailing list