summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2023-03-13 09:13:34 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2023-03-13 09:13:34 +0100
commitc2093183099e4da3e00da38a3a6de18c319f4c87 (patch)
treee36455aed8de011164f4686926bcab3d06c8e323 /codegen
parentd5ecd13849a6a9126d3b90d16a3268f860800b41 (diff)
downloadvala-c2093183099e4da3e00da38a3a6de18c319f4c87.tar.gz
codegen: Add cast to accessor calls for generic property implementations
Found by -Werror=int-conversion
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valagobjectmodule.vala12
1 files changed, 10 insertions, 2 deletions
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 638aab367..457e7f2de 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -273,7 +273,11 @@ public class Vala.GObjectModule : GTypeModule {
csetcall.call = get_value_setter_function (prop.property_type);
}
csetcall.add_argument (new CCodeIdentifier ("value"));
- csetcall.add_argument (ccall);
+ if (base_prop != null && prop != base_prop && base_prop.property_type is GenericType) {
+ csetcall.add_argument (convert_from_generic_pointer (ccall, prop.property_type));
+ } else {
+ csetcall.add_argument (ccall);
+ }
add_guarded_expression (prop, csetcall);
if (array_type != null && get_ccode_array_length (prop) && array_type.element_type.type_symbol == string_type.type_symbol) {
ccode.close ();
@@ -407,7 +411,11 @@ public class Vala.GObjectModule : GTypeModule {
cgetcall.call = new CCodeIdentifier ("g_value_get_pointer");
}
cgetcall.add_argument (new CCodeIdentifier ("value"));
- ccall.add_argument (cgetcall);
+ if (base_prop != null && prop != base_prop && base_prop.property_type is GenericType) {
+ ccall.add_argument (convert_to_generic_pointer (cgetcall, prop.property_type));
+ } else {
+ ccall.add_argument (cgetcall);
+ }
add_guarded_expression (prop, ccall);
}
ccode.add_break ();