]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GObject: Remove unused klass variable from constructors
authorJürg Billeter <j@bitron.ch>
Mon, 21 Sep 2009 17:37:22 +0000 (19:37 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 21 Sep 2009 17:37:22 +0000 (19:37 +0200)
codegen/valagobjectmodule.vala

index 6466dd0589a9f40ad08e602e5b275d443950998a..94152996c6e32374b1966bfc41d7699d03c20d3a 100644 (file)
@@ -447,27 +447,17 @@ internal class Vala.GObjectModule : GTypeModule {
                        cdecl.add_declarator (new CCodeVariableDeclarator ("obj"));
                        cblock.add_statement (cdecl);
 
-                       cdecl = new CCodeDeclaration ("%sClass *".printf (cl.get_cname ()));
-                       cdecl.add_declarator (new CCodeVariableDeclarator ("klass"));
-                       cblock.add_statement (cdecl);
-
                        cdecl = new CCodeDeclaration ("GObjectClass *");
                        cdecl.add_declarator (new CCodeVariableDeclarator ("parent_class"));
                        cblock.add_statement (cdecl);
 
 
-                       var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_type_class_peek"));
-                       ccall.add_argument (new CCodeIdentifier (cl.get_type_id ()));
-                       var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (cl.get_upper_case_cname (null))));
-                       ccast.add_argument (ccall);
-                       cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("klass"), ccast)));
-
-                       ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_CLASS"));
+                       var ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_CLASS"));
                        ccast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (cl.get_lower_case_cname (null))));
                        cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("parent_class"), ccast)));
 
                
-                       ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (new CCodeIdentifier ("parent_class"), "constructor"));
+                       var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (new CCodeIdentifier ("parent_class"), "constructor"));
                        ccall.add_argument (new CCodeIdentifier ("type"));
                        ccall.add_argument (new CCodeIdentifier ("n_construct_properties"));
                        ccall.add_argument (new CCodeIdentifier ("construct_properties"));