X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/6243c15e6c655e627b62121af3a3031dd985250d..43e8a182b5a4b41d3b5bb063cecb15d12ae3964b:/glib/gparam.lisp diff --git a/glib/gparam.lisp b/glib/gparam.lisp index 4579a32..88c74d3 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.10 2004-11-12 15:01:42 espen Exp $ +;; $Id: gparam.lisp,v 1.12 2004-12-16 23:21:18 espen Exp $ (in-package "GLIB") @@ -41,11 +41,11 @@ (defun gvalue-init (gvalue type &optional (value nil value-p)) (when value-p (funcall (writer-function type) value gvalue +gvalue-value-offset+))) -(defun gvalue-new (type &optional (value nil value-p)) +(defun gvalue-new (&optional type (value nil value-p)) (let ((gvalue (allocate-memory +gvalue-size+))) - (if value-p - (gvalue-init gvalue type value) - (gvalue-init gvalue type)) + (cond + (value-p (gvalue-init gvalue type value)) + (type (gvalue-init gvalue type))) gvalue)) (defun gvalue-free (gvalue &optional (unset-p t)) @@ -68,8 +68,8 @@ (defun gvalue-set (gvalue value) (defmacro with-gvalue ((gvalue type &optional (value nil value-p)) &body body) `(let ((,gvalue ,(if value-p - `(gvalue-new ',type ,value) - `(gvalue-new ',type ,value)))) + `(gvalue-new ,type ,value) + `(gvalue-new)))) (unwind-protect (progn ,@body @@ -134,12 +134,12 @@ (defclass param (ginstance) :allocation :virtual :getter "g_param_spec_get_nick" :reader param-nickname - :type string) + :type (copy-of string)) (documentation :allocation :virtual :getter "g_param_spec_get_blurb" :reader param-documentation - :type string)) + :type (copy-of string))) (:metaclass param-spec-class))