[Clg-devel] TREE-PATH as return type
Brought to you by:
espen
|
From: Walter C. P. <wa...@pe...> - 2009-04-21 12:03:32
|
There seems to be an inconsistency between the return type for
tree-path arguments and %TREE-PATH-TO-VECTOR.
As I can see from the first line
(defun %tree-path-to-vector (location)
(unless (null-pointer-p location)
(let ((indices (%tree-path-get-indices location))
(depth (%tree-path-get-depth location)))
(if (null-pointer-p indices)
#()
(map-c-vector 'vector #'identity indices 'int depth)))))
this function can return NIL when passed a null pointer.
Unfortunately RETURN-TYPE for TREE-PATH returns a '(VECTOR INT *),
which is OK for CMUCL (who is probably ignoring the declaim produced
by DEFBINDING) but makes SBCL angry whenever a GTK function returns a
null pointer.
This patch mends the problem:
*** gtktree.lisp.~1.34.~ 2008-05-06 11:00:50.000000000 +0200
--- gtktree.lisp 2009-04-21 13:24:55.000000000 +0200
***************
*** 276,281 ****
--- 276,285 ----
(declare (ignore type))
(alien-type 'pointer))
+ (define-type-method return-type ((type tree-path))
+ (declare (ignore type))
+ (return-type '(or (vector int *) null)))
+
(define-type-method size-of ((type tree-path) &key inlined)
(assert-not-inlined type inlined)
(size-of 'pointer))
--
walter pelissero
http://www.pelissero.de
|