[pushed] Add use of const in opencl-lang.c

Tom Tromey tom@tromey.com
Sat Nov 14 16:23:01 GMT 2020


I found another expression-related spot that could use constification.
This patch adds it.  Tested by rebuilding.

gdb/ChangeLog
2020-11-14  Tom Tromey  <tom@tromey.com>

	* opencl-lang.c (opencl_component_ref): Make "comps" const.
---
 gdb/ChangeLog     | 4 ++++
 gdb/opencl-lang.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index 11032b1864e..e04fc546f63 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -327,8 +327,8 @@ create_value (struct gdbarch *gdbarch, struct value *val, enum noside noside,
 /* OpenCL vector component access.  */
 
 static struct value *
-opencl_component_ref (struct expression *exp, struct value *val, char *comps,
-		      enum noside noside)
+opencl_component_ref (struct expression *exp, struct value *val,
+		      const char *comps, enum noside noside)
 {
   LONGEST lowb, highb;
   int src_len;
-- 
2.17.2



More information about the Gdb-patches mailing list