From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Cc: aburgess@redhat.comy
Subject: [PATCH 1/3] sim: cgen: constify GETT helpers
Date: Wed, 26 Oct 2022 23:01:38 +0545 [thread overview]
Message-ID: <20221026171640.31628-1-vapier@gentoo.org> (raw)
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
next reply other threads:[~2022-10-26 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 17:16 Mike Frysinger [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221026171640.31628-1-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=aburgess@redhat.comy \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).