Skip to contentSkip to conversation

Don't discard "const" in ldq_le_p()

PATCH New Hollis Blanchard 1 participant 1 message Dec 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't discard "const" in ldq_le_p()

This fixes warnings like the following, which are repeated once for every file including cpu-all.h (and there many of them).

In file included from /home/hollisb/source/qemu.git/target-ppc/cpu.h:801,

                 from /home/hollisb/source/qemu.git/qemu-common.h:74,
                 from /home/hollisb/source/qemu.git/hw/hw.h:5,
                 from /home/hollisb/source/qemu.git/vl.c:24:

qemu.git/cpu-all.h: In function `ldq_le_p':
qemu.git/cpu-all.h:268: warning: initialization discards qualifiers from pointer target type

---
 cpu-all.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cpu-all.h +1 -1
index 7102014..fdeef0a 100644
@@ -265,7 +265,7 @@ static inline int ldl_le_p(const void *ptr)
 
 static inline uint64_t ldq_le_p(const void *ptr)
 {
-    uint8_t *p = ptr;
+    const uint8_t *p = ptr;
     uint32_t v1, v2;
     v1 = ldl_le_p(p);
     v2 = ldl_le_p(p + 4);
Signature · 1 line
1.5.6.5