public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Constify annotate_source
@ 2019-05-17 16:23 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-05-17 16:23 UTC (permalink / raw)
  To: gdb-cvs

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

commit a45575b0356d671df2c55fcfc66de719b6b2e5e5
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri May 17 08:41:12 2019 -0600

    Constify annotate_source
    
    I noticed that annotate_source takes a "char *", but really should
    take a "const char *".  This patch fixes this.
    
    gdb/ChangeLog
    2019-05-17  Tom Tromey  <tromey@adacore.com>
    
    	* annotate.c (annotate_source): Make "filename" const.
    	* annotate.h (annotate_source): Use const.

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

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8d8a678..146cb00 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-17  Tom Tromey  <tromey@adacore.com>
+
+	* annotate.c (annotate_source): Make "filename" const.
+	* annotate.h (annotate_source): Use const.
+
 2019-05-17  Alan Hayward  <alan.hayward@arm.com>
 
 	* disasm.c (set_disassembler_options): Send errors to stderr.
diff --git a/gdb/annotate.c b/gdb/annotate.c
index 97cb4c8..088f7c9 100644
--- a/gdb/annotate.c
+++ b/gdb/annotate.c
@@ -419,7 +419,7 @@ annotate_arg_end (void)
 }
 
 void
-annotate_source (char *filename, int line, int character, int mid,
+annotate_source (const char *filename, int line, int character, int mid,
 		 struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   if (annotation_level > 1)
diff --git a/gdb/annotate.h b/gdb/annotate.h
index 4a9e1b5..ff10d45 100644
--- a/gdb/annotate.h
+++ b/gdb/annotate.h
@@ -87,7 +87,7 @@ struct annotate_arg_emitter
   DISABLE_COPY_AND_ASSIGN (annotate_arg_emitter);
 };
 
-extern void annotate_source (char *, int, int, int,
+extern void annotate_source (const char *, int, int, int,
 			     struct gdbarch *, CORE_ADDR);
 
 extern void annotate_frame_begin (int, struct gdbarch *, CORE_ADDR);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-17 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17 16:23 [binutils-gdb] Constify annotate_source Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).