[vala/staging] codegen: Consistently use gpointer for delegate targets
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Consistently use gpointer for delegate targets
- Date: Sun, 10 Jun 2018 13:07:16 +0000 (UTC)
commit f167b6feed996a12e221bd75456530a7df99b304
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Jun 6 16:49:41 2018 +0200
codegen: Consistently use gpointer for delegate targets
codegen/valaccodedelegatemodule.vala | 10 +++++-----
codegen/valaccodemethodmodule.vala | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala
index e3ab92ce7..042e2be05 100644
--- a/codegen/valaccodedelegatemodule.vala
+++ b/codegen/valaccodedelegatemodule.vala
@@ -76,7 +76,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
var deleg_type = (DelegateType) param.variable_type;
var param_d = deleg_type.delegate_symbol;
if (param_d.has_target) {
- cparam = new CCodeParameter (get_delegate_target_cname
(get_variable_cname (param.name)), "void*");
+ cparam = new CCodeParameter (get_delegate_target_cname
(get_variable_cname (param.name)), "gpointer");
cfundecl.add_parameter (cparam);
if (deleg_type.is_disposable ()) {
cparam = new CCodeParameter
(get_delegate_target_destroy_notify_cname (get_variable_cname (param.name)), "GDestroyNotify");
@@ -100,7 +100,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
var deleg_type = (DelegateType) d.return_type;
var result_d = deleg_type.delegate_symbol;
if (result_d.has_target) {
- var cparam = new CCodeParameter (get_delegate_target_cname ("result"),
"void**");
+ var cparam = new CCodeParameter (get_delegate_target_cname ("result"),
"gpointer*");
cfundecl.add_parameter (cparam);
if (deleg_type.is_disposable ()) {
cparam = new CCodeParameter (get_delegate_target_destroy_notify_cname
("result"), "GDestroyNotify*");
@@ -112,7 +112,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
cfundecl.add_parameter (cparam);
}
if (d.has_target) {
- var cparam = new CCodeParameter ("user_data", "void*");
+ var cparam = new CCodeParameter ("user_data", "gpointer");
cfundecl.add_parameter (cparam);
}
if (d.get_error_types ().size > 0) {
@@ -251,7 +251,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
var deleg_type = (DelegateType) d.return_type;
if (deleg_type.delegate_symbol.has_target) {
- var cparam = new CCodeParameter (get_delegate_target_cname ("result"),
"void**");
+ var cparam = new CCodeParameter (get_delegate_target_cname ("result"),
"gpointer*");
cparam_map.set (get_param_pos (get_ccode_delegate_target_pos (d)), cparam);
if (deleg_type.is_disposable ()) {
cparam = new CCodeParameter (get_delegate_target_destroy_notify_cname
("result"), "GDestroyNotify*");
@@ -465,7 +465,7 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
}
string ctypename = get_ccode_name (param.variable_type);
- string target_ctypename = "void*";
+ string target_ctypename = "gpointer";
string target_destroy_notify_ctypename = "GDestroyNotify";
if (param.parent_symbol is Delegate
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 224f2d53a..117e7a21d 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -94,7 +94,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
// return delegate target if appropriate
var deleg_type = (DelegateType) m.return_type;
if (deleg_type.delegate_symbol.has_target) {
- var cparam = new CCodeParameter (get_delegate_target_cname ("result"),
"void**");
+ var cparam = new CCodeParameter (get_delegate_target_cname ("result"),
"gpointer*");
cparam_map.set (get_param_pos (get_ccode_delegate_target_pos (m)), cparam);
if (carg_map != null) {
carg_map.set (get_param_pos (get_ccode_delegate_target_pos (m)),
get_variable_cexpression (cparam.name));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]