From ed60d3edd51f6c33fb0f3f09400094a1b1c2ceb2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 26 Oct 2022 22:42:10 +0545 Subject: sim: constify various integer readers These functions only read from memory, so mark the pointer as const. --- sim/arm/iwmmxt.c | 2 +- sim/arm/iwmmxt.h | 2 +- sim/arm/wrapper.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sim/arm') diff --git a/sim/arm/iwmmxt.c b/sim/arm/iwmmxt.c index 5f91012..ad06531 100644 --- a/sim/arm/iwmmxt.c +++ b/sim/arm/iwmmxt.c @@ -3723,7 +3723,7 @@ Fetch_Iwmmxt_Register (unsigned int regnum, unsigned char * memory) } int -Store_Iwmmxt_Register (unsigned int regnum, unsigned char * memory) +Store_Iwmmxt_Register (unsigned int regnum, const unsigned char * memory) { if (regnum >= 16) { diff --git a/sim/arm/iwmmxt.h b/sim/arm/iwmmxt.h index e49a8d7..2f677af 100644 --- a/sim/arm/iwmmxt.h +++ b/sim/arm/iwmmxt.h @@ -24,4 +24,4 @@ extern unsigned IwmmxtCDP (ARMul_State *, unsigned, ARMword); extern int ARMul_HandleIwmmxt (ARMul_State *, ARMword); extern int Fetch_Iwmmxt_Register (unsigned int, unsigned char *); -extern int Store_Iwmmxt_Register (unsigned int, unsigned char *); +extern int Store_Iwmmxt_Register (unsigned int, const unsigned char *); diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 38a1f27..72a6524 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -397,7 +397,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED, } static int -frommem (struct ARMul_State *state, unsigned char *memory) +frommem (struct ARMul_State *state, const unsigned char *memory) { if (state->bigendSig == HIGH) return (memory[0] << 24) | (memory[1] << 16) -- cgit v1.1