]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: cgen: constify GETT helpers
authorMike Frysinger <vapier@gentoo.org>
Wed, 26 Oct 2022 16:45:13 +0000 (22:30 +0545)
committerMike Frysinger <vapier@gentoo.org>
Mon, 31 Oct 2022 15:39:39 +0000 (21:24 +0545)
These functions only read from memory, so mark the pointer as const.

sim/common/cgen-mem.h

index 873194f3e3e137949cf6160f0807abc9f333d90a..15ba8724b3b0bad46c4f3f6e9551038e6723a698 100644 (file)
@@ -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)); \