mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
sim: cgen: constify GETT helpers
These functions only read from memory, so mark the pointer as const.
This commit is contained in:
@ -181,13 +181,13 @@ DECLARE_SETMEM (DF, 8) /* TAGS: SETMEMDF */
|
|||||||
only used when interfacing with the outside world (e.g. gdb). */
|
only used when interfacing with the outside world (e.g. gdb). */
|
||||||
|
|
||||||
#define DECLARE_GETT_EXTERN(mode, size) \
|
#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)
|
#if defined (MEMOPS_DEFINE_INLINE)
|
||||||
#define DECLARE_GETT(mode, size) \
|
#define DECLARE_GETT(mode, size) \
|
||||||
DECLARE_GETT_EXTERN (mode, size) \
|
DECLARE_GETT_EXTERN (mode, size) \
|
||||||
mode \
|
mode \
|
||||||
XCONCAT2 (GETT,mode) (unsigned char *p) \
|
XCONCAT2 (GETT,mode) (const unsigned char *p) \
|
||||||
{ \
|
{ \
|
||||||
mode tmp; \
|
mode tmp; \
|
||||||
memcpy (&tmp, p, sizeof (mode)); \
|
memcpy (&tmp, p, sizeof (mode)); \
|
||||||
|
Reference in New Issue
Block a user