Commit be422c22 authored by Timm Bäder's avatar Timm Bäder 👎 Committed by Rico Tzschichholz

codegen: Mark needle parameter of internal array-contains methods as const

This will avoid some -Wdiscarded-qualifiers warnings.

Fixes GNOME/vala#504
parent 90a3f9df
......@@ -5747,9 +5747,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment