summaryrefslogtreecommitdiff
path: root/valadoc
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-09-02 15:13:29 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-09-02 18:59:06 +0200
commit0753d2eb6bd6dae2b6b12a349b16b51b881a5ca7 (patch)
treed72186f70d4e537cf8790946ec7ac707354f2d9d /valadoc
parente451fd7d38c0d93fd209782ed7ac07222d2e2418 (diff)
downloadvala-0753d2eb6bd6dae2b6b12a349b16b51b881a5ca7.tar.gz
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
Diffstat (limited to 'valadoc')
-rw-r--r--valadoc/doclets/gtkdoc/dbus.vala2
-rw-r--r--valadoc/doclets/gtkdoc/generator.vala34
2 files changed, 18 insertions, 18 deletions
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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> hold
if (return_type_link != null) {
string return_type_desc = "<para>Holds a value from type #%s:%s-type.</para>"
- .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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> 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 <link linkend="GValue"><type>GValue</type></link> 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);
}
}