Constify add_path and friends
This constifies add_path, mod_path, and directory_switch. gdb/ChangeLog 2017-11-07 Tom Tromey <tom@tromey.com> * 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.
This commit is contained in:
parent
6be9a197d9
commit
5614fb7720
|
@ -1,3 +1,9 @@
|
||||||
|
2017-11-07 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2017-11-07 Tom Tromey <tom@tromey.com>
|
2017-11-07 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* infcmd.c (strip_bg_char): Return gdb::unique_xmalloc_ptr.
|
* infcmd.c (strip_bg_char): Return gdb::unique_xmalloc_ptr.
|
||||||
|
|
|
@ -350,11 +350,11 @@ extern int openp (const char *, int, const char *, int, char **);
|
||||||
|
|
||||||
extern int source_full_path_of (const char *, 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;
|
extern char *source_path;
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
#include "top.h"
|
#include "top.h"
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
static void env_mod_path (char *dirname, char **which_path);
|
|
||||||
|
|
||||||
static const char path_var_name[] = "PATH";
|
static const char path_var_name[] = "PATH";
|
||||||
static char *orig_path = NULL;
|
static char *orig_path = NULL;
|
||||||
|
|
||||||
|
@ -94,7 +92,7 @@ mi_cmd_env_cd (const char *command, char **argv, int argc)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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')
|
if (dirname == 0 || dirname[0] == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -444,7 +444,7 @@ directory_command (char *dirname, int from_tty)
|
||||||
This will not be quoted so we must not treat spaces as separators. */
|
This will not be quoted so we must not treat spaces as separators. */
|
||||||
|
|
||||||
void
|
void
|
||||||
directory_switch (char *dirname, int from_tty)
|
directory_switch (const char *dirname, int from_tty)
|
||||||
{
|
{
|
||||||
add_path (dirname, &source_path, 0);
|
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. */
|
/* Add zero or more directories to the front of an arbitrary path. */
|
||||||
|
|
||||||
void
|
void
|
||||||
mod_path (char *dirname, char **which_path)
|
mod_path (const char *dirname, char **which_path)
|
||||||
{
|
{
|
||||||
add_path (dirname, which_path, 1);
|
add_path (dirname, which_path, 1);
|
||||||
}
|
}
|
||||||
|
@ -464,7 +464,7 @@ mod_path (char *dirname, char **which_path)
|
||||||
as space or tab. */
|
as space or tab. */
|
||||||
|
|
||||||
void
|
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;
|
char *old = *which_path;
|
||||||
int prefix = 0;
|
int prefix = 0;
|
||||||
|
|
Loading…
Reference in New Issue