diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-02-20 00:28:17 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2014-03-10 22:57:29 -0400 |
commit | 60d847df0b9691b7cb38bfba41b9d6aafd97efc2 (patch) | |
tree | a2fa4e54d1c4bc8a82cdc5fbd65f5958875356cf /sim/sh | |
parent | 61d1ce24e894c08a701efc5794012161ef101a60 (diff) | |
download | gdb-60d847df0b9691b7cb38bfba41b9d6aafd97efc2.zip gdb-60d847df0b9691b7cb38bfba41b9d6aafd97efc2.tar.gz gdb-60d847df0b9691b7cb38bfba41b9d6aafd97efc2.tar.bz2 |
sim: constify arg to sim_do_command
It is rare for people to want to modify the cmd arg. In general, they
really shouldn't be, but a few still do. For those who misbehave, dupe
the string locally so they can bang on it.
Diffstat (limited to 'sim/sh')
-rw-r--r-- | sim/sh/ChangeLog | 5 | ||||
-rw-r--r-- | sim/sh/interp.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index d479841..ac5f954 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,8 @@ +2014-03-10 Mike Frysinger <vapier@gentoo.org> + + * interp.c (parse_and_set_memory_size): Add const to str. + (sim_do_command): Add const to cmd and sms_cmd. + 2014-03-05 Mike Frysinger <vapier@gentoo.org> * interp.c (sim_load): Add const to prog. diff --git a/sim/sh/interp.c b/sim/sh/interp.c index cf6fd8d..c854174 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -473,7 +473,7 @@ int valid[16]; #define UNDEF(x) #endif -static void parse_and_set_memory_size (char *str); +static void parse_and_set_memory_size (const char *str); static int IOMEM (int addr, int write, int value); static struct loop_bounds get_loop_bounds (int, int, unsigned char *, unsigned char *, int, int); @@ -2663,7 +2663,7 @@ sim_open (kind, cb, abfd, argv) static void parse_and_set_memory_size (str) - char *str; + const char *str; { int n; @@ -2739,9 +2739,9 @@ sim_create_inferior (sd, prog_bfd, argv, env) void sim_do_command (sd, cmd) SIM_DESC sd; - char *cmd; + const char *cmd; { - char *sms_cmd = "set-memory-size"; + const char *sms_cmd = "set-memory-size"; int cmdsize; if (cmd == NULL || *cmd == '\0') |