vala r892 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r892 - in trunk: . gobject
- Date: Wed, 23 Jan 2008 09:54:53 +0000 (GMT)
Author: juergbi
Date: Wed Jan 23 09:54:52 2008
New Revision: 892
URL: http://svn.gnome.org/viewvc/vala?rev=892&view=rev
Log:
2008-01-23 Juerg Billeter <j bitron ch>
* gobject/valaccodegenerator.vala: emit namespace constants,
fixes bug 511383
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Wed Jan 23 09:54:52 2008
@@ -353,26 +353,22 @@
public override void visit_constant (Constant! c) {
c.accept_children (this);
- if (c.parent_symbol is Typesymbol) {
- var t = (Typesymbol) c.parent_symbol;
-
- if (!c.is_internal_symbol () && !(c.type_reference.data_type is Array)) {
- var cdefine = new CCodeMacroReplacement.with_expression (c.get_cname (), (CCodeExpression) c.initializer.ccodenode);
- header_type_member_declaration.append (cdefine);
+ if (!c.is_internal_symbol () && !(c.type_reference.data_type is Array)) {
+ var cdefine = new CCodeMacroReplacement.with_expression (c.get_cname (), (CCodeExpression) c.initializer.ccodenode);
+ header_type_member_declaration.append (cdefine);
+ } else {
+ var cdecl = new CCodeDeclaration (c.type_reference.get_const_cname ());
+ var arr = "";
+ if (c.type_reference.data_type is Array) {
+ arr = "[]";
+ }
+ cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s%s".printf (c.get_cname (), arr), (CCodeExpression) c.initializer.ccodenode));
+ cdecl.modifiers = CCodeModifiers.STATIC;
+
+ if (!c.is_internal_symbol ()) {
+ header_type_member_declaration.append (cdecl);
} else {
- var cdecl = new CCodeDeclaration (c.type_reference.get_const_cname ());
- var arr = "";
- if (c.type_reference.data_type is Array) {
- arr = "[]";
- }
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s%s".printf (c.get_cname (), arr), (CCodeExpression) c.initializer.ccodenode));
- cdecl.modifiers = CCodeModifiers.STATIC;
-
- if (!c.is_internal_symbol ()) {
- header_type_member_declaration.append (cdecl);
- } else {
- source_type_member_declaration.append (cdecl);
- }
+ source_type_member_declaration.append (cdecl);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]