X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/8532ba0aa19d5966c27ca43a41faee207cfd4477..c96c452a4938c33e24bb9736810b0c7bd9e7940d:/glib/gparam.lisp diff --git a/glib/gparam.lisp b/glib/gparam.lisp index 1c0473c..d2a4b01 100644 --- a/glib/gparam.lisp +++ b/glib/gparam.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 -;; $Id: gparam.lisp,v 1.13 2005-01-03 16:42:03 espen Exp $ +;; $Id: gparam.lisp,v 1.15 2005-02-03 23:09:04 espen Exp $ (in-package "GLIB") @@ -57,7 +57,7 @@ (defun gvalue-free (gvalue &optional (unset-p t)) (deallocate-memory gvalue))) (defun gvalue-type (gvalue) - (type-from-number (system:sap-ref-32 gvalue 0))) + (type-from-number (sap-ref-32 gvalue 0))) (defun gvalue-get (gvalue) (funcall (reader-function (gvalue-type gvalue)) @@ -71,14 +71,15 @@ (defun gvalue-set (gvalue value) (defbinding (gvalue-p "g_type_check_value") () boolean (location pointer)) -(defmacro with-gvalue ((gvalue &optional type value) &body body) - `(let ((,gvalue ,(if type - `(gvalue-new ,type ,value) - `(gvalue-new)))) +(defmacro with-gvalue ((gvalue &optional type (value nil value-p)) &body body) + `(let ((,gvalue ,(cond + ((and type value-p) `(gvalue-new ,type ,value)) + (type `(gvalue-new ,type)) + (`(gvalue-new))))) (unwind-protect (progn ,@body - ,(unless type `(gvalue-get ,gvalue))) + ,(unless value-p `(gvalue-get ,gvalue))) (gvalue-free ,gvalue)))) @@ -95,8 +96,7 @@ (eval-when (:compile-toplevel :load-toplevel :execute) (defclass param-spec-class (ginstance-class) ()) - (defmethod validate-superclass - ((class param-spec-class) (super pcl::standard-class)) + (defmethod validate-superclass ((class param-spec-class) (super standard-class)) t ;(subtypep (class-name super) 'param) ))