[vala] Declare static fields when used
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] Declare static fields when used
- Date: Tue, 7 Apr 2009 11:16:31 -0400 (EDT)
commit 9a5538103424fdb9663032c26f2262f964c57a45
Author: Jürg Billeter <j bitron ch>
Date: Tue Apr 7 17:12:54 2009 +0200
Declare static fields when used
Fixes bug 578127.
---
gobject/valaccodebasemodule.vala | 6 +++++-
gobject/valaccodememberaccessmodule.vala | 2 ++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala
index 9aa3f45..c179feb 100644
--- a/gobject/valaccodebasemodule.vala
+++ b/gobject/valaccodebasemodule.vala
@@ -767,7 +767,11 @@ internal class Vala.CCodeBaseModule : CCodeModule {
generate_constant_declaration (c, source_declarations);
}
- void generate_field_declaration (Field f, CCodeDeclarationSpace decl_space) {
+ public void generate_field_declaration (Field f, CCodeDeclarationSpace decl_space) {
+ if (decl_space.add_symbol_declaration (f, f.get_cname ())) {
+ return;
+ }
+
string field_ctype = f.field_type.get_cname ();
if (f.is_volatile) {
field_ctype = "volatile " + field_ctype;
diff --git a/gobject/valaccodememberaccessmodule.vala b/gobject/valaccodememberaccessmodule.vala
index 867509f..e842010 100644
--- a/gobject/valaccodememberaccessmodule.vala
+++ b/gobject/valaccodememberaccessmodule.vala
@@ -159,6 +159,8 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
}
} else {
+ generate_field_declaration (f, source_declarations);
+
expr.ccodenode = new CCodeIdentifier (f.get_cname ());
}
} else if (expr.symbol_reference is Constant) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]