projects
/
cl-gtk2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ade409c
)
glib: Fixed generation of union for variant struct; fixed boxed-copy-fn for variant...
author
Dmitry Kalyanov
<Kalyanov.Dmitry@gmail.com>
Wed, 5 Aug 2009 22:13:11 +0000
(
02:13
+0400)
committer
Dmitry Kalyanov
<Kalyanov.Dmitry@gmail.com>
Wed, 5 Aug 2009 22:13:11 +0000
(
02:13
+0400)
glib/gobject.boxed.lisp
patch
|
blob
|
history
diff --git
a/glib/gobject.boxed.lisp
b/glib/gobject.boxed.lisp
index
2cfbd15
..
fe84adb
100644
(file)
--- a/
glib/gobject.boxed.lisp
+++ b/
glib/gobject.boxed.lisp
@@
-314,16
+314,11
@@
(for cstruct = (var-structure-resulting-cstruct-description str))
(collect (generate-cstruct-1 cstruct))))
(for cstruct = (var-structure-resulting-cstruct-description str))
(collect (generate-cstruct-1 cstruct))))
-(defun generate-union-1 (struct)
+(defun generate-variant-union (struct)
`(defcunion ,(generated-cunion-name (var-structure-name struct))
`(defcunion ,(generated-cunion-name (var-structure-name struct))
- ,@(iter (for variant in (all-structures struct))
- (unless (eq struct variant)
- (collect `(,(var-structure-name variant)
- ,(generated-cunion-name (var-structure-name variant))))))))
-
-(defun generate-unions (struct)
- (iter (for str in (all-structures struct))
- (collect (generate-union-1 str))))
+ ,@(iter (for str in (all-structures struct))
+ (collect `(,(var-structure-name str)
+ ,(generated-cstruct-name (var-structure-name str)))))))
(defun generate-structure-1 (str)
`(defstruct ,(if (var-structure-parent str)
(defun generate-structure-1 (str)
`(defstruct ,(if (var-structure-parent str)
@@
-402,7
+397,7
@@
(defmacro define-g-boxed-variant-cstruct (name g-type-name &body slots)
(let* ((structure (parse-variant-structure-definition name slots)))
`(progn ,@(generate-c-structures structure)
(defmacro define-g-boxed-variant-cstruct (name g-type-name &body slots)
(let* ((structure (parse-variant-structure-definition name slots)))
`(progn ,@(generate-c-structures structure)
- ,@(generate-unions structure)
+ ,(generate-variant-union structure)
,@(generate-structures structure)
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (get ',name 'g-boxed-foreign-info)
,@(generate-structures structure)
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (get ',name 'g-boxed-foreign-info)
@@
-422,8
+417,8
@@
(defmethod boxed-copy-fn ((info g-boxed-variant-cstruct-info) native)
(if (g-boxed-info-g-type info)
(g-boxed-copy (g-boxed-info-g-type info) native)
(defmethod boxed-copy-fn ((info g-boxed-variant-cstruct-info) native)
(if (g-boxed-info-g-type info)
(g-boxed-copy (g-boxed-info-g-type info) native)
- (let ((copy (foreign-alloc (generated-cstruct-name (g-boxed-info-name info)))))
- (memcpy copy native (foreign-type-size (generated-cstruct-name (g-boxed-info-name info))))
+ (let ((copy (foreign-alloc (generated-cunion-name (g-boxed-info-name info)))))
+ (memcpy copy native (foreign-type-size (generated-cunion-name (g-boxed-info-name info))))
copy)))
(defmethod boxed-free-fn ((info g-boxed-variant-cstruct-info) native)
copy)))
(defmethod boxed-free-fn ((info g-boxed-variant-cstruct-info) native)