[vala/staging] codegen: Fix C warning when passing lambda free functions
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Fix C warning when passing lambda free functions
- Date: Mon, 6 Feb 2012 21:40:52 +0000 (UTC)
commit bb7a557c912831a120e1c187d736e5ddae3f9f08
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Feb 6 22:37:16 2012 +0100
codegen: Fix C warning when passing lambda free functions
Fixes bug 663651.
codegen/valaccodebasemodule.vala | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 54238d7..9d7395e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1910,11 +1910,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
cfile.add_function (ref_fun);
var unref_fun = new CCodeFunction ("block%d_data_unref".printf (block_id), "void");
- unref_fun.add_parameter (new CCodeParameter ("_data%d_".printf (block_id), struct_name + "*"));
+ unref_fun.add_parameter (new CCodeParameter ("_userdata_", "void *"));
unref_fun.modifiers = CCodeModifiers.STATIC;
push_function (unref_fun);
+ ccode.add_declaration (struct_name + "*", new CCodeVariableDeclarator ("_data%d_".printf (block_id), new CCodeCastExpression (new CCodeIdentifier ("_userdata_"), struct_name + "*")));
ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_atomic_int_dec_and_test"));
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeMemberAccess.pointer (new CCodeIdentifier ("_data%d_".printf (block_id)), "_ref_count_")));
ccode.open_if (ccall);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]