[1/3] sim: cgen: constify GETT helpers

Message ID 20221026171640.31628-1-vapier@gentoo.org
State Committed
Commit ead2618501e8ba696bf29de635a9a5f6a1ba1b0e
Headers
Series [1/3] sim: cgen: constify GETT helpers |

Commit Message

Mike Frysinger Oct. 26, 2022, 5:16 p.m. UTC
  These functions only read from memory, so mark the pointer as const.
---
 sim/common/cgen-mem.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/sim/common/cgen-mem.h b/sim/common/cgen-mem.h
index 873194f3e3e1..15ba8724b3b0 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)); \