This is the mail archive of the gdb-patches@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]

[PATCH 2/5] constify to_terminal_info


This constifies the to_terminal_info method.

I could not test all of it (e.g., go32-nat.c) but I did look by hand
and it all seems fine.  I'd appreciate it if someone with access to
the proper machines either built this or looked at it.

	* go32-nat.c (go32_terminal_info): Make 'args' const.
	* inferior.h (child_terminal_info): Update.
	* inflow.c (child_terminal_info): Make 'args' const.
	* target.c (default_terminal_info): Make 'args' const.
	(debug_to_terminal_save_ours): Likewise.
	* target.h (struct target_ops) <to_terminal_info>: Make argument
	const.
---
 gdb/go32-nat.c | 2 +-
 gdb/inferior.h | 2 +-
 gdb/inflow.c   | 2 +-
 gdb/target.c   | 8 +++-----
 gdb/target.h   | 2 +-
 5 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index ea6d1ca..0d9bb9d 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -876,7 +876,7 @@ go32_terminal_init (void)
 }
 
 static void
-go32_terminal_info (char *args, int from_tty)
+go32_terminal_info (const char *args, int from_tty)
 {
   printf_unfiltered ("Inferior's terminal is in %s mode.\n",
 		     !inf_mode_valid
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 196d033..2a5770d 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -175,7 +175,7 @@ extern void default_print_registers_info (struct gdbarch *gdbarch,
 					  struct frame_info *frame,
 					  int regnum, int all);
 
-extern void child_terminal_info (char *, int);
+extern void child_terminal_info (const char *, int);
 
 extern void term_info (char *, int);
 
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 5146b3a..79a99d1 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -563,7 +563,7 @@ term_info (char *arg, int from_tty)
 }
 
 void
-child_terminal_info (char *args, int from_tty)
+child_terminal_info (const char *args, int from_tty)
 {
   struct inferior *inf;
   struct terminal_info *tinfo;
diff --git a/gdb/target.c b/gdb/target.c
index 8eadd63..1c0134f 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -46,7 +46,7 @@
 
 static void target_info (char *, int);
 
-static void default_terminal_info (char *, int);
+static void default_terminal_info (const char *, int);
 
 static int default_watchpoint_addr_within_range (struct target_ops *,
 						 CORE_ADDR, CORE_ADDR, int);
@@ -142,8 +142,6 @@ static void debug_to_terminal_save_ours (void);
 
 static void debug_to_terminal_ours (void);
 
-static void debug_to_terminal_info (char *, int);
-
 static void debug_to_load (char *, int);
 
 static int debug_to_can_run (void);
@@ -557,7 +555,7 @@ noprocess (void)
 }
 
 static void
-default_terminal_info (char *args, int from_tty)
+default_terminal_info (const char *args, int from_tty)
 {
   printf_unfiltered (_("No saved terminal information.\n"));
 }
@@ -4787,7 +4785,7 @@ debug_to_terminal_save_ours (void)
 }
 
 static void
-debug_to_terminal_info (char *arg, int from_tty)
+debug_to_terminal_info (const char *arg, int from_tty)
 {
   debug_target.to_terminal_info (arg, from_tty);
 
diff --git a/gdb/target.h b/gdb/target.h
index 54cbf99..ed518c4 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -497,7 +497,7 @@ struct target_ops
     void (*to_terminal_ours_for_output) (void);
     void (*to_terminal_ours) (void);
     void (*to_terminal_save_ours) (void);
-    void (*to_terminal_info) (char *, int);
+    void (*to_terminal_info) (const char *, int);
     void (*to_kill) (struct target_ops *);
     void (*to_load) (char *, int);
     void (*to_create_inferior) (struct target_ops *, 
-- 
1.8.1.4


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