[vala] codegen: Use builder API for dup func wrapper
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use builder API for dup func wrapper
- Date: Sun, 10 Oct 2010 16:39:12 +0000 (UTC)
commit d0101ddaef2ee975d898d64a7ee7fcd1a364955a
Author: Jürg Billeter <j bitron ch>
Date: Sun Oct 10 11:51:39 2010 +0200
codegen: Use builder API for dup func wrapper
codegen/valaccodebasemodule.vala | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index b520fb4..c6e8612 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2534,15 +2534,11 @@ public class Vala.CCodeBaseModule : CodeGenerator {
return destroy_func;
}
- // declaration
-
var function = new CCodeFunction (destroy_func, type.get_cname ());
function.modifiers = CCodeModifiers.STATIC;
function.add_parameter (new CCodeFormalParameter ("self", type.get_cname ()));
- // definition
-
- var block = new CCodeBlock ();
+ push_function (function);
var cl = type.data_type as Class;
assert (cl != null && cl.is_gboxed);
@@ -2551,13 +2547,11 @@ public class Vala.CCodeBaseModule : CodeGenerator {
free_call.add_argument (new CCodeIdentifier (cl.get_type_id ()));
free_call.add_argument (new CCodeIdentifier ("self"));
- block.add_statement (new CCodeReturnStatement (free_call));
+ ccode.add_return (free_call);
- // append to file
+ pop_function ();
cfile.add_function_declaration (function);
-
- function.block = block;
cfile.add_function (function);
return destroy_func;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]