From 5bab16fdf1775c8abd16376458c5843fbe1d4314 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 26 Oct 2022 23:01:21 +0545 Subject: sim: reg: constify store helper These functions only read from memory, so mark the pointer as const. --- sim/mn10300/interp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sim/mn10300') diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 2e7fd16..020fd04 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -80,7 +80,7 @@ mn10300_pc_set (sim_cpu *cpu, sim_cia pc) } static int mn10300_reg_fetch (SIM_CPU *, int, unsigned char *, int); -static int mn10300_reg_store (SIM_CPU *, int, unsigned char *, int); +static int mn10300_reg_store (SIM_CPU *, int, const unsigned char *, int); /* These default values correspond to expected usage for the chip. */ @@ -344,9 +344,9 @@ mn10300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length) } static int -mn10300_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length) +mn10300_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length) { - uint8_t *a = memory; + const uint8_t *a = memory; State.regs[rn] = (a[3] << 24) + (a[2] << 16) + (a[1] << 8) + a[0]; return length; } -- cgit v1.1