From 60d847df0b9691b7cb38bfba41b9d6aafd97efc2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 20 Feb 2014 00:28:17 -0500 Subject: 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. --- sim/sh/ChangeLog | 5 +++++ sim/sh/interp.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'sim/sh') 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 + + * 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 * 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') -- cgit v1.1