From: Mike Frysinger Date: Wed, 26 Oct 2022 16:45:13 +0000 (+0545) Subject: sim: cgen: constify GETT helpers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ead2618501e8ba696bf29de635a9a5f6a1ba1b0e;p=binutils-gdb.git sim: cgen: constify GETT helpers These functions only read from memory, so mark the pointer as const. --- diff --git a/sim/common/cgen-mem.h b/sim/common/cgen-mem.h index 873194f3e3e..15ba8724b3b 100644 --- a/sim/common/cgen-mem.h +++ b/sim/common/cgen-mem.h @@ -181,13 +181,13 @@ DECLARE_SETMEM (DF, 8) /* TAGS: SETMEMDF */ only used when interfacing with the outside world (e.g. gdb). */ #define DECLARE_GETT_EXTERN(mode, size) \ -extern mode XCONCAT2 (GETT,mode) (unsigned char *); +extern mode XCONCAT2 (GETT,mode) (const unsigned char *); #if defined (MEMOPS_DEFINE_INLINE) #define DECLARE_GETT(mode, size) \ DECLARE_GETT_EXTERN (mode, size) \ mode \ -XCONCAT2 (GETT,mode) (unsigned char *p) \ +XCONCAT2 (GETT,mode) (const unsigned char *p) \ { \ mode tmp; \ memcpy (&tmp, p, sizeof (mode)); \