From: Raffaele Sandrini Date: Thu, 10 Jul 2008 14:59:00 +0000 (+0000) Subject: Revert commit revision 1691 due bad regressions, reopens bug 540705 X-Git-Tag: VALA_0_3_5~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48bd2daaa3d12c88a2053b4d173e497b60cd2bd9;p=thirdparty%2Fvala.git Revert commit revision 1691 due bad regressions, reopens bug 540705 2008-07-10 Raffaele Sandrini * ccode/valaccodedeclaration.vala: * ccode/valaccodemodifiers.vala: * gobject/valatyperegisterfunction.vala: Revert commit revision 1691 due bad regressions, reopens bug 540705 svn path=/trunk/; revision=1693 --- diff --git a/ChangeLog b/ChangeLog index 4ff4418f3..2d7fe9fa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-10 Raffaele Sandrini + + * ccode/valaccodedeclaration.vala: + * ccode/valaccodemodifiers.vala: + * gobject/valatyperegisterfunction.vala: + + Revert commit revision 1691 due bad regressions, reopens bug + 540705 + 2008-07-10 Jürg Billeter * vapi/glib-2.0.vapi: @@ -27,7 +36,7 @@ * tests/classes-properties.vala: update -2008-07-09 Jared Moore +2008-07-98 Jared Moore * gobject/valaccodecompiler.vala: diff --git a/ccode/valaccodedeclaration.vala b/ccode/valaccodedeclaration.vala index 7a0223bab..eb7ada541 100644 --- a/ccode/valaccodedeclaration.vala +++ b/ccode/valaccodedeclaration.vala @@ -59,9 +59,6 @@ public class Vala.CCodeDeclaration : CCodeStatement { if ((modifiers & CCodeModifiers.STATIC) != 0) { writer.write_string ("static "); } - if ((modifiers & CCodeModifiers.VOLATILE) != 0) { - writer.write_string ("volatile "); - } if ((modifiers & CCodeModifiers.EXTERN) != 0 && !has_initializer ()) { writer.write_string ("extern "); } diff --git a/ccode/valaccodemodifiers.vala b/ccode/valaccodemodifiers.vala index 90f6809c8..670bf4e12 100644 --- a/ccode/valaccodemodifiers.vala +++ b/ccode/valaccodemodifiers.vala @@ -29,6 +29,5 @@ public enum Vala.CCodeModifiers { STATIC = 1 << 0, REGISTER = 1 << 1, EXTERN = 1 << 2, - INLINE = 1 << 3, - VOLATILE = 1 << 4 + INLINE = 1 << 3 } diff --git a/gobject/valatyperegisterfunction.vala b/gobject/valatyperegisterfunction.vala index d342d02ce..3e81a5146 100644 --- a/gobject/valatyperegisterfunction.vala +++ b/gobject/valatyperegisterfunction.vala @@ -45,7 +45,7 @@ public abstract class Vala.TypeRegisterFunction : Object { var type_block = new CCodeBlock (); var cdecl = new CCodeDeclaration ("GType"); cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer (type_id_name, new CCodeConstant ("0"))); - cdecl.modifiers = CCodeModifiers.STATIC | CCodeModifiers.VOLATILE; + cdecl.modifiers = CCodeModifiers.STATIC; if (!plugin) { type_block.add_statement (cdecl); } else { @@ -110,26 +110,14 @@ public abstract class Vala.TypeRegisterFunction : Object { reg_call.add_argument (new CCodeIdentifier ("&g_define_type_fundamental_info")); } reg_call.add_argument (new CCodeConstant (get_type_flags ())); - - string temp_type_id_name = "%s_type_id_temp".printf (get_type_declaration ().get_lower_case_cname (null)); - if (!plugin) { - var temp_decl = new CCodeDeclaration ("GType"); - temp_decl.add_declarator (new CCodeVariableDeclarator.with_initializer (temp_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))); - } + type_init.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier (type_id_name), reg_call))); type_init.add_statement (get_type_interface_init_statements ()); if (!plugin) { - var enter = new CCodeFunctionCall (new CCodeIdentifier ("g_once_init_enter")); - enter.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (type_id_name))); - var leave = new CCodeFunctionCall (new CCodeIdentifier ("g_once_init_leave")); - leave.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (type_id_name))); - leave.add_argument (new CCodeIdentifier (temp_type_id_name)); - type_init.add_statement (new CCodeExpressionStatement (leave)); - var cif = new CCodeIfStatement (enter, type_init); + var cond = new CCodeFunctionCall (new CCodeIdentifier ("G_UNLIKELY")); + cond.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, new CCodeIdentifier (type_id_name), new CCodeConstant ("0"))); + var cif = new CCodeIfStatement (cond, type_init); type_block.add_statement (cif); } else { type_block = type_init;