From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36339 invoked by alias); 13 Oct 2017 21:00:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 35817 invoked by uid 89); 13 Oct 2017 21:00:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 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.2 spammy=friends X-HELO: gproxy9-pub.mail.unifiedlayer.com Received: from gproxy9-pub.mail.unifiedlayer.com (HELO gproxy9-pub.mail.unifiedlayer.com) (69.89.20.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Oct 2017 21:00:00 +0000 Received: from cmgw4 (unknown [10.0.90.85]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id 305091E0683 for ; Fri, 13 Oct 2017 14:59:59 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id M8zw1w0042f2jeq018zz6z; Fri, 13 Oct 2017 14:59:59 -0600 X-Authority-Analysis: v=2.2 cv=JNNLi4Cb c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=02M-m0pO-4AA:10 a=zstS-IiYAAAA:8 a=Py-HWUgA_DpxVQGldmMA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 184-96-33-178.hlrn.qwest.net ([184.96.33.178]:58848 helo=bapiya.localdomain) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1e373j-002gg4-VP; Fri, 13 Oct 2017 14:59:56 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 5/8] Constify add_path and friends Date: Fri, 13 Oct 2017 21:00:00 -0000 Message-Id: <20171013205950.22943-6-tom@tromey.com> In-Reply-To: <20171013205950.22943-1-tom@tromey.com> References: <20171013205950.22943-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1e373j-002gg4-VP X-Source-Sender: 184-96-33-178.hlrn.qwest.net (bapiya.localdomain) [184.96.33.178]:58848 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes X-SW-Source: 2017-10/txt/msg00375.txt.bz2 This constifies add_path, mod_path, and directory_switch. gdb/ChangeLog 2017-10-13 Tom Tromey * source.c (directory_switch, mod_path, add_path): Constify. * defs.h (add_path, mod_path, directory_switch): Constify. * mi/mi-cmd-env.c (env_mod_path): Constify. --- gdb/ChangeLog | 6 ++++++ gdb/defs.h | 6 +++--- gdb/mi/mi-cmd-env.c | 4 +--- gdb/source.c | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gdb/defs.h b/gdb/defs.h index cf59602857..675c239af2 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -350,11 +350,11 @@ extern int openp (const char *, int, const char *, int, char **); extern int source_full_path_of (const char *, char **); -extern void mod_path (char *, char **); +extern void mod_path (const char *, char **); -extern void add_path (char *, char **, int); +extern void add_path (const char *, char **, int); -extern void directory_switch (char *, int); +extern void directory_switch (const char *, int); extern char *source_path; diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c index 0d08bb89a9..436462ac5f 100644 --- a/gdb/mi/mi-cmd-env.c +++ b/gdb/mi/mi-cmd-env.c @@ -32,8 +32,6 @@ #include "top.h" #include -static void env_mod_path (char *dirname, char **which_path); - static const char path_var_name[] = "PATH"; static char *orig_path = NULL; @@ -94,7 +92,7 @@ mi_cmd_env_cd (const char *command, char **argv, int argc) } static void -env_mod_path (char *dirname, char **which_path) +env_mod_path (const char *dirname, char **which_path) { if (dirname == 0 || dirname[0] == '\0') return; diff --git a/gdb/source.c b/gdb/source.c index aa672fde45..4ae2ba251b 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -444,7 +444,7 @@ directory_command (char *dirname, int from_tty) This will not be quoted so we must not treat spaces as separators. */ void -directory_switch (char *dirname, int from_tty) +directory_switch (const char *dirname, int from_tty) { add_path (dirname, &source_path, 0); } @@ -452,7 +452,7 @@ directory_switch (char *dirname, int from_tty) /* Add zero or more directories to the front of an arbitrary path. */ void -mod_path (char *dirname, char **which_path) +mod_path (const char *dirname, char **which_path) { add_path (dirname, which_path, 1); } @@ -464,7 +464,7 @@ mod_path (char *dirname, char **which_path) as space or tab. */ void -add_path (char *dirname, char **which_path, int parse_separators) +add_path (const char *dirname, char **which_path, int parse_separators) { char *old = *which_path; int prefix = 0; -- 2.13.6