vala r2297 - in trunk: . ccode gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2297 - in trunk: . ccode gobject
- Date: Fri, 9 Jan 2009 09:45:34 +0000 (UTC)
Author: juergbi
Date: Fri Jan 9 09:45:33 2009
New Revision: 2297
URL: http://svn.gnome.org/viewvc/vala?rev=2297&view=rev
Log:
2009-01-09 JÃrg Billeter <j bitron ch>
* ccode/valaccodevariabledeclarator.vala:
* gobject/valaccodebasemodule.vala:
* gobject/valaccodecontrolflowmodule.vala:
* gobject/valaccodemethodmodule.vala:
* gobject/valaclassregisterfunction.vala:
* gobject/valadbusclientmodule.vala:
* gobject/valadbusmodule.vala:
* gobject/valadbusservermodule.vala:
* gobject/valagerrormodule.vala:
* gobject/valagobjectmodule.vala:
* gobject/valagsignalmodule.vala:
* gobject/valagtypemodule.vala:
* gobject/valatyperegisterfunction.vala:
Simplify CCodeVariableDeclarator construction with initializer
Modified:
trunk/ChangeLog
trunk/ccode/valaccodevariabledeclarator.vala
trunk/gobject/valaccodebasemodule.vala
trunk/gobject/valaccodecontrolflowmodule.vala
trunk/gobject/valaccodemethodmodule.vala
trunk/gobject/valaclassregisterfunction.vala
trunk/gobject/valadbusclientmodule.vala
trunk/gobject/valadbusmodule.vala
trunk/gobject/valadbusservermodule.vala
trunk/gobject/valagerrormodule.vala
trunk/gobject/valagobjectmodule.vala
trunk/gobject/valagsignalmodule.vala
trunk/gobject/valagtypemodule.vala
trunk/gobject/valatyperegisterfunction.vala
Modified: trunk/ccode/valaccodevariabledeclarator.vala
==============================================================================
--- trunk/ccode/valaccodevariabledeclarator.vala (original)
+++ trunk/ccode/valaccodevariabledeclarator.vala Fri Jan 9 09:45:33 2009
@@ -1,6 +1,6 @@
/* valaccodevariabledeclarator.vala
*
- * Copyright (C) 2006-2008 JÃrg Billeter
+ * Copyright (C) 2006-2009 JÃrg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -36,11 +36,7 @@
*/
public CCodeExpression? initializer { get; set; }
- public CCodeVariableDeclarator (string name) {
- this.name = name;
- }
-
- public CCodeVariableDeclarator.with_initializer (string name, CCodeExpression? initializer) {
+ public CCodeVariableDeclarator (string name, CCodeExpression? initializer = null) {
this.name = name;
this.initializer = initializer;
}
Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala (original)
+++ trunk/gobject/valaccodebasemodule.vala Fri Jan 9 09:45:33 2009
@@ -672,7 +672,7 @@
clist_ev.append (new CCodeConstant ("NULL"));
clist.append (clist_ev);
- var enum_decl = new CCodeVariableDeclarator.with_initializer ("values[]", clist);
+ var enum_decl = new CCodeVariableDeclarator ("values[]", clist);
CCodeDeclaration cdecl = null;
if (en.is_flags) {
@@ -694,7 +694,7 @@
cdecl = new CCodeDeclaration ("GType");
string type_id_name = "%s_type_id".printf (en.get_lower_case_cname (null));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (type_id_name, new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (type_id_name, new CCodeConstant ("0")));
cdecl.modifiers = CCodeModifiers.STATIC;
regblock.add_statement (cdecl);
@@ -774,7 +774,7 @@
if (c.type_reference is ArrayType) {
arr = "[]";
}
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s%s".printf (c.get_cname (), arr), (CCodeExpression) c.initializer.ccodenode));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("%s%s".printf (c.get_cname (), arr), (CCodeExpression) c.initializer.ccodenode));
cdecl.modifiers = CCodeModifiers.STATIC;
if (!c.is_internal_symbol ()) {
@@ -937,7 +937,7 @@
}
var len_def = new CCodeDeclaration (len_type.get_cname ());
- len_def.add_declarator (new CCodeVariableDeclarator.with_initializer (head.get_array_length_cname (f.get_cname (), dim), new CCodeConstant ("0")));
+ len_def.add_declarator (new CCodeVariableDeclarator (head.get_array_length_cname (f.get_cname (), dim), new CCodeConstant ("0")));
if (!f.is_internal_symbol ()) {
len_def.modifiers = CCodeModifiers.EXTERN;
} else {
@@ -950,7 +950,7 @@
var len_type = int_type.copy ();
var cdecl = new CCodeDeclaration (len_type.get_cname ());
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (head.get_array_size_cname (f.get_cname ()), new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (head.get_array_size_cname (f.get_cname ()), new CCodeConstant ("0")));
cdecl.modifiers = CCodeModifiers.STATIC;
source_type_member_declaration.append (cdecl);
}
@@ -967,7 +967,7 @@
}
var target_def = new CCodeDeclaration ("gpointer");
- target_def.add_declarator (new CCodeVariableDeclarator.with_initializer (get_delegate_target_cname (f.get_cname ()), new CCodeConstant ("NULL")));
+ target_def.add_declarator (new CCodeVariableDeclarator (get_delegate_target_cname (f.get_cname ()), new CCodeConstant ("NULL")));
if (!f.is_internal_symbol ()) {
target_def.modifiers = CCodeModifiers.EXTERN;
} else {
@@ -1242,13 +1242,13 @@
if (is_virtual) {
var cdecl = new CCodeDeclaration (this_type.get_cname ());
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", transform_expression (new CCodeIdentifier ("base"), base_type, this_type)));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", transform_expression (new CCodeIdentifier ("base"), base_type, this_type)));
function.block.prepend_statement (cdecl);
}
if (current_method_inner_error) {
var cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("inner_error", new CCodeConstant ("NULL")));
function.block.prepend_statement (cdecl);
}
@@ -1301,7 +1301,7 @@
if (current_method_inner_error) {
var cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("inner_error", new CCodeConstant ("NULL")));
cfrag.append (cdecl);
}
@@ -1514,7 +1514,7 @@
cfrag.append (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (new CCodeIdentifier ("data"), get_variable_cname (local.name)), rhs)));
}
} else {
- var cvar = new CCodeVariableDeclarator.with_initializer (get_variable_cname (local.name), rhs);
+ var cvar = new CCodeVariableDeclarator (get_variable_cname (local.name), rhs);
var cdecl = new CCodeDeclaration (local.variable_type.get_cname ());
cdecl.add_declarator (cvar);
Modified: trunk/gobject/valaccodecontrolflowmodule.vala
==============================================================================
--- trunk/gobject/valaccodecontrolflowmodule.vala (original)
+++ trunk/gobject/valaccodecontrolflowmodule.vala Fri Jan 9 09:45:33 2009
@@ -77,7 +77,7 @@
var cdecl = new CCodeDeclaration (gquark_type.get_cname ());
cdecl.modifiers = CCodeModifiers.STATIC;
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (cname, czero));
+ cdecl.add_declarator (new CCodeVariableDeclarator (cname, czero));
cswitchblock.append (cdecl);
}
@@ -287,7 +287,7 @@
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (collection_backup.name), (CCodeExpression) stmt.collection.ccodenode)));
} else {
var ccoldecl = new CCodeDeclaration (collection_type.get_cname ());
- var ccolvardecl = new CCodeVariableDeclarator.with_initializer (collection_backup.name, (CCodeExpression) stmt.collection.ccodenode);
+ var ccolvardecl = new CCodeVariableDeclarator (collection_backup.name, (CCodeExpression) stmt.collection.ccodenode);
ccolvardecl.line = cblock.line;
ccoldecl.add_declarator (ccolvardecl);
cblock.add_statement (ccoldecl);
@@ -311,7 +311,7 @@
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (head.get_array_length_cname (collection_backup.name, 1)), array_len)));
} else {
var clendecl = new CCodeDeclaration ("int");
- clendecl.add_declarator (new CCodeVariableDeclarator.with_initializer (head.get_array_length_cname (collection_backup.name, 1), array_len));
+ clendecl.add_declarator (new CCodeVariableDeclarator (head.get_array_length_cname (collection_backup.name, 1), array_len));
cblock.add_statement (clendecl);
}
@@ -343,7 +343,7 @@
cbody.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (stmt.variable_name), element_expr)));
} else {
var cdecl = new CCodeDeclaration (stmt.type_reference.get_cname ());
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (stmt.variable_name, element_expr));
+ cdecl.add_declarator (new CCodeVariableDeclarator (stmt.variable_name, element_expr));
cbody.add_statement (cdecl);
}
@@ -356,7 +356,7 @@
cbody.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (head.get_array_length_cname (stmt.variable_name, dim)), new CCodeConstant ("-1"))));
} else {
var cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (head.get_array_length_cname (stmt.variable_name, dim), new CCodeConstant ("-1")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (head.get_array_length_cname (stmt.variable_name, dim), new CCodeConstant ("-1")));
cbody.add_statement (cdecl);
}
}
@@ -410,7 +410,7 @@
cbody.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (stmt.variable_name), element_expr)));
} else {
var cdecl = new CCodeDeclaration (stmt.type_reference.get_cname ());
- var cvardecl = new CCodeVariableDeclarator.with_initializer (stmt.variable_name, element_expr);
+ var cvardecl = new CCodeVariableDeclarator (stmt.variable_name, element_expr);
cvardecl.line = cblock.line;
cdecl.add_declarator (cvardecl);
cbody.add_statement (cdecl);
Modified: trunk/gobject/valaccodemethodmodule.vala
==============================================================================
--- trunk/gobject/valaccodemethodmodule.vala (original)
+++ trunk/gobject/valaccodemethodmodule.vala Fri Jan 9 09:45:33 2009
@@ -265,7 +265,7 @@
CCodeExpression cself = transform_expression (new CCodeIdentifier ("base"), base_expression_type, self_target_type);
var cdecl = new CCodeDeclaration ("%s *".printf (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", cself));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", cself));
cinit.append (cdecl);
} else if (m.binding == MemberBinding.INSTANCE
@@ -308,7 +308,7 @@
// no initialization necessary, closure struct is zeroed
} else {
var cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("inner_error", new CCodeConstant ("NULL")));
cinit.append (cdecl);
}
}
@@ -331,11 +331,11 @@
cparamsinit.add_argument (new CCodeConstant ((n_params + 3 * current_class.get_type_parameters ().size).to_string ()));
var cdecl = new CCodeDeclaration ("GParameter *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("__params", cparamsinit));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("__params", cparamsinit));
cinit.append (cdecl);
cdecl = new CCodeDeclaration ("GParameter *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("__params_it", new CCodeIdentifier ("__params")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("__params_it", new CCodeIdentifier ("__params")));
cinit.append (cdecl);
}
@@ -394,7 +394,7 @@
var cdecl = new CCodeDeclaration (cl.get_cname () + "*");
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_slice_new0"));
ccall.add_argument (new CCodeIdentifier (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", ccall));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", ccall));
cinit.append (cdecl);
var cinitcall = new CCodeFunctionCall (new CCodeIdentifier ("%s_instance_init".printf (cl.get_lower_case_cname (null))));
@@ -729,7 +729,7 @@
} else {
/* store method return value for postconditions */
var cdecl = new CCodeDeclaration (get_creturn_type (m, return_type.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("result", vcall));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("result", vcall));
cstmt = cdecl;
}
cstmt.line = vfunc.line;
Modified: trunk/gobject/valaclassregisterfunction.vala
==============================================================================
--- trunk/gobject/valaclassregisterfunction.vala (original)
+++ trunk/gobject/valaclassregisterfunction.vala Fri Jan 9 09:45:33 2009
@@ -164,7 +164,7 @@
var ctypedecl = new CCodeDeclaration ("const GInterfaceInfo");
ctypedecl.modifiers = CCodeModifiers.STATIC;
- ctypedecl.add_declarator (new CCodeVariableDeclarator.with_initializer (iface_info_name, new CCodeConstant ("{ (GInterfaceInitFunc) %s_%s_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}".printf (class_reference.get_lower_case_cname (null), iface.get_lower_case_cname (null)))));
+ ctypedecl.add_declarator (new CCodeVariableDeclarator (iface_info_name, new CCodeConstant ("{ (GInterfaceInitFunc) %s_%s_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}".printf (class_reference.get_lower_case_cname (null), iface.get_lower_case_cname (null)))));
frag.append (ctypedecl);
}
Modified: trunk/gobject/valadbusclientmodule.vala
==============================================================================
--- trunk/gobject/valadbusclientmodule.vala (original)
+++ trunk/gobject/valadbusclientmodule.vala Fri Jan 9 09:45:33 2009
@@ -126,7 +126,7 @@
cb_fun.add_parameter (new CCodeFormalParameter ("user_data", "void*"));
cb_fun.block = new CCodeBlock ();
var cerrdecl = new CCodeDeclaration ("GError*");
- cerrdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("error", new CCodeConstant ("NULL")));
+ cerrdecl.add_declarator (new CCodeVariableDeclarator ("error", new CCodeConstant ("NULL")));
cb_fun.block.add_statement (cerrdecl);
var cend_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_proxy_end_call"));
cend_call.add_argument (new CCodeIdentifier ("proxy"));
@@ -234,7 +234,7 @@
array_construct.add_argument (sizeof_call);
}
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("dbus_%s".printf (param.name), array_construct));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("dbus_%s".printf (param.name), array_construct));
block.add_statement (cdecl);
if (dbus_use_ptr_array (array_type)) {
@@ -268,7 +268,7 @@
array_construct.add_argument (new CCodeConstant ("0"));
var cdecl = new CCodeDeclaration ("GValueArray*");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("dbus_%s".printf (param.name), array_construct));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("dbus_%s".printf (param.name), array_construct));
block.add_statement (cdecl);
var type_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_type_get_struct"));
@@ -286,7 +286,7 @@
cvalinit.append (new CCodeConstant ("0"));
var cval_decl = new CCodeDeclaration ("GValue");
- cval_decl.add_declarator (new CCodeVariableDeclarator.with_initializer (val_name, cvalinit));
+ cval_decl.add_declarator (new CCodeVariableDeclarator (val_name, cvalinit));
block.add_statement (cval_decl);
var val_ptr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (val_name));
@@ -607,7 +607,7 @@
prop_proxy_call.add_argument (new CCodeConstant ("NULL"));
var prop_proxy_decl = new CCodeDeclaration ("DBusGProxy*");
- prop_proxy_decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("property_proxy", prop_proxy_call));
+ prop_proxy_decl.add_declarator (new CCodeVariableDeclarator ("property_proxy", prop_proxy_call));
block.add_statement (prop_proxy_decl);
}
@@ -619,7 +619,7 @@
cvalinit.append (new CCodeConstant ("0"));
var cval_decl = new CCodeDeclaration ("GValue");
- cval_decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("gvalue", cvalinit));
+ cval_decl.add_declarator (new CCodeVariableDeclarator ("gvalue", cvalinit));
block.add_statement (cval_decl);
var val_ptr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("gvalue"));
@@ -674,7 +674,7 @@
cvalinit.append (new CCodeConstant ("0"));
var cval_decl = new CCodeDeclaration ("GValue");
- cval_decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("gvalue", cvalinit));
+ cval_decl.add_declarator (new CCodeVariableDeclarator ("gvalue", cvalinit));
block.add_statement (cval_decl);
var val_ptr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("gvalue"));
@@ -1018,7 +1018,7 @@
if (array_type != null) {
for (int dim = 1; dim <= array_type.rank; dim++) {
cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("_%s_length%d".printf (param.name, dim), new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("_%s_length%d".printf (param.name, dim), new CCodeConstant ("0")));
postfragment.append (cdecl);
}
}
@@ -1051,7 +1051,7 @@
if (array_type != null) {
for (int dim = 1; dim <= array_type.rank; dim++) {
cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("_result_length%d".printf (dim), new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("_result_length%d".printf (dim), new CCodeConstant ("0")));
postfragment.append (cdecl);
}
}
Modified: trunk/gobject/valadbusmodule.vala
==============================================================================
--- trunk/gobject/valadbusmodule.vala (original)
+++ trunk/gobject/valadbusmodule.vala Fri Jan 9 09:45:33 2009
@@ -99,15 +99,15 @@
string temp_name = "_tmp%d".printf (next_temp_var_id++);
var cdecl = new CCodeDeclaration (array_type.get_cname ());
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (temp_name, new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (temp_name, new CCodeConstant ("NULL")));
fragment.append (cdecl);
cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (temp_name + "_length", new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (temp_name + "_length", new CCodeConstant ("0")));
fragment.append (cdecl);
cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (temp_name + "_size", new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (temp_name + "_size", new CCodeConstant ("0")));
fragment.append (cdecl);
read_array_dim (fragment, array_type, 1, temp_name, iter_expr, expr);
@@ -119,7 +119,7 @@
string subiter_name = "_tmp%d".printf (next_temp_var_id++);
var cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s_length%d".printf (temp_name, dim), new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("%s_length%d".printf (temp_name, dim), new CCodeConstant ("0")));
fragment.append (cdecl);
cdecl = new CCodeDeclaration ("DBusMessageIter");
@@ -215,7 +215,7 @@
cvalinit.append (new CCodeConstant ("0"));
var cdecl = new CCodeDeclaration ("GValue");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (temp_name, cvalinit));
+ cdecl.add_declarator (new CCodeVariableDeclarator (temp_name, cvalinit));
fragment.append (cdecl);
cdecl = new CCodeDeclaration ("DBusMessageIter");
Modified: trunk/gobject/valadbusservermodule.vala
==============================================================================
--- trunk/gobject/valadbusservermodule.vala (original)
+++ trunk/gobject/valadbusservermodule.vala Fri Jan 9 09:45:33 2009
@@ -80,7 +80,7 @@
block.add_statement (cdecl);
cdecl = new CCodeDeclaration ("GError*");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("error", new CCodeConstant ("NULL")));
block.add_statement (cdecl);
block.add_statement (prefragment);
@@ -112,7 +112,7 @@
foreach (FormalParameter param in m.get_parameters ()) {
cdecl = new CCodeDeclaration (param.parameter_type.get_cname ());
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (param.name, default_value_for_type (param.parameter_type, true)));
+ cdecl.add_declarator (new CCodeVariableDeclarator (param.name, default_value_for_type (param.parameter_type, true)));
prefragment.append (cdecl);
if (type_signature == ""
&& param.direction == ParameterDirection.IN
@@ -146,7 +146,7 @@
string length_cname = get_array_length_cname (param.name, dim);
cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (length_cname, new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (length_cname, new CCodeConstant ("0")));
prefragment.append (cdecl);
if (param.direction != ParameterDirection.IN) {
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (length_cname)));
@@ -185,7 +185,7 @@
string length_cname = get_array_length_cname ("result", dim);
cdecl = new CCodeDeclaration ("int");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (length_cname, new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (length_cname, new CCodeConstant ("0")));
prefragment.append (cdecl);
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (length_cname)));
}
@@ -265,7 +265,7 @@
path.add_argument (new CCodeConstant ("\"dbus_object_path\""));
cdecl = new CCodeDeclaration ("const char *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("_path", path));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("_path", path));
block.add_statement (cdecl);
cdecl = new CCodeDeclaration ("DBusMessage");
@@ -1127,7 +1127,7 @@
cfunc.block = block;
var cdecl = new CCodeDeclaration ("DBusMessage*");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("reply", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("reply", new CCodeConstant ("NULL")));
block.add_statement (cdecl);
CCodeIfStatement clastif = null;
@@ -1222,7 +1222,7 @@
generate_register_function (object_type);
var cdecl = new CCodeDeclaration ("const _DBusObjectVTable");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("_" + sym.get_lower_case_cprefix () + "dbus_vtable", vtable));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("_" + sym.get_lower_case_cprefix () + "dbus_vtable", vtable));
cdecl.modifiers = CCodeModifiers.STATIC;
source_constant_declaration.append (cdecl);
@@ -1240,7 +1240,7 @@
generate_message_function (object_type);
var cdecl = new CCodeDeclaration ("const DBusObjectPathVTable");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("_" + sym.get_lower_case_cprefix () + "dbus_path_vtable", vtable));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("_" + sym.get_lower_case_cprefix () + "dbus_path_vtable", vtable));
cdecl.modifiers = CCodeModifiers.STATIC;
source_constant_declaration.append (cdecl);
Modified: trunk/gobject/valagerrormodule.vala
==============================================================================
--- trunk/gobject/valagerrormodule.vala (original)
+++ trunk/gobject/valagerrormodule.vala Fri Jan 9 09:45:33 2009
@@ -259,7 +259,7 @@
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression (variable_name), get_variable_cexpression ("inner_error"))));
} else {
var cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (variable_name, get_variable_cexpression ("inner_error")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (variable_name, get_variable_cexpression ("inner_error")));
cblock.add_statement (cdecl);
}
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (get_variable_cexpression ("inner_error"), new CCodeConstant ("NULL"))));
Modified: trunk/gobject/valagobjectmodule.vala
==============================================================================
--- trunk/gobject/valagobjectmodule.vala (original)
+++ trunk/gobject/valagobjectmodule.vala Fri Jan 9 09:45:33 2009
@@ -133,7 +133,7 @@
if (cl.has_class_private_fields) {
decl_frag.append (new CCodeTypeDefinition ("struct %s".printf (type_priv_struct.name), new CCodeVariableDeclarator ("%sClassPrivate".printf (cl.get_cname ()))));
var cdecl = new CCodeDeclaration ("GQuark");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("_vala_%s_class_private_quark".printf (cl.get_lower_case_cname ()), new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("_vala_%s_class_private_quark".printf (cl.get_lower_case_cname ()), new CCodeConstant ("0")));
cdecl.modifiers = CCodeModifiers.STATIC;
decl_frag.append (cdecl);
}
@@ -272,7 +272,7 @@
var unref_block = new CCodeBlock ();
var cdecl = new CCodeDeclaration (cl.get_cname () + "*");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", new CCodeIdentifier ("instance")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", new CCodeIdentifier ("instance")));
ref_block.add_statement (cdecl);
unref_block.add_statement (cdecl);
@@ -449,7 +449,7 @@
var init_block = new CCodeBlock ();
var ctypedecl = new CCodeDeclaration (cl.get_cname () + "**");
- ctypedecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("object_p", new CCodeMemberAccess (new CCodeIdentifier ("collect_values[0]"),"v_pointer")));
+ ctypedecl.add_declarator (new CCodeVariableDeclarator ("object_p", new CCodeMemberAccess (new CCodeIdentifier ("collect_values[0]"),"v_pointer")));
init_block.add_statement (ctypedecl);
var value_type_name_fct = new CCodeFunctionCall (new CCodeIdentifier ("G_VALUE_TYPE_NAME"));
@@ -509,7 +509,7 @@
var obj_identifier = new CCodeIdentifier ("object");
var ctypedecl = new CCodeDeclaration (cl.get_cname () + "*");
- ctypedecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("object", collect_vpointer));
+ ctypedecl.add_declarator (new CCodeVariableDeclarator ("object", collect_vpointer));
true_stmt.add_statement (ctypedecl);
var l_expression = new CCodeMemberAccess (new CCodeMemberAccess.pointer (obj_identifier, "parent_instance"), "g_class");
@@ -738,7 +738,7 @@
cdecl.add_declarator (new CCodeVariableDeclarator ("priv"));
block.add_statement (cdecl);
cdecl = new CCodeDeclaration ("%sClassPrivate *".printf (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("parent_priv", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("parent_priv", new CCodeConstant ("NULL")));
block.add_statement (cdecl);
cdecl = new CCodeDeclaration ("GType");
cdecl.add_declarator (new CCodeVariableDeclarator ("parent_type"));
@@ -1264,7 +1264,7 @@
CCodeFunctionCall ccall = new InstanceCast (new CCodeIdentifier ("obj"), cl);
var cdecl = new CCodeDeclaration ("%s *".printf (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", ccall));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", ccall));
cblock.add_statement (cdecl);
@@ -1319,7 +1319,7 @@
CCodeFunctionCall ccall = new InstanceCast (new CCodeIdentifier ("object"), cl);
var cdecl = new CCodeDeclaration ("%s *".printf (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", ccall));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", ccall));
block.add_statement (cdecl);
cdecl = new CCodeDeclaration ("gpointer");
@@ -1401,7 +1401,7 @@
CCodeFunctionCall ccall = new InstanceCast (new CCodeIdentifier ("object"), cl);
var cdecl = new CCodeDeclaration ("%s *".printf (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", ccall));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", ccall));
block.add_statement (cdecl);
var cswitch = new CCodeSwitchStatement (new CCodeIdentifier ("property_id"));
@@ -1775,7 +1775,7 @@
ccall = new InstanceCast (new CCodeIdentifier ("obj"), cl);
cdecl = new CCodeDeclaration ("%s *".printf (cl.get_cname ()));
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("self", ccall));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("self", ccall));
cblock.add_statement (cdecl);
if (current_method_inner_error) {
@@ -1783,7 +1783,7 @@
* as error may be set to NULL but we're always interested in inner errors
*/
cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("inner_error", new CCodeConstant ("NULL")));
cblock.add_statement (cdecl);
}
@@ -1812,7 +1812,7 @@
* as error may be set to NULL but we're always interested in inner errors
*/
var cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("inner_error", new CCodeConstant ("NULL")));
base_init_fragment.append (cdecl);
}
@@ -1832,7 +1832,7 @@
* as error may be set to NULL but we're always interested in inner errors
*/
var cdecl = new CCodeDeclaration ("GError *");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL")));
+ cdecl.add_declarator (new CCodeVariableDeclarator ("inner_error", new CCodeConstant ("NULL")));
class_init_fragment.append (cdecl);
}
Modified: trunk/gobject/valagsignalmodule.vala
==============================================================================
--- trunk/gobject/valagsignalmodule.vala (original)
+++ trunk/gobject/valagsignalmodule.vala Fri Jan 9 09:45:33 2009
@@ -212,7 +212,7 @@
var_decl = new CCodeDeclaration ("GCClosure *");
var_decl.modifiers = CCodeModifiers.REGISTER;
- var_decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("cc", new CCodeCastExpression (new CCodeIdentifier ("closure"), "GCClosure *")));
+ var_decl.add_declarator (new CCodeVariableDeclarator ("cc", new CCodeCastExpression (new CCodeIdentifier ("closure"), "GCClosure *")));
marshaller_body.add_statement (var_decl);
var_decl = new CCodeDeclaration ("gpointer");
Modified: trunk/gobject/valagtypemodule.vala
==============================================================================
--- trunk/gobject/valagtypemodule.vala (original)
+++ trunk/gobject/valagtypemodule.vala Fri Jan 9 09:45:33 2009
@@ -104,7 +104,7 @@
base_init.block = new CCodeBlock ();
var decl = new CCodeDeclaration (bool_type.get_cname ());
decl.modifiers |= CCodeModifiers.STATIC;
- decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("initialized", new CCodeConstant ("FALSE")));
+ decl.add_declarator (new CCodeVariableDeclarator ("initialized", new CCodeConstant ("FALSE")));
base_init.block.add_statement (decl);
var cif = new CCodeIfStatement (new CCodeUnaryExpression (CCodeUnaryOperator.LOGICAL_NEGATION, new CCodeIdentifier ("initialized")), init_block);
base_init.block.add_statement (cif);
Modified: trunk/gobject/valatyperegisterfunction.vala
==============================================================================
--- trunk/gobject/valatyperegisterfunction.vala (original)
+++ trunk/gobject/valatyperegisterfunction.vala Fri Jan 9 09:45:33 2009
@@ -50,10 +50,10 @@
CCodeDeclaration cdecl;
if (use_thread_safe) {
cdecl = new CCodeDeclaration ("gsize");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (type_id_name + "__volatile", new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (type_id_name + "__volatile", new CCodeConstant ("0")));
} else {
cdecl = new CCodeDeclaration ("GType");
- cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (type_id_name, new CCodeConstant ("0")));
+ cdecl.add_declarator (new CCodeVariableDeclarator (type_id_name, new CCodeConstant ("0")));
}
cdecl.modifiers = CCodeModifiers.STATIC;
if (use_thread_safe) {
@@ -96,7 +96,7 @@
var cgtypetabledecl = new CCodeDeclaration ("const GTypeValueTable");
cgtypetabledecl.modifiers = CCodeModifiers.STATIC;
- cgtypetabledecl.add_declarator (new CCodeVariableDeclarator.with_initializer ( "g_define_type_value_table", new CCodeConstant ("{ %s, %s, %s, %s, \"p\", %s, \"p\", %s }".printf (get_gtype_value_table_init_function_name (), get_gtype_value_table_free_function_name (), get_gtype_value_table_copy_function_name (), get_gtype_value_table_peek_pointer_function_name (), get_gtype_value_table_collect_value_function_name (), get_gtype_value_table_lcopy_value_function_name ()))));
+ cgtypetabledecl.add_declarator (new CCodeVariableDeclarator ( "g_define_type_value_table", new CCodeConstant ("{ %s, %s, %s, %s, \"p\", %s, \"p\", %s }".printf (get_gtype_value_table_init_function_name (), get_gtype_value_table_free_function_name (), get_gtype_value_table_copy_function_name (), get_gtype_value_table_peek_pointer_function_name (), get_gtype_value_table_collect_value_function_name (), get_gtype_value_table_lcopy_value_function_name ()))));
type_value_table_decl_name = "&g_define_type_value_table";
type_init.add_statement ( cgtypetabledecl );
}
@@ -108,12 +108,12 @@
if (get_type_declaration () is ObjectTypeSymbol) {
var ctypedecl = new CCodeDeclaration ("const GTypeInfo");
ctypedecl.modifiers = CCodeModifiers.STATIC;
- ctypedecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("g_define_type_info", new CCodeConstant ("{ sizeof (%s), (GBaseInitFunc) %s, (GBaseFinalizeFunc) %s, (GClassInitFunc) %s, (GClassFinalizeFunc) %s, NULL, %s, 0, (GInstanceInitFunc) %s, %s }".printf (get_type_struct_name (), get_base_init_func_name (), (plugin) ? get_base_finalize_func_name () : "NULL", get_class_init_func_name (), get_class_finalize_func_name (), get_instance_struct_size (), get_instance_init_func_name (), type_value_table_decl_name))));
+ ctypedecl.add_declarator (new CCodeVariableDeclarator ("g_define_type_info", new CCodeConstant ("{ sizeof (%s), (GBaseInitFunc) %s, (GBaseFinalizeFunc) %s, (GClassInitFunc) %s, (GClassFinalizeFunc) %s, NULL, %s, 0, (GInstanceInitFunc) %s, %s }".printf (get_type_struct_name (), get_base_init_func_name (), (plugin) ? get_base_finalize_func_name () : "NULL", get_class_init_func_name (), get_class_finalize_func_name (), get_instance_struct_size (), get_instance_init_func_name (), type_value_table_decl_name))));
type_init.add_statement (ctypedecl);
if (fundamental) {
var ctypefundamentaldecl = new CCodeDeclaration ("const GTypeFundamentalInfo");
ctypefundamentaldecl.modifiers = CCodeModifiers.STATIC;
- ctypefundamentaldecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("g_define_type_fundamental_info", new CCodeConstant ("{ (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }")));
+ ctypefundamentaldecl.add_declarator (new CCodeVariableDeclarator ("g_define_type_fundamental_info", new CCodeConstant ("{ (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }")));
type_init.add_statement (ctypefundamentaldecl);
}
}
@@ -163,7 +163,7 @@
if (use_thread_safe && !plugin) {
var temp_decl = new CCodeDeclaration ("GType");
- temp_decl.add_declarator (new CCodeVariableDeclarator.with_initializer (type_id_name, reg_call));
+ temp_decl.add_declarator (new CCodeVariableDeclarator (type_id_name, reg_call));
type_init.add_statement (temp_decl);
} else {
type_init.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier (type_id_name), reg_call)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]