public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] sim: cgen: constify GETT helpers
@ 2022-10-26 17:16 Mike Frysinger
  2022-10-26 17:16 ` [PATCH 2/3] sim: constify various integer readers Mike Frysinger
  2022-10-26 17:16 ` [PATCH 3/3] sim: reg: constify store helper Mike Frysinger
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Frysinger @ 2022-10-26 17:16 UTC (permalink / raw)
  To: gdb-patches; +Cc: aburgess

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(-)

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)); \
-- 
2.37.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-26 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 17:16 [PATCH 1/3] sim: cgen: constify GETT helpers Mike Frysinger
2022-10-26 17:16 ` [PATCH 2/3] sim: constify various integer readers Mike Frysinger
2022-10-26 17:16 ` [PATCH 3/3] sim: reg: constify store helper Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).