[vala/0.42] codegen: Mark needle parameter of internal array-contains methods as const
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.42] codegen: Mark needle parameter of internal array-contains methods as const
- Date: Thu, 6 Dec 2018 11:27:34 +0000 (UTC)
commit beeb450ea563d8123522f08f6c15a67240295529
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 72ccce4e8..2bab510f2 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]