[vala/0.40] codegen: Mark needle parameter of internal array-contains methods as const



commit 8af41e4a555dcc420bb52f4371cd570c0599b684
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 29 22:09:57 2015 +0100

    codegen: Mark needle parameter of internal array-contains methods as const
    
    This will avoid some -Wdiscarded-qualifiers warnings.
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/504

 codegen/valaccodebasemodule.vala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 169b78e23..1b4003bc6 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5610,9 +5610,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);


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