From 0753d2eb6bd6dae2b6b12a349b16b51b881a5ca7 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Wed, 2 Sep 2020 15:13:29 +0200 Subject: Don't use locale dependent string functions on syntax strings Replace usage of string.down() with string.ascii_down(), and string.up() with string.ascii_up() Fixes https://gitlab.gnome.org/GNOME/vala/issues/1067 --- valadoc/doclets/gtkdoc/dbus.vala | 2 +- valadoc/doclets/gtkdoc/generator.vala | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'valadoc') diff --git a/valadoc/doclets/gtkdoc/dbus.vala b/valadoc/doclets/gtkdoc/dbus.vala index 700574d01..d7804a2d8 100644 --- a/valadoc/doclets/gtkdoc/dbus.vala +++ b/valadoc/doclets/gtkdoc/dbus.vala @@ -200,7 +200,7 @@ namespace Gtkdoc.DBus { docbook_id, docbook_id, name, - package_name.up (), + package_name.ascii_up (), name, purpose ?? ""); diff --git a/valadoc/doclets/gtkdoc/generator.vala b/valadoc/doclets/gtkdoc/generator.vala index 2f929ccaf..a923eaf15 100644 --- a/valadoc/doclets/gtkdoc/generator.vala +++ b/valadoc/doclets/gtkdoc/generator.vala @@ -444,7 +444,7 @@ public class Gtkdoc.Generator : Api.Visitor { var type_parameters = iface.get_children_by_type (NodeType.TYPE_PARAMETER, false); foreach (Api.Node _type in type_parameters) { var type = _type as Api.TypeParameter; - string type_name_down = type.name.down (); + string type_name_down = type.name.ascii_down (); add_custom_header ("get_%s_type".printf (type_name_down), "The #GType for %s".printf (type_name_down)); add_custom_header ("get_%s_dup_func".printf (type_name_down), @@ -601,7 +601,7 @@ It is important that your GValue hold file_data.register_standard_section_line (cl.get_type_function_name ()); file_data.register_private_section_line (cl.get_private_cname ()); - file_data.register_private_section_line (((cl.nspace.name != null)? cl.nspace.name.down () + "_" : "") + file_data.register_private_section_line (((cl.nspace.name != null)? cl.nspace.name.ascii_down () + "_" : "") + to_lower_case (cl.name) + "_construct"); @@ -821,12 +821,12 @@ It is important that your GValue hold string? return_type_link = null; if (type_parameter != null) { if (type_parameter.parent is Api.Class) { - return_type_link = "#%s:%s-type".printf (get_cname (prop.parent), type_parameter.name.down ()); + return_type_link = "#%s:%s-type".printf (get_cname (prop.parent), type_parameter.name.ascii_down ()); } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) { return_type_link = "#_%sIface.get_%s_type()" - .printf (get_cname (type_parameter.parent), type_parameter.name.down ()); + .printf (get_cname (type_parameter.parent), type_parameter.name.ascii_down ()); } } @@ -889,7 +889,7 @@ It is important that your GValue hold if (return_type_link != null) { string return_type_desc = "Holds a value from type #%s:%s-type." - .printf (get_cname (prop.parent), type_parameter.name.down ()); + .printf (get_cname (prop.parent), type_parameter.name.ascii_down ()); gcomment.long_comment = combine_inline_docs (return_type_desc, gcomment.long_comment); } } @@ -941,13 +941,13 @@ It is important that your GValue hold if (type_parameter != null) { if (type_parameter.parent is Api.Class) { string return_type_desc = "A value from type #%s:%s-type." - .printf (get_cname (d.parent), type_parameter.name.down ()); + .printf (get_cname (d.parent), type_parameter.name.ascii_down ()); gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns); } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) { string return_type_desc = "A value from type #_%sIface.get_%s_type()." - .printf (get_cname (d.parent), type_parameter.name.down ()); + .printf (get_cname (d.parent), type_parameter.name.ascii_down ()); gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns); /* } else if (type_parameter.parent is Api.Struct) { @@ -995,14 +995,14 @@ It is important that your GValue hold if (type_parameter != null) { if (type_parameter.parent is Api.Class) { string return_type_desc = "A value from type #%s:%s-type." - .printf (get_cname (type_parameter.parent), type_parameter.name.down ()); + .printf (get_cname (type_parameter.parent), type_parameter.name.ascii_down ()); gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns); } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) { string return_type_desc = "A value from type #_%sIface.get_%s_type()." - .printf (get_cname (type_parameter.parent), type_parameter.name.down ()); + .printf (get_cname (type_parameter.parent), type_parameter.name.ascii_down ()); gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns); } @@ -1061,7 +1061,7 @@ It is important that your GValue hold var type_parameters = ((Api.Node) m.parent).get_children_by_type (NodeType.TYPE_PARAMETER, false); foreach (Api.Node _type in type_parameters) { var type = _type as Api.TypeParameter; - string type_name_down = type.name.down (); + string type_name_down = type.name.ascii_down (); add_custom_header (type_name_down + "_type", "A #GType"); add_custom_header (type_name_down + "_dup_func", @@ -1075,7 +1075,7 @@ It is important that your GValue hold var type_parameters = m.get_children_by_type (NodeType.TYPE_PARAMETER, false); foreach (Api.Node _type in type_parameters) { var type = _type as Api.TypeParameter; - string type_name_down = type.name.down (); + string type_name_down = type.name.ascii_down (); add_custom_header (type_name_down + "_type", "The #GType for @%s".printf (type_name_down), null, @@ -1150,16 +1150,16 @@ It is important that your GValue hold if (type_parameter != null) { if (type_parameter.parent is Api.Class) { return_type_desc = "A value from type #%s:%s-type." - .printf (get_cname (m.parent), type_parameter.name.down ()); + .printf (get_cname (m.parent), type_parameter.name.ascii_down ()); } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) { return_type_desc = "A value from type #_%sIface.get_%s_type()." - .printf (get_cname (m.parent), type_parameter.name.down ()); + .printf (get_cname (m.parent), type_parameter.name.ascii_down ()); } else if (type_parameter.parent is Api.Struct) { // type not stored } else if (type_parameter.parent == m) { - return_type_desc = "value from type @%s_type.".printf (type_parameter.name.down ()); + return_type_desc = "value from type @%s_type.".printf (type_parameter.name.ascii_down ()); } } @@ -1264,16 +1264,16 @@ It is important that your GValue hold if (type_parameter != null) { if (type_parameter.parent is Api.Class) { add_custom_header (param_name, "A parameter from type #%s:%s-type." - .printf (get_cname (type_parameter.parent), type_parameter.name.down ()), null, double.MAX, false); + .printf (get_cname (type_parameter.parent), type_parameter.name.ascii_down ()), null, double.MAX, false); } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent) .get_attribute ("GenericAccessors") != null) { add_custom_header (param_name, "A parameter from type #_%sIface.get_%s_type()." - .printf (get_cname (type_parameter.parent), type_parameter.name.down ()), null, double.MAX, false); + .printf (get_cname (type_parameter.parent), type_parameter.name.ascii_down ()), null, double.MAX, false); } else if (type_parameter.parent is Api.Struct) { // type not stored } else if (type_parameter.parent is Method) { add_custom_header (param_name, "A parameter from type @%s_type." - .printf (type_parameter.name.down ()), null, double.MAX, false); + .printf (type_parameter.name.ascii_down ()), null, double.MAX, false); } } -- cgit v1.2.1