69 lines
3.2 KiB
Diff
69 lines
3.2 KiB
Diff
From 8bd7fbc9e39ca6396ee323bef420dadeeac54a7d Mon Sep 17 00:00:00 2001
|
|
From: Rico Tzschichholz <ricotz@ubuntu.com>
|
|
Date: Fri, 8 Sep 2017 14:31:41 +0200
|
|
Subject: [PATCH] codegen: Try to use a more unique internal define for
|
|
properties
|
|
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=787436
|
|
---
|
|
codegen/valagobjectmodule.vala | 8 ++++----
|
|
codegen/valagtypemodule.vala | 2 +-
|
|
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
|
|
index 33bb87805..8b3e7a269 100644
|
|
--- a/codegen/valagobjectmodule.vala
|
|
+++ b/codegen/valagobjectmodule.vala
|
|
@@ -144,7 +144,7 @@ public class Vala.GObjectModule : GTypeModule {
|
|
|
|
var cinst = new CCodeFunctionCall (new CCodeIdentifier ("g_object_class_install_property"));
|
|
cinst.add_argument (ccall);
|
|
- cinst.add_argument (new CCodeConstant (get_ccode_upper_case_name (prop)));
|
|
+ cinst.add_argument (new CCodeConstant ("%s_PROPERTY".printf (get_ccode_upper_case_name (prop))));
|
|
cinst.add_argument (get_param_spec (prop));
|
|
|
|
ccode.add_expression (cinst);
|
|
@@ -228,7 +228,7 @@ public class Vala.GObjectModule : GTypeModule {
|
|
cfunc = new CCodeIdentifier (get_ccode_real_name (prop.get_accessor));
|
|
}
|
|
|
|
- ccode.add_case (new CCodeIdentifier (get_ccode_upper_case_name (prop)));
|
|
+ ccode.add_case (new CCodeIdentifier ("%s_PROPERTY".printf (get_ccode_upper_case_name (prop))));
|
|
if (prop.property_type.is_real_struct_type ()) {
|
|
var st = prop.property_type.data_type as Struct;
|
|
|
|
@@ -335,7 +335,7 @@ public class Vala.GObjectModule : GTypeModule {
|
|
cfunc = new CCodeIdentifier (get_ccode_real_name (prop.set_accessor));
|
|
}
|
|
|
|
- ccode.add_case (new CCodeIdentifier (get_ccode_upper_case_name (prop)));
|
|
+ ccode.add_case (new CCodeIdentifier ("%s_PROPERTY".printf (get_ccode_upper_case_name (prop))));
|
|
ccall = new CCodeFunctionCall (cfunc);
|
|
ccall.add_argument (cself);
|
|
if (prop.property_type is ArrayType && ((ArrayType)prop.property_type).element_type.data_type == string_type.data_type) {
|
|
@@ -684,7 +684,7 @@ public class Vala.GObjectModule : GTypeModule {
|
|
base.visit_property (prop);
|
|
|
|
if (is_gobject_property (prop) && prop.parent_symbol is Class) {
|
|
- prop_enum.add_value (new CCodeEnumValue (get_ccode_upper_case_name (prop)));
|
|
+ prop_enum.add_value (new CCodeEnumValue ("%s_PROPERTY".printf (get_ccode_upper_case_name (prop))));
|
|
|
|
if (prop.initializer != null && prop.set_accessor != null && !prop.set_accessor.automatic_body) {
|
|
// generate a custom initializer if it couldn't be done at class_init time
|
|
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
|
|
index 6d0f0d2eb..e75036041 100644
|
|
--- a/codegen/valagtypemodule.vala
|
|
+++ b/codegen/valagtypemodule.vala
|
|
@@ -1732,7 +1732,7 @@ public class Vala.GTypeModule : GErrorModule {
|
|
public override CCodeExpression get_param_spec_cexpression (Property prop) {
|
|
var cl = (TypeSymbol) prop.parent_symbol;
|
|
var prop_array = new CCodeIdentifier ("%s_properties".printf (get_ccode_lower_case_name (cl)));
|
|
- var prop_enum_value = new CCodeIdentifier (get_ccode_upper_case_name (prop));
|
|
+ var prop_enum_value = new CCodeIdentifier ("%s_PROPERTY".printf (get_ccode_upper_case_name (prop)));
|
|
|
|
return new CCodeElementAccess (prop_array, prop_enum_value);
|
|
}
|
|
--
|
|
2.14.1
|
|
|