summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Duncan Ogilvie2024-11-29 01:13:40 +0100
committerGravatar Duncan Ogilvie2024-11-29 01:13:40 +0100
commit3d61170bbb1c69e7f85c33e3771e006491994d39 (patch)
treecb89d15a5c5ddad38f83a87e73445899661f4479
parent6eff9eb548ffa00bd5aa310ed4bddc5ab0ed71cc (diff)
downloadlibplist-3d61170bbb1c69e7f85c33e3771e006491994d39.tar.gz
libplist-3d61170bbb1c69e7f85c33e3771e006491994d39.tar.bz2
Add missing cast in UINT_TO_HOST
-rw-r--r--src/bplist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bplist.c b/src/bplist.c
index e543b63..85e55e2 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -175,7 +175,7 @@ uint16_t get_unaligned_16(uint16_t *ptr)
175static uint64_t UINT_TO_HOST(const void* x, uint8_t n) 175static uint64_t UINT_TO_HOST(const void* x, uint8_t n)
176{ 176{
177 union plist_uint_ptr __up; 177 union plist_uint_ptr __up;
178 __up.src = (n > 8) ? (const char*)x + (n - 8) : x; 178 __up.src = (n > 8) ? (const char*)x + (n - 8) : (const char*)x;
179 return (n >= 8 ? be64toh( get_unaligned_64(__up.u64ptr) ) : 179 return (n >= 8 ? be64toh( get_unaligned_64(__up.u64ptr) ) :
180 (n == 4 ? be32toh( get_unaligned_32(__up.u32ptr) ) : 180 (n == 4 ? be32toh( get_unaligned_32(__up.u32ptr) ) :
181 (n == 2 ? be16toh( get_unaligned_16(__up.u16ptr) ) : 181 (n == 2 ? be16toh( get_unaligned_16(__up.u16ptr) ) :
@@ -187,7 +187,7 @@ static uint64_t UINT_TO_HOST(const void* x, uint8_t n)
187#define UINT_TO_HOST(x, n) \ 187#define UINT_TO_HOST(x, n) \
188 ({ \ 188 ({ \
189 union plist_uint_ptr __up; \ 189 union plist_uint_ptr __up; \
190 __up.src = ((n) > 8) ? (const char*)(x) + ((n) - 8) : (x); \ 190 __up.src = ((n) > 8) ? (const char*)(x) + ((n) - 8) : (const char*)(x); \
191 ((n) >= 8 ? be64toh( get_unaligned(__up.u64ptr) ) : \ 191 ((n) >= 8 ? be64toh( get_unaligned(__up.u64ptr) ) : \
192 ((n) == 4 ? be32toh( get_unaligned(__up.u32ptr) ) : \ 192 ((n) == 4 ? be32toh( get_unaligned(__up.u32ptr) ) : \
193 ((n) == 2 ? be16toh( get_unaligned(__up.u16ptr) ) : \ 193 ((n) == 2 ? be16toh( get_unaligned(__up.u16ptr) ) : \