aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-02-20 00:13:48 -0500
committerMike Frysinger <vapier@gentoo.org>2014-03-05 01:42:44 -0500
commitb2b255bdf3d29d97c10668b4bb5fceeb886a15f1 (patch)
treed4c8c2c2efcfe48f3192592b3845f06e841f9942 /sim/common
parentcfa7ea2a961c0930cfd76006bd3811e98a8f2366 (diff)
downloadfsf-binutils-gdb-b2b255bdf3d29d97c10668b4bb5fceeb886a15f1.zip
fsf-binutils-gdb-b2b255bdf3d29d97c10668b4bb5fceeb886a15f1.tar.gz
fsf-binutils-gdb-b2b255bdf3d29d97c10668b4bb5fceeb886a15f1.tar.bz2
sim: constify prog_name
There's no need for the prog_name handed down to the core to be mutable, so add const markings to it and all the related funcs.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/sim-hload.c2
-rw-r--r--sim/common/sim-load.c2
-rw-r--r--sim/common/sim-utils.c2
-rw-r--r--sim/common/sim-utils.h4
5 files changed, 13 insertions, 5 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 89e37ca..9bf58e2 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,11 @@
+2014-03-05 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-hload.c (sim_load): Add const to prog.
+ * sim-load.c (sim_load_file): Likewise.
+ * sim-utils.c (sim_analyze_program): Likewise.
+ * sim-utils.h (sim_analyze_program): Likewise.
+ (sim_load_file): Likewise.
+
2014-03-04 Mike Frysinger <vapier@gentoo.org>
* acinclude.m4 (build_warnings): Copy from gdb/configure.ac.
diff --git a/sim/common/sim-hload.c b/sim/common/sim-hload.c
index 66a981b..b380ee0 100644
--- a/sim/common/sim-hload.c
+++ b/sim/common/sim-hload.c
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
modeling a hardware platform. */
SIM_RC
-sim_load (SIM_DESC sd, char *prog_name, struct bfd *prog_bfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog_name, struct bfd *prog_bfd, int from_tty)
{
bfd *result_bfd;
diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c
index f077065..7e29f6c 100644
--- a/sim/common/sim-load.c
+++ b/sim/common/sim-load.c
@@ -57,7 +57,7 @@ static void xprintf_bfd_vma (host_callback *, bfd_vma);
bfd *
sim_load_file (SIM_DESC sd, const char *myname, host_callback *callback,
- char *prog, bfd *prog_bfd, int verbose_p, int lma_p,
+ const char *prog, bfd *prog_bfd, int verbose_p, int lma_p,
sim_write_fn do_write)
{
asection *s;
diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c
index 2ec7c7c..64291f0 100644
--- a/sim/common/sim-utils.c
+++ b/sim/common/sim-utils.c
@@ -211,7 +211,7 @@ sim_add_commas (char *buf, int sizeof_buf, unsigned long value)
bfd open. */
SIM_RC
-sim_analyze_program (SIM_DESC sd, char *prog_name, bfd *prog_bfd)
+sim_analyze_program (SIM_DESC sd, const char *prog_name, bfd *prog_bfd)
{
asection *s;
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h
index ddb19ab..30fac1a 100644
--- a/sim/common/sim-utils.h
+++ b/sim/common/sim-utils.h
@@ -45,7 +45,7 @@ unsigned long sim_elapsed_time_since (SIM_ELAPSED_TIME start);
/* Utilities for manipulating the load image. */
-SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
+SIM_RC sim_analyze_program (SIM_DESC sd, const char *prog_name,
struct bfd *prog_bfd);
/* Load program PROG into the simulator using the function DO_LOAD.
@@ -63,7 +63,7 @@ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
typedef int sim_write_fn (SIM_DESC sd, SIM_ADDR mem,
const unsigned char *buf, int length);
struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
- host_callback *callback, char *prog,
+ host_callback *callback, const char *prog,
struct bfd *prog_bfd, int verbose_p,
int lma_p, sim_write_fn do_load);