diff mbox

[FYI,1/2] Constify annotate_source

Message ID 20190517162242.27738-2-tromey@adacore.com
State New
Headers show

Commit Message

Tom Tromey May 17, 2019, 4:22 p.m. UTC
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.
---
 gdb/ChangeLog  | 5 +++++
 gdb/annotate.c | 2 +-
 gdb/annotate.h | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/gdb/annotate.c b/gdb/annotate.c
index 97cb4c8855d..088f7c957df 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 4a9e1b58f28..ff10d459465 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);