[sw] Fix read32() signature
read32() in memory.h is taking a non-const pointer.
Make read32() in memory.h take a const pointer.
Signed-off-by: Jon Flatley <jflat@google.com>
diff --git a/sw/device/lib/base/memory.c b/sw/device/lib/base/memory.c
index 177cbfa..cf7abab 100644
--- a/sw/device/lib/base/memory.c
+++ b/sw/device/lib/base/memory.c
@@ -4,7 +4,7 @@
#include "sw/device/lib/base/memory.h"
-extern uint32_t read_32(void *);
+extern uint32_t read_32(const void *);
extern void write_32(uint32_t, void *);
void *memcpy(void *restrict dest, const void *restrict src, size_t len) {
diff --git a/sw/device/lib/base/memory.h b/sw/device/lib/base/memory.h
index 4dfcd9f..cf49c36 100644
--- a/sw/device/lib/base/memory.h
+++ b/sw/device/lib/base/memory.h
@@ -31,7 +31,7 @@
* @param ptr a word-aligned pointer pointed to at least four bytes of memory.
* @return the word |ptr| points to.
*/
-inline uint32_t read_32(void *ptr) {
+inline uint32_t read_32(const void *ptr) {
// Both GCC and Clang optimize the code below into a single word-load on most
// platforms. It is necessary and sufficient to indicate to the compiler that
// the pointer points to four bytes of four-byte-aligned memory.