[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 1/2] bswap.h: Fix ldl_he_p() signedness
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v3 1/2] bswap.h: Fix ldl_he_p() signedness |
Date: |
Mon, 23 Apr 2018 13:25:22 -0300 |
As per the "Load and Store APIs" documentation (docs/devel/loads-stores.rst),
"No signed load operations are provided."
Update lduw_he_p() to return as unsigned.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/qemu/bswap.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 3f28f661b1..613978f838 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -330,9 +330,9 @@ static inline void stw_he_p(void *ptr, uint16_t v)
memcpy(ptr, &v, sizeof(v));
}
-static inline int ldl_he_p(const void *ptr)
+static inline uint32_t ldl_he_p(const void *ptr)
{
- int32_t r;
+ uint32_t r;
memcpy(&r, ptr, sizeof(r));
return r;
}
--
2.17.0