Two minor constifications
authorTom Tromey <tromey@adacore.com>
Fri, 10 May 2019 13:17:48 +0000 (07:17 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 10 May 2019 13:17:48 +0000 (07:17 -0600)
I noticed a couple of spots where a "char *" was used where a
"const char *" made more sense.  This patch fixes both of them.
Tested by rebuilding.

gdb/ChangeLog
2019-05-10  Tom Tromey  <tromey@adacore.com>

* thread.c (print_thread_info): Make "requested_threads" const.
* gdbthread.h (print_thread_info): Make "requested_threads"
const.
* ada-tasks.c (print_ada_task_info): Make "taskno_str" const.
* ada-lang.h (print_ada_task_info): Make "taskno_str" const.

gdb/ChangeLog
gdb/ada-lang.h
gdb/ada-tasks.c
gdb/gdbthread.h
gdb/thread.c

index 5b0a9fde61fe6464194e5ae7ed4eaf6b144e041c..82d6206f72670e611b3ccc710ee2749d1dc3e9fc 100644 (file)
@@ -1,3 +1,11 @@
+2019-05-10  Tom Tromey  <tromey@adacore.com>
+
+       * thread.c (print_thread_info): Make "requested_threads" const.
+       * gdbthread.h (print_thread_info): Make "requested_threads"
+       const.
+       * ada-tasks.c (print_ada_task_info): Make "taskno_str" const.
+       * ada-lang.h (print_ada_task_info): Make "taskno_str" const.
+
 2019-05-08  Tom Tromey  <tom@tromey.com>
 
        * gdbtypes.c (objfile_type_data): Change type.
index 8740916a19314d1c6724eee0cc002838ed6e55f6..52d597e04c1e0c91137d15b60a497a6f6b7721df 100644 (file)
@@ -412,7 +412,7 @@ extern void iterate_over_live_ada_tasks
 extern const char *ada_get_tcb_types_info (void);
 
 extern void print_ada_task_info (struct ui_out *uiout,
-                                char *taskno_str,
+                                const char *taskno_str,
                                 struct inferior *inf);
 
 #endif
index 762fb868e755682e9f176096f04f874d1afc69aa..9c07f0ca226fc8924677dc5db77b7fc13af0a804 100644 (file)
@@ -1001,7 +1001,7 @@ ada_build_task_list ()
 
 void
 print_ada_task_info (struct ui_out *uiout,
-                    char *arg_str,
+                    const char *arg_str,
                     struct inferior *inf)
 {
   struct ada_tasks_inferior_data *data;
index b9d8d7fdb181f8ad2d8ddd0f878160291d7201b5..ffd4bf5c822e8b29b303f568a8014f4d4248a059 100644 (file)
@@ -632,7 +632,8 @@ extern int print_thread_events;
    all attached PIDs are printed.  If both REQUESTED_THREADS is not
    NULL and PID is not -1, then the thread is printed if it belongs to
    the specified process.  Otherwise, an error is raised.  */
-extern void print_thread_info (struct ui_out *uiout, char *requested_threads,
+extern void print_thread_info (struct ui_out *uiout,
+                              const char *requested_threads,
                               int pid);
 
 /* Save/restore current inferior/thread/frame.  */
index b6c9b9583e0e1c5f0e3d0295381e189a7af8f87b..9a6a7735950c483bc6b8ca4b815b0cb5869362ca 100644 (file)
@@ -1191,7 +1191,8 @@ No selected thread.  See `help thread'.\n");
 /* See gdbthread.h.  */
 
 void
-print_thread_info (struct ui_out *uiout, char *requested_threads, int pid)
+print_thread_info (struct ui_out *uiout, const char *requested_threads,
+                  int pid)
 {
   print_thread_info_1 (uiout, requested_threads, 1, pid, 0);
 }