]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Mark needle parameter of internal array-contains methods as const
authorTimm Bäder <mail@baedert.org>
Thu, 29 Oct 2015 21:09:57 +0000 (22:09 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 4 Dec 2018 12:20:01 +0000 (13:20 +0100)
This will avoid some -Wdiscarded-qualifiers warnings.

Fixes https://gitlab.gnome.org/GNOME/vala/issues/504

codegen/valaccodebasemodule.vala

index 72ccce4e89c728a590a965375a41f287118e56c9..2bab510f25c4edda95a47ab7fa4d1e8c6bad215f 100644 (file)
@@ -5716,9 +5716,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                function.add_parameter (new CCodeParameter ("stack", "%s *".printf (get_ccode_name (array_type.element_type))));
                function.add_parameter (new CCodeParameter ("stack_length", "int"));
                if (array_type.element_type is StructValueType) {
-                       function.add_parameter (new CCodeParameter ("needle", "%s *".printf (get_ccode_name (array_type.element_type))));
+                       function.add_parameter (new CCodeParameter ("needle", "const %s *".printf (get_ccode_name (array_type.element_type))));
                } else {
-                       function.add_parameter (new CCodeParameter ("needle", get_ccode_name (array_type.element_type)));
+                       function.add_parameter (new CCodeParameter ("needle", "const %s".printf (get_ccode_name (array_type.element_type))));
                }
 
                push_function (function);