From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64995 invoked by alias); 10 May 2019 13:20:34 -0000 Mailing-List: contact gdb-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: gdb-cvs-owner@sourceware.org List-Subscribe: Sender: gdb-cvs-owner@sourceware.org Received: (qmail 64950 invoked by uid 306); 10 May 2019 13:20:34 -0000 Date: Fri, 10 May 2019 13:20:00 -0000 Message-ID: <20190510132034.64948.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Two minor constifications X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: f3e606a3db56db3ce1ab172511a4ffe9310a496f X-Git-Newrev: 24c54127c5c4da81b9e6c248c8e918b3564b271a X-SW-Source: 2019-05/txt/msg00081.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24c54127c5c4da81b9e6c248c8e918b3564b271a commit 24c54127c5c4da81b9e6c248c8e918b3564b271a Author: Tom Tromey Date: Fri May 10 07:17:48 2019 -0600 Two minor constifications 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 * 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. Diff: --- gdb/ChangeLog | 8 ++++++++ gdb/ada-lang.h | 2 +- gdb/ada-tasks.c | 2 +- gdb/gdbthread.h | 3 ++- gdb/thread.c | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b0a9fd..82d6206 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2019-05-10 Tom Tromey + + * 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 * gdbtypes.c (objfile_type_data): Change type. diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 8740916..52d597e 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -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 diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 762fb86..9c07f0c 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -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; diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index b9d8d7f..ffd4bf5 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -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. */ diff --git a/gdb/thread.c b/gdb/thread.c index b6c9b95..9a6a773 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -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); }