From patchwork Fri May 10 13:18:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32632 Received: (qmail 62038 invoked by alias); 10 May 2019 13:18:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 61994 invoked by uid 89); 10 May 2019 13:18:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:ada_tas, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 May 2019 13:18:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9F5351176CF; Fri, 10 May 2019 09:18:51 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id INsDoYPjRADd; Fri, 10 May 2019 09:18:51 -0400 (EDT) Received: from murgatroyd.Home (97-122-168-123.hlrn.qwest.net [97.122.168.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 4AE4A1176AE; Fri, 10 May 2019 09:18:51 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Two minor constifications Date: Fri, 10 May 2019 07:18:49 -0600 Message-Id: <20190510131849.17679-1-tromey@adacore.com> MIME-Version: 1.0 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. --- 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/ada-lang.h b/gdb/ada-lang.h index 8740916a193..52d597e04c1 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 762fb868e75..9c07f0ca226 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 b9d8d7fdb18..ffd4bf5c822 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 b6c9b9583e0..9a6a7735950 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); }