chiark / gitweb /
Got rid of a warning about an unused variable
[clg] / glib / gtype.lisp
index 88fddcc59f367c0bc031ccc904f5a4e743c4df35..866b437c685a059d897df84a31e57729d613ff3f 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: gtype.lisp,v 1.44 2006-02-19 19:23:23 espen Exp $
+;; $Id: gtype.lisp,v 1.46 2006-02-19 22:25:31 espen Exp $
 
 (in-package "GLIB")
 
@@ -107,6 +107,7 @@ (defbinding type-class-peek (type) pointer
 
 (defvar *registered-types* ())
 (defvar *registered-type-aliases* ())
+(defvar *registered-static-types* ())
 (defvar *lisp-type-to-type-number* (make-hash-table))
 (defvar *type-number-to-lisp-type* (make-hash-table))
 
@@ -270,9 +271,10 @@ (defun register-new-type (type parent &optional foreign-name)
              parent-number
              (or foreign-name (default-alien-type-name type))
              (make-instance 'type-info :class-size class-size :instance-size instance-size))))
-       (setf (gethash type *lisp-type-to-type-number*) type-number)
-       (setf (gethash type-number *type-number-to-lisp-type*) type)
-       type-number))))
+       (pushnew (list type parent foreign-name) *registered-static-types* :key #'car)
+       (setf (gethash type *lisp-type-to-type-number*) type-number)
+       (setf (gethash type-number *type-number-to-lisp-type*) type)
+       type-number))))
 
 
 
@@ -374,8 +376,9 @@ (defmethod invalidate-instance ((instance ginstance))
   ;; A ginstance should never be invalidated since it is ref counted
   nil)
 
-(defmethod callback-from-alien-form (form (type t) &rest args)
-  (apply #'from-alien-form form type args))
+(defmethod callback-from-alien-form (form (class ginstance-class) &rest args)
+  (declare (ignore args))
+  (from-alien-form form class))
 
 (defmethod copy-from-alien-form (location (class ginstance-class) &rest args)
   (declare (ignore location class args))