Add two missing consts
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 21 Sep 2015 22:47:33 +0000 (18:47 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 21 Sep 2015 22:47:57 +0000 (18:47 -0400)
Two missing consts, found while doing cxx-conversion work.  We end up
with a char*, even though we pass a const char* to strstr.  I am pushing
this as obvious.

gdb/ChangeLog:

* cli/cli-setshow.c (cmd_show_list): Constify a variable.
* linespec.c (linespec_lexer_lex_string): Same.

gdb/ChangeLog
gdb/cli/cli-setshow.c
gdb/linespec.c

index 96bf4e0c2ec2b7f201b43ef808b2020c418a3ed3..188bfb262c4fa966ab73aa700436d5c6a42fb7d5 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-21  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * cli/cli-setshow.c (cmd_show_list): Constify a variable.
+       * linespec.c (linespec_lexer_lex_string): Same.
+
 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
 
        * NEWS: Mention support for fast tracepoints on aarch64-linux.
index ca41d8e5bb58c2678add4cda66bb7a81780a3191..64f09f21b2509d675f3307e00615e6218e2d06ec 100644 (file)
@@ -683,7 +683,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, const char *prefix)
        {
          struct cleanup *optionlist_chain
            = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist");
-         char *new_prefix = strstr (list->prefixname, "show ") + 5;
+         const char *new_prefix = strstr (list->prefixname, "show ") + 5;
 
          if (ui_out_is_mi_like_p (uiout))
            ui_out_field_string (uiout, "prefix", new_prefix);
index 4c29c124f3d137caf166d949ed9dc08c54c719b2..7a595ed575dcd2941a297a04c7da5ef20e698399 100644 (file)
@@ -669,7 +669,7 @@ linespec_lexer_lex_string (linespec_parser *parser)
                  && (PARSER_STREAM (parser) - start) > 8
                  /* strlen ("operator") */)
                {
-                 char *p = strstr (start, "operator");
+                 const char *p = strstr (start, "operator");
 
                  if (p != NULL && is_operator_name (p))
                    {
This page took 0.029569 seconds and 4 git commands to generate.