This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Add two missing consts


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=acaa662f29836ce4d4c3a0abc2132f285f9df585

commit acaa662f29836ce4d4c3a0abc2132f285f9df585
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Mon Sep 21 18:47:33 2015 -0400

    Add two missing consts
    
    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.

Diff:
---
 gdb/ChangeLog         | 5 +++++
 gdb/cli/cli-setshow.c | 2 +-
 gdb/linespec.c        | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 96bf4e0..188bfb2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index ca41d8e..64f09f2 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -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);
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 4c29c12..7a595ed 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -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))
 		    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]