[vala/0.40] Don't use locale dependent string functions on syntax strings



commit 387b951df627148bd2c1e401f63a007970f3866a
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Sep 2 15:13:29 2020 +0200

    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

 codegen/valaccode.vala                             |  2 +-
 codegen/valaccodearraymodule.vala                  |  2 +-
 codegen/valaccodebasemodule.vala                   | 30 +++++++++---------
 codegen/valaccodemethodcallmodule.vala             |  8 ++---
 codegen/valaccodemethodmodule.vala                 | 36 +++++++++++-----------
 codegen/valagasyncmodule.vala                      | 12 ++++----
 codegen/valagdbusmodule.vala                       |  2 +-
 codegen/valagirwriter.vala                         | 16 +++++-----
 codegen/valagobjectmodule.vala                     |  2 +-
 codegen/valagtypemodule.vala                       | 18 +++++------
 libvaladoc/content/sourcecode.vala                 |  2 +-
 libvaladoc/ctyperesolver.vala                      |  2 +-
 libvaladoc/documentation/gtkdoccommentparser.vala  |  4 +--
 libvaladoc/documentation/gtkdocmarkdownparser.vala |  4 +--
 vala/valasymbol.vala                               |  2 +-
 valadoc/doclets/gtkdoc/dbus.vala                   |  2 +-
 valadoc/doclets/gtkdoc/generator.vala              | 34 ++++++++++----------
 17 files changed, 89 insertions(+), 89 deletions(-)
---
diff --git a/codegen/valaccode.vala b/codegen/valaccode.vala
index 71b637b59..247ea7ce4 100644
--- a/codegen/valaccode.vala
+++ b/codegen/valaccode.vala
@@ -59,7 +59,7 @@ namespace Vala {
                        } else if (sym is Signal) {
                                return get_ccode_attribute (sym).name.replace ("-", "_");
                        } else if (sym is ErrorCode) {
-                               return get_ccode_name (sym).down ();
+                               return get_ccode_name (sym).ascii_down ();
                        } else {
                                return "%s%s%s".printf (get_ccode_lower_case_prefix (sym.parent_symbol), 
infix, get_ccode_lower_case_suffix (sym));
                        }
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index a25716acb..ffec70c5e 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -524,7 +524,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                function.add_parameter (new CCodeParameter ("length", "int"));
                if (array_type.element_type is GenericType) {
                        // dup function array elements
-                       string func_name = "%s_dup_func".printf (((GenericType) 
array_type.element_type).type_parameter.name.down ());
+                       string func_name = "%s_dup_func".printf (((GenericType) 
array_type.element_type).type_parameter.name.ascii_down ());
                        function.add_parameter (new CCodeParameter (func_name, "GBoxedCopyFunc"));
                }
 
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index f9b71170d..9318bc721 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2036,13 +2036,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                        foreach (var type_param in current_method.get_type_parameters ()) {
                                                string func_name;
 
-                                               func_name = "%s_type".printf (type_param.name.down ());
+                                               func_name = "%s_type".printf (type_param.name.ascii_down ());
                                                data.add_field ("GType", func_name);
 
-                                               func_name = "%s_dup_func".printf (type_param.name.down ());
+                                               func_name = "%s_dup_func".printf (type_param.name.ascii_down 
());
                                                data.add_field ("GBoxedCopyFunc", func_name);
 
-                                               func_name = "%s_destroy_func".printf (type_param.name.down 
());
+                                               func_name = "%s_destroy_func".printf 
(type_param.name.ascii_down ());
                                                data.add_field ("GDestroyNotify", func_name);
                                        }
                                }
@@ -2108,7 +2108,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                        var suffices = new string[] {"type", "dup_func", "destroy_func"};
                                        foreach (var type_param in current_method.get_type_parameters ()) {
                                                foreach (string suffix in suffices) {
-                                                       string func_name = "%s_%s".printf 
(type_param.name.down (), suffix);
+                                                       string func_name = "%s_%s".printf 
(type_param.name.ascii_down (), suffix);
                                                        ccode.add_assignment (new CCodeMemberAccess.pointer 
(get_variable_cexpression ("_data%d_".printf (block_id)), func_name), get_variable_cexpression (func_name));
                                                }
                                        }
@@ -2200,15 +2200,15 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                foreach (var type_param in current_method.get_type_parameters ()) {
                                        string func_name;
 
-                                       func_name = "%s_type".printf (type_param.name.down ());
+                                       func_name = "%s_type".printf (type_param.name.ascii_down ());
                                        ccode.add_declaration ("GType", new CCodeVariableDeclarator 
(func_name));
                                        ccode.add_assignment (new CCodeIdentifier (func_name), new 
CCodeMemberAccess.pointer (outer_block, func_name));
 
-                                       func_name = "%s_dup_func".printf (type_param.name.down ());
+                                       func_name = "%s_dup_func".printf (type_param.name.ascii_down ());
                                        ccode.add_declaration ("GBoxedCopyFunc", new CCodeVariableDeclarator 
(func_name));
                                        ccode.add_assignment (new CCodeIdentifier (func_name), new 
CCodeMemberAccess.pointer (outer_block, func_name));
 
-                                       func_name = "%s_destroy_func".printf (type_param.name.down ());
+                                       func_name = "%s_destroy_func".printf (type_param.name.ascii_down ());
                                        ccode.add_declaration ("GDestroyNotify", new CCodeVariableDeclarator 
(func_name));
                                        ccode.add_assignment (new CCodeIdentifier (func_name), new 
CCodeMemberAccess.pointer (outer_block, func_name));
                                }
@@ -2766,13 +2766,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        public CCodeExpression get_type_id_expression (DataType type, bool is_chainup = false) {
                if (type is GenericType) {
                        var type_parameter = ((GenericType) type).type_parameter;
-                       string var_name = "%s_type".printf (type_parameter.name.down ());
+                       string var_name = "%s_type".printf (type_parameter.name.ascii_down ());
 
                        if (type_parameter.parent_symbol is Interface) {
                                var iface = (Interface) type_parameter.parent_symbol;
                                require_generic_accessors (iface);
 
-                               string method_name = "get_%s_type".printf (type_parameter.name.down ());
+                               string method_name = "get_%s_type".printf (type_parameter.name.ascii_down ());
                                var cast_self = new CCodeFunctionCall (new CCodeIdentifier 
("%s_GET_INTERFACE".printf (get_ccode_upper_case_name (iface))));
                                cast_self.add_argument (new CCodeIdentifier ("self"));
                                var function_call = new CCodeFunctionCall (new CCodeMemberAccess.pointer 
(cast_self, method_name));
@@ -2836,13 +2836,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        return new CCodeIdentifier (dup_function);
                } else if (type is GenericType) {
                        var type_parameter = ((GenericType) type).type_parameter;
-                       string func_name = "%s_dup_func".printf (type_parameter.name.down ());
+                       string func_name = "%s_dup_func".printf (type_parameter.name.ascii_down ());
 
                        if (type_parameter.parent_symbol is Interface) {
                                var iface = (Interface) type_parameter.parent_symbol;
                                require_generic_accessors (iface);
 
-                               string method_name = "get_%s_dup_func".printf (type_parameter.name.down ());
+                               string method_name = "get_%s_dup_func".printf (type_parameter.name.ascii_down 
());
                                var cast_self = new CCodeFunctionCall (new CCodeIdentifier 
("%s_GET_INTERFACE".printf (get_ccode_upper_case_name (iface))));
                                cast_self.add_argument (new CCodeIdentifier ("self"));
                                var function_call = new CCodeFunctionCall (new CCodeMemberAccess.pointer 
(cast_self, method_name));
@@ -3329,13 +3329,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        return new CCodeIdentifier (unref_function);
                } else if (type is GenericType) {
                        var type_parameter = ((GenericType) type).type_parameter;
-                       string func_name = "%s_destroy_func".printf (type_parameter.name.down ());
+                       string func_name = "%s_destroy_func".printf (type_parameter.name.ascii_down ());
 
                        if (type_parameter.parent_symbol is Interface) {
                                var iface = (Interface) type_parameter.parent_symbol;
                                require_generic_accessors (iface);
 
-                               string method_name = "get_%s_destroy_func".printf (type_parameter.name.down 
());
+                               string method_name = "get_%s_destroy_func".printf 
(type_parameter.name.ascii_down ());
                                var cast_self = new CCodeFunctionCall (new CCodeIdentifier 
("%s_GET_INTERFACE".printf (get_ccode_upper_case_name (iface))));
                                cast_self.add_argument (new CCodeIdentifier ("self"));
                                var function_call = new CCodeFunctionCall (new CCodeMemberAccess.pointer 
(cast_self, method_name));
@@ -4716,7 +4716,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                int type_param_index = 0;
                foreach (var type_arg in type_args) {
                        if (type_parameters != null) {
-                               var type_param_name = type_parameters.get (type_param_index).name.down 
().replace ("_", "-");
+                               var type_param_name = type_parameters.get (type_param_index).name.ascii_down 
().replace ("_", "-");
                                arg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new CCodeConstant 
("\"%s-type\"".printf (type_param_name)));
                                arg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new CCodeConstant 
("\"%s-dup-func\"".printf (type_param_name)));
                                arg_map.set (get_param_pos (0.1 * type_param_index + 0.05), new CCodeConstant 
("\"%s-destroy-func\"".printf (type_param_name)));
@@ -6414,7 +6414,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public static CCodeConstant get_enum_value_canonical_cconstant (EnumValue ev) {
-               return new CCodeConstant ("\"%s\"".printf (ev.name.down ().replace ("_", "-")));
+               return new CCodeConstant ("\"%s\"".printf (ev.name.ascii_down ().replace ("_", "-")));
        }
 
        public bool get_signal_has_emitter (Signal sig) {
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 33357527b..40829730c 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -154,9 +154,9 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                        int type_param_index = 0;
                                        var cl = (Class) m.parent_symbol;
                                        foreach (TypeParameter type_param in cl.get_type_parameters ()) {
-                                               in_arg_map.set (get_param_pos (0.1 * type_param_index + 
0.01), new CCodeIdentifier ("%s_type".printf (type_param.name.down ())));
-                                               in_arg_map.set (get_param_pos (0.1 * type_param_index + 
0.02), new CCodeIdentifier ("%s_dup_func".printf (type_param.name.down ())));
-                                               in_arg_map.set (get_param_pos (0.1 * type_param_index + 
0.03), new CCodeIdentifier ("%s_destroy_func".printf (type_param.name.down ())));
+                                               in_arg_map.set (get_param_pos (0.1 * type_param_index + 
0.01), new CCodeIdentifier ("%s_type".printf (type_param.name.ascii_down ())));
+                                               in_arg_map.set (get_param_pos (0.1 * type_param_index + 
0.02), new CCodeIdentifier ("%s_dup_func".printf (type_param.name.ascii_down ())));
+                                               in_arg_map.set (get_param_pos (0.1 * type_param_index + 
0.03), new CCodeIdentifier ("%s_destroy_func".printf (type_param.name.ascii_down ())));
                                                type_param_index++;
                                        }
                                }
@@ -336,7 +336,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                        var priv_access = new CCodeMemberAccess.pointer (new CCodeIdentifier 
("self"), "priv");
 
                                        foreach (string suffix in suffices) {
-                                               var param_name = new CCodeIdentifier ("%s_%s".printf 
(type_param.name.down (), suffix));
+                                               var param_name = new CCodeIdentifier ("%s_%s".printf 
(type_param.name.ascii_down (), suffix));
                                                ccode.add_assignment (new CCodeMemberAccess.pointer 
(priv_access, param_name.name), param_name);
                                        }
                                }
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index cfcf9ccbc..55cbd219a 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -518,15 +518,15 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                                        foreach (var type_param in m.get_type_parameters ()) {
                                                string func_name;
 
-                                               func_name = "%s_type".printf (type_param.name.down ());
+                                               func_name = "%s_type".printf (type_param.name.ascii_down ());
                                                ccode.add_declaration ("GType", new CCodeVariableDeclarator 
(func_name));
                                                ccode.add_assignment (new CCodeIdentifier (func_name), new 
CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (block_id)), func_name));
 
-                                               func_name = "%s_dup_func".printf (type_param.name.down ());
+                                               func_name = "%s_dup_func".printf (type_param.name.ascii_down 
());
                                                ccode.add_declaration ("GBoxedCopyFunc", new 
CCodeVariableDeclarator (func_name));
                                                ccode.add_assignment (new CCodeIdentifier (func_name), new 
CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (block_id)), func_name));
 
-                                               func_name = "%s_destroy_func".printf (type_param.name.down 
());
+                                               func_name = "%s_destroy_func".printf 
(type_param.name.ascii_down ());
                                                ccode.add_declaration ("GDestroyNotify", new 
CCodeVariableDeclarator (func_name));
                                                ccode.add_assignment (new CCodeIdentifier (func_name), new 
CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (block_id)), func_name));
                                        }
@@ -626,15 +626,15 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
 
                                                                var priv_access = new 
CCodeMemberAccess.pointer (new CCodeIdentifier ("self"), "priv");
 
-                                                               param_name = new CCodeIdentifier 
("%s_type".printf (type_param.name.down ()));
+                                                               param_name = new CCodeIdentifier 
("%s_type".printf (type_param.name.ascii_down ()));
                                                                assign = new CCodeAssignment (new 
CCodeMemberAccess.pointer (priv_access, param_name.name), param_name);
                                                                ccode.add_expression (assign);
 
-                                                               param_name = new CCodeIdentifier 
("%s_dup_func".printf (type_param.name.down ()));
+                                                               param_name = new CCodeIdentifier 
("%s_dup_func".printf (type_param.name.ascii_down ()));
                                                                assign = new CCodeAssignment (new 
CCodeMemberAccess.pointer (priv_access, param_name.name), param_name);
                                                                ccode.add_expression (assign);
 
-                                                               param_name = new CCodeIdentifier 
("%s_destroy_func".printf (type_param.name.down ()));
+                                                               param_name = new CCodeIdentifier 
("%s_destroy_func".printf (type_param.name.ascii_down ()));
                                                                assign = new CCodeAssignment (new 
CCodeMemberAccess.pointer (priv_access, param_name.name), param_name);
                                                                ccode.add_expression (assign);
                                                        }
@@ -982,26 +982,26 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                        int type_param_index = 0;
                        var cl = (Class) m.parent_symbol;
                        foreach (TypeParameter type_param in cl.get_type_parameters ()) {
-                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeParameter ("%s_type".printf (type_param.name.down ()), "GType"));
-                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeParameter ("%s_dup_func".printf (type_param.name.down ()), "GBoxedCopyFunc"));
-                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeParameter ("%s_destroy_func".printf (type_param.name.down ()), "GDestroyNotify"));
+                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeParameter ("%s_type".printf (type_param.name.ascii_down ()), "GType"));
+                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeParameter ("%s_dup_func".printf (type_param.name.ascii_down ()), "GBoxedCopyFunc"));
+                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeParameter ("%s_destroy_func".printf (type_param.name.ascii_down ()), "GDestroyNotify"));
                                if (carg_map != null) {
-                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeIdentifier ("%s_type".printf (type_param.name.down ())));
-                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeIdentifier ("%s_dup_func".printf (type_param.name.down ())));
-                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeIdentifier ("%s_destroy_func".printf (type_param.name.down ())));
+                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeIdentifier ("%s_type".printf (type_param.name.ascii_down ())));
+                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeIdentifier ("%s_dup_func".printf (type_param.name.ascii_down ())));
+                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeIdentifier ("%s_destroy_func".printf (type_param.name.ascii_down ())));
                                }
                                type_param_index++;
                        }
                } else if (!m.closure && (direction & 1) == 1) {
                        int type_param_index = 0;
                        foreach (var type_param in m.get_type_parameters ()) {
-                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeParameter ("%s_type".printf (type_param.name.down ()), "GType"));
-                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeParameter ("%s_dup_func".printf (type_param.name.down ()), "GBoxedCopyFunc"));
-                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeParameter ("%s_destroy_func".printf (type_param.name.down ()), "GDestroyNotify"));
+                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeParameter ("%s_type".printf (type_param.name.ascii_down ()), "GType"));
+                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeParameter ("%s_dup_func".printf (type_param.name.ascii_down ()), "GBoxedCopyFunc"));
+                               cparam_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeParameter ("%s_destroy_func".printf (type_param.name.ascii_down ()), "GDestroyNotify"));
                                if (carg_map != null) {
-                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeIdentifier ("%s_type".printf (type_param.name.down ())));
-                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeIdentifier ("%s_dup_func".printf (type_param.name.down ())));
-                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeIdentifier ("%s_destroy_func".printf (type_param.name.down ())));
+                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new 
CCodeIdentifier ("%s_type".printf (type_param.name.ascii_down ())));
+                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.02), new 
CCodeIdentifier ("%s_dup_func".printf (type_param.name.ascii_down ())));
+                                       carg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new 
CCodeIdentifier ("%s_destroy_func".printf (type_param.name.ascii_down ())));
                                }
                                type_param_index++;
                        }
diff --git a/codegen/valagasyncmodule.vala b/codegen/valagasyncmodule.vala
index 36fff60af..8eca2d531 100644
--- a/codegen/valagasyncmodule.vala
+++ b/codegen/valagasyncmodule.vala
@@ -74,9 +74,9 @@ public class Vala.GAsyncModule : GtkModule {
                }
 
                foreach (var type_param in m.get_type_parameters ()) {
-                       data.add_field ("GType", "%s_type".printf (type_param.name.down ()));
-                       data.add_field ("GBoxedCopyFunc", "%s_dup_func".printf (type_param.name.down ()));
-                       data.add_field ("GDestroyNotify", "%s_destroy_func".printf (type_param.name.down ()));
+                       data.add_field ("GType", "%s_type".printf (type_param.name.ascii_down ()));
+                       data.add_field ("GBoxedCopyFunc", "%s_dup_func".printf (type_param.name.ascii_down 
()));
+                       data.add_field ("GDestroyNotify", "%s_destroy_func".printf 
(type_param.name.ascii_down ()));
                }
 
                if (!(m.return_type is VoidType)) {
@@ -362,9 +362,9 @@ public class Vala.GAsyncModule : GtkModule {
                emit_context.pop_symbol ();
 
                foreach (var type_param in m.get_type_parameters ()) {
-                       var type = "%s_type".printf (type_param.name.down ());
-                       var dup_func = "%s_dup_func".printf (type_param.name.down ());
-                       var destroy_func = "%s_destroy_func".printf (type_param.name.down ());
+                       var type = "%s_type".printf (type_param.name.ascii_down ());
+                       var dup_func = "%s_dup_func".printf (type_param.name.ascii_down ());
+                       var destroy_func = "%s_destroy_func".printf (type_param.name.ascii_down ());
                        ccode.add_assignment (new CCodeMemberAccess.pointer (data_var, type), new 
CCodeIdentifier (type));
                        ccode.add_assignment (new CCodeMemberAccess.pointer (data_var, dup_func), new 
CCodeIdentifier (dup_func));
                        ccode.add_assignment (new CCodeMemberAccess.pointer (data_var, destroy_func), new 
CCodeIdentifier (destroy_func));
diff --git a/codegen/valagdbusmodule.vala b/codegen/valagdbusmodule.vala
index c6289ebf1..30e743a89 100644
--- a/codegen/valagdbusmodule.vala
+++ b/codegen/valagdbusmodule.vala
@@ -84,7 +84,7 @@ public class Vala.GDBusModule : GVariantModule {
                foreach (ErrorCode ecode in edomain.get_codes ()) {
                        var ecode_dbus_name = get_dbus_name (ecode);
                        if (ecode_dbus_name == null) {
-                               ecode_dbus_name = Symbol.lower_case_to_camel_case (ecode.name.down ());
+                               ecode_dbus_name = Symbol.lower_case_to_camel_case (ecode.name.ascii_down ());
                        }
 
                        var error_entry = new CCodeInitializerList ();
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index b3bae9660..6562c61b8 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -842,7 +842,7 @@ public class Vala.GIRWriter : CodeVisitor {
        public override void visit_enum_value (EnumValue ev) {
                write_indent ();
                var en = (Enum) hierarchy[0];
-               buffer.append_printf ("<member name=\"%s\" c:identifier=\"%s\"", ev.name.down (), 
get_ccode_name (ev));
+               buffer.append_printf ("<member name=\"%s\" c:identifier=\"%s\"", ev.name.ascii_down (), 
get_ccode_name (ev));
                if (ev.value != null) {
                        string value = literal_expression_to_value_string (ev.value);
                        buffer.append_printf (" value=\"%s\"", value);
@@ -907,7 +907,7 @@ public class Vala.GIRWriter : CodeVisitor {
 
        public override void visit_error_code (ErrorCode ecode) {
                write_indent ();
-               buffer.append_printf ("<member name=\"%s\" c:identifier=\"%s\"", ecode.name.down (), 
get_ccode_name (ecode));
+               buffer.append_printf ("<member name=\"%s\" c:identifier=\"%s\"", ecode.name.ascii_down (), 
get_ccode_name (ecode));
                if (ecode.value != null) {
                        string value = literal_expression_to_value_string (ecode.value);
                        buffer.append_printf (" value=\"%s\"", value);
@@ -1073,9 +1073,9 @@ public class Vala.GIRWriter : CodeVisitor {
        private void write_type_parameter (TypeParameter type_parameter, string tag_type) {
                write_indent ();
                if (tag_type == "property") {
-                       buffer.append_printf ("<%s name=\"%s-type\" writable=\"1\" construct-only=\"1\">\n", 
tag_type, type_parameter.name.down ());
+                       buffer.append_printf ("<%s name=\"%s-type\" writable=\"1\" construct-only=\"1\">\n", 
tag_type, type_parameter.name.ascii_down ());
                } else {
-                       buffer.append_printf ("<%s name=\"%s_type\" transfer-ownership=\"none\">\n", 
tag_type, type_parameter.name.down ());
+                       buffer.append_printf ("<%s name=\"%s_type\" transfer-ownership=\"none\">\n", 
tag_type, type_parameter.name.ascii_down ());
                }
                indent++;
                write_indent ();
@@ -1085,9 +1085,9 @@ public class Vala.GIRWriter : CodeVisitor {
                buffer.append_printf ("</%s>\n", tag_type);
                write_indent ();
                if (tag_type == "property") {
-                       buffer.append_printf ("<%s name=\"%s-dup-func\" writable=\"1\" 
construct-only=\"1\">\n", tag_type, type_parameter.name.down ());
+                       buffer.append_printf ("<%s name=\"%s-dup-func\" writable=\"1\" 
construct-only=\"1\">\n", tag_type, type_parameter.name.ascii_down ());
                } else {
-                       buffer.append_printf ("<%s name=\"%s_dup_func\" transfer-ownership=\"none\">\n", 
tag_type, type_parameter.name.down ());
+                       buffer.append_printf ("<%s name=\"%s_dup_func\" transfer-ownership=\"none\">\n", 
tag_type, type_parameter.name.ascii_down ());
                }
                indent++;
                write_indent ();
@@ -1097,9 +1097,9 @@ public class Vala.GIRWriter : CodeVisitor {
                buffer.append_printf ("</%s>\n", tag_type);
                write_indent ();
                if (tag_type == "property") {
-                       buffer.append_printf ("<%s name=\"%s-destroy-func\" writable=\"1\" 
construct-only=\"1\">\n", tag_type, type_parameter.name.down ());
+                       buffer.append_printf ("<%s name=\"%s-destroy-func\" writable=\"1\" 
construct-only=\"1\">\n", tag_type, type_parameter.name.ascii_down ());
                } else {
-                       buffer.append_printf ("<%s name=\"%s_destroy_func\" transfer-ownership=\"none\">\n", 
tag_type, type_parameter.name.down ());
+                       buffer.append_printf ("<%s name=\"%s_destroy_func\" transfer-ownership=\"none\">\n", 
tag_type, type_parameter.name.ascii_down ());
                }
                indent++;
                write_indent ();
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 10cf04e49..0759a6f63 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -79,7 +79,7 @@ public class Vala.GObjectModule : GTypeModule {
                        CCodeConstant func_name_constant;
                        CCodeFunctionCall cinst, cspec;
 
-                       var name_prefix = type_param.name.down ();
+                       var name_prefix = type_param.name.ascii_down ();
                        var canonical_prefix = name_prefix.replace ("_", "-");
 
                        func_name = "%s_type".printf (name_prefix);
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 6c43090c1..19b0d041f 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -480,13 +480,13 @@ public class Vala.GTypeModule : GErrorModule {
                        foreach (TypeParameter type_param in cl.get_type_parameters ()) {
                                string func_name;
 
-                               func_name = "%s_type".printf (type_param.name.down ());
+                               func_name = "%s_type".printf (type_param.name.ascii_down ());
                                instance_priv_struct.add_field ("GType", func_name);
 
-                               func_name = "%s_dup_func".printf (type_param.name.down ());
+                               func_name = "%s_dup_func".printf (type_param.name.ascii_down ());
                                instance_priv_struct.add_field ("GBoxedCopyFunc", func_name);
 
-                               func_name = "%s_destroy_func".printf (type_param.name.down ());
+                               func_name = "%s_destroy_func".printf (type_param.name.ascii_down ());
                                instance_priv_struct.add_field ("GDestroyNotify", func_name);
                        }
                }
@@ -1431,17 +1431,17 @@ public class Vala.GTypeModule : GErrorModule {
                                GenericType p_type = new GenericType (p);
                                DataType p_data_type = p_type.get_actual_type (get_data_type_for_symbol (cl), 
null, cl);
 
-                               add_generic_accessor_function ("get_%s_type".printf (p.name.down ()),
+                               add_generic_accessor_function ("get_%s_type".printf (p.name.ascii_down ()),
                                                               "GType",
                                                               get_type_id_expression (p_data_type),
                                                               p, cl, iface);
 
-                               add_generic_accessor_function ("get_%s_dup_func".printf (p.name.down ()),
+                               add_generic_accessor_function ("get_%s_dup_func".printf (p.name.ascii_down 
()),
                                                               "GBoxedCopyFunc",
                                                               get_dup_func_expression (p_data_type, null),
                                                               p, cl, iface);
 
-                               add_generic_accessor_function ("get_%s_destroy_func".printf (p.name.down ()),
+                               add_generic_accessor_function ("get_%s_destroy_func".printf 
(p.name.ascii_down ()),
                                                               "GDestroyNotify",
                                                               get_destroy_func_expression (p_data_type),
                                                               p, cl, iface);
@@ -2095,7 +2095,7 @@ public class Vala.GTypeModule : GErrorModule {
 
                if (iface.get_attribute ("GenericAccessors") != null) {
                        foreach (TypeParameter p in iface.get_type_parameters ()) {
-                               string method_name = "get_%s_type".printf (p.name.down ());
+                               string method_name = "get_%s_type".printf (p.name.ascii_down ());
                                var vdeclarator = new CCodeFunctionDeclarator (method_name);
                                var this_type = get_data_type_for_symbol (iface);
                                vdeclarator.add_parameter (new CCodeParameter ("self", get_ccode_name 
(this_type)));
@@ -2104,7 +2104,7 @@ public class Vala.GTypeModule : GErrorModule {
                                vdecl.add_declarator (vdeclarator);
                                type_struct.add_declaration (vdecl);
 
-                               method_name = "get_%s_dup_func".printf (p.name.down ());
+                               method_name = "get_%s_dup_func".printf (p.name.ascii_down ());
                                vdeclarator = new CCodeFunctionDeclarator (method_name);
                                this_type = get_data_type_for_symbol (iface);
                                vdeclarator.add_parameter (new CCodeParameter ("self", get_ccode_name 
(this_type)));
@@ -2113,7 +2113,7 @@ public class Vala.GTypeModule : GErrorModule {
                                vdecl.add_declarator (vdeclarator);
                                type_struct.add_declaration (vdecl);
 
-                               method_name = "get_%s_destroy_func".printf (p.name.down ());
+                               method_name = "get_%s_destroy_func".printf (p.name.ascii_down ());
                                vdeclarator = new CCodeFunctionDeclarator (method_name);
                                this_type = get_data_type_for_symbol (iface);
                                vdeclarator.add_parameter (new CCodeParameter ("self", get_ccode_name 
(this_type)));
diff --git a/libvaladoc/content/sourcecode.vala b/libvaladoc/content/sourcecode.vala
index a9b74b558..a2506b38f 100644
--- a/libvaladoc/content/sourcecode.vala
+++ b/libvaladoc/content/sourcecode.vala
@@ -180,7 +180,7 @@ public class Valadoc.Content.SourceCode : ContentElement, Inline {
                                string path = start.strip ();
                                load_source_code (path, container, file_path, reporter);
                        } else {
-                               string name = start._strip ().down ();
+                               string name = start._strip ().ascii_down ();
                                _language = Language.from_string (name);
                                code = splitted[1] ?? "";
                                if (_language == Language.UNKNOWN && name != "none") {
diff --git a/libvaladoc/ctyperesolver.vala b/libvaladoc/ctyperesolver.vala
index e01785435..22e432b07 100644
--- a/libvaladoc/ctyperesolver.vala
+++ b/libvaladoc/ctyperesolver.vala
@@ -41,7 +41,7 @@ public class Valadoc.CTypeResolver : Visitor {
 
                foreach (string element in elements) {
                        builder.append_c (((char[])element)[0].toupper ());
-                       builder.append (element.next_char ().down ());
+                       builder.append (element.next_char ().ascii_down ());
                }
 
                return (owned) builder.str;
diff --git a/libvaladoc/documentation/gtkdoccommentparser.vala 
b/libvaladoc/documentation/gtkdoccommentparser.vala
index cc8133d9f..48ba0aecf 100644
--- a/libvaladoc/documentation/gtkdoccommentparser.vala
+++ b/libvaladoc/documentation/gtkdoccommentparser.vala
@@ -713,7 +713,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator {
 
                unowned string source = builder.str;
                if (regex_source_lang.match (source, 0, out info)) {
-                       string lang_name = info.fetch (1).down ();
+                       string lang_name = info.fetch (1).ascii_down ();
                        SourceCode.Language? lang = SourceCode.Language.from_string (lang_name);
                        code.language = lang;
 
@@ -1486,7 +1486,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator {
        private Inline create_type_link (string name, bool c_accept_plural = false) {
                if (name == "TRUE" || name == "FALSE" || name == "NULL" || is_numeric (name)) {
                        var monospaced = factory.create_run (Run.Style.MONOSPACED);
-                       monospaced.content.add (factory.create_text (name.down ()));
+                       monospaced.content.add (factory.create_text (name.ascii_down ()));
                        return monospaced;
                } else {
                        Taglets.Link? taglet = factory.create_taglet ("link") as Taglets.Link;
diff --git a/libvaladoc/documentation/gtkdocmarkdownparser.vala 
b/libvaladoc/documentation/gtkdocmarkdownparser.vala
index 206abb7f3..36b1033e3 100644
--- a/libvaladoc/documentation/gtkdocmarkdownparser.vala
+++ b/libvaladoc/documentation/gtkdocmarkdownparser.vala
@@ -123,7 +123,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator {
                        Valadoc.TokenType.MARKDOWN_CONSTANT.action ((token) => {
                                if (is_literal (token.value)) {
                                        var _run = _factory.create_run (Run.Style.LANG_LITERAL);
-                                       _run.content.add (_factory.create_text (token.value.down ()));
+                                       _run.content.add (_factory.create_text (token.value.ascii_down ()));
                                        push (_run);
                                } else {
                                        add_symbol_link ("c::" + token.value, true);
@@ -359,7 +359,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator {
 
                                unowned string source = token.value;
                                if (regex_source_lang.match (source, 0, out info)) {
-                                       string lang_name = info.fetch (1).down ();
+                                       string lang_name = info.fetch (1).ascii_down ();
                                        SourceCode.Language? lang = SourceCode.Language.from_string 
(lang_name);
                                        code.language = lang;
 
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 5f1d10849..46b17fb5b 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -234,7 +234,7 @@ public abstract class Vala.Symbol : CodeNode {
        public static string camel_case_to_lower_case (string camel_case) {
                if ("_" in camel_case) {
                        // do not insert additional underscores if input is not real camel case
-                       return camel_case.down ();
+                       return camel_case.ascii_down ();
                }
 
                var result_builder = new StringBuilder ("");
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 3015b9856..14a470c79 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);
                        }
                }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]