[vala/staging] codegen: Fix get_value function for struct extending a non-gboxed struct
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Fix get_value function for struct extending a non-gboxed struct
- Date: Wed, 8 Feb 2012 09:19:25 +0000 (UTC)
commit 034bc2ab84cecced858efdf9be61503b529b7c8b
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Feb 8 10:11:57 2012 +0100
codegen: Fix get_value function for struct extending a non-gboxed struct
The type_id checks for has_type_id, which does not recurse to the base type.
Therefore, make get_value function have the same behavior has type_id.
Fixes bug 669604.
codegen/valaccodeattribute.vala | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index f076a65..5dfda77 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -1003,16 +1003,18 @@ public class Vala.CCodeAttribute : AttributeCache {
return "g_value_get_pointer";
} else if (sym is Struct) {
var st = (Struct) sym;
- var base_st = st.base_struct;
- if (base_st != null) {
- return CCodeBaseModule.get_ccode_get_value_function (base_st);
- }
- if (st.is_simple_type ()) {
- Report.error (st.source_reference, "The type `%s` doesn't declare a GValue get function".printf (st.get_full_name ()));
- } else if (CCodeBaseModule.get_ccode_has_type_id (st)) {
- return "g_value_get_boxed";
+ if (!CCodeBaseModule.get_ccode_has_type_id (st)) {
+ var base_st = st.base_struct;
+ if (base_st != null) {
+ return CCodeBaseModule.get_ccode_get_value_function (base_st);
+ }
+ if (st.is_simple_type ()) {
+ Report.error (st.source_reference, "The type `%s` doesn't declare a GValue get function".printf (st.get_full_name ()));
+ } else {
+ return "g_value_get_pointer";
+ }
} else {
- return "g_value_get_pointer";
+ return "g_value_get_boxed";
}
} else {
return "g_value_get_pointer";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]