Hi,
recently I started playing with SBCL 0.9.12 and cells-gtk (from CVS)
and found a few bugs. Some of these prevented a successful
compilation, others where runtime bugs.
The first one is a missing argument in pod-utils/utils.lisp:
*** utils.lisp.~1.1.~ 2006-02-19 21:09:12.000000000 +0100
--- utils.lisp 2006-05-20 12:14:48.000000000 +0200
***************
*** 469,475 ****
(format nil "~D.~2,'0D.~2,'0D ~2,'0D:~2,'0D:~2,'0D" y month d h m s)))
;;; Norvig's search routines
! (defun tree-search (states goal-p successors combiner)
"Find a state that satisfies GOAL-P. Start with STATES,
and search according to successors and combiners."
(cond ((null states) :fail)
--- 469,475 ----
(format nil "~D.~2,'0D.~2,'0D ~2,'0D:~2,'0D:~2,'0D" y month d h m s)))
;;; Norvig's search routines
! (defun tree-search (states goal-p successors combiner &optional do-fn)
"Find a state that satisfies GOAL-P. Start with STATES,
and search according to successors and combiners."
(cond ((null states) :fail)
gtk-ffi/gtk-utilities.lisp contains two runtime bugs. The first one is
in BUTTON-PRESS-EVENT-HANDLER and prevents the pop up of the context
menu in the gtk-demo (can be found at the bottom of the "Menus" page
tab). The other one is a type mismatch in
GTK-FILE-CHOOSER-GET-FILENAMES-STRS which also results in a compiler
error.
*** gtk-utilities.lisp.~1.19.~ 2006-02-19 21:18:27.000000000 +0100
--- gtk-utilities.lisp 2006-05-20 13:08:52.000000000 +0200
***************
*** 88,94 ****
(when (or (eql (event-type event) :button_press)
(eql (event-type event) :button_release))
(when (= (gdk-event-button-button signal) 3)
! (gtk-menu-popup widget nil nil nil nil 3
(gdk-event-button-time signal)))))
0)
--- 88,94 ----
(when (or (eql (event-type event) :button_press)
(eql (event-type event) :button_release))
(when (= (gdk-event-button-button signal) 3)
! (gtk-menu-popup widget +c-null+ +c-null+ +c-null+ +c-null+ 3
(gdk-event-button-time signal)))))
0)
***************
*** 264,270 ****
(defun gtk-file-chooser-get-filenames-strs (file-chooser)
(let ((glist (gtk-file-chooser-get-filenames file-chooser)))
(loop for lst-address = glist then (cffi:foreign-slot-value lst-address 'gslist 'next)
! while (and lst-address (not (zerop lst-address)))
collect (cffi:foreign-slot-value lst-address 'gslist 'data)
finally (g-slist-free glist))))
--- 264,270 ----
(defun gtk-file-chooser-get-filenames-strs (file-chooser)
(let ((glist (gtk-file-chooser-get-filenames file-chooser)))
(loop for lst-address = glist then (cffi:foreign-slot-value lst-address 'gslist 'next)
! while (and lst-address (not (cffi:null-pointer-p lst-address)))
collect (cffi:foreign-slot-value lst-address 'gslist 'data)
finally (g-slist-free glist))))
The last file with errors is gtk-ffi.lisp and this one is a little bit
obscure (at least to me). The defpackage form at the beginning of the
file makes SBCL complain about several other symbols also being
exported when this form is evaluated for the second time. For some
reasons SBCL considers this an *error*, so I changed it to
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (find-package :gtk-ffi)
(defpackage :gtk-ffi
(:use :common-lisp :pod))))
The other problem is that FFI-TO-UFFI-TYPE is not defined at load
time, but used in the function CAST.
Index: gtk-ffi.lisp
===================================================================
RCS file: /project/cells-gtk/cvsroot/root/gtk-ffi/gtk-ffi.lisp,v
retrieving revision 1.19
diff -u -3 -p -c -r1.19 gtk-ffi.lisp
cvs diff: conflicting specifications of output style
*** gtk-ffi.lisp 19 Feb 2006 20:17:41 -0000 1.19
--- gtk-ffi.lisp 20 May 2006 12:59:10 -0000
***************
*** 16,22 ****
|#
! (defpackage :gtk-ffi (:use :common-lisp :pod))
(in-package :gtk-ffi)
--- 16,25 ----
|#
! (eval-when (:compile-toplevel :load-toplevel :execute)
! (unless (find-package :gtk-ffi)
! (defpackage :gtk-ffi
! (:use :common-lisp :pod))))
(in-package :gtk-ffi)
***************
*** 138,144 ****
#+macosx "libcellsgtk.dylib")))
) ; eval
! (eval-when (:compile-toplevel :execute)
(export '(+c-null+ int-slot-indexed load-gtk-libs))
(defun gtk-function-name (lisp-name)
(substitute #\_ #\- lisp-name))
--- 141,147 ----
#+macosx "libcellsgtk.dylib")))
) ; eval
! (eval-when (:compile-toplevel :load-toplevel :execute)
(export '(+c-null+ int-slot-indexed load-gtk-libs))
(defun gtk-function-name (lisp-name)
(substitute #\_ #\- lisp-name))
From: Marco Gidde <[EMAIL PROTECTED]>
With these patches it is possible to load cells-gtk without errors in
SBCL and the resulting fasl files also work when a new instance of
SBCL is started later (without the patches I had to "touch" a few
*.lisp files every time to enforce a recompilation).
Regards,
Marco
_______________________________________________
cells-gtk-devel site list
[email protected]
http://common-lisp.net/mailman/listinfo/cells-gtk-devel