From af52f0420a27f88174ad87c6a0f2cfb7cb426ad9 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 20 Apr 2017 11:33:54 +0200 Subject: bplist: Suppress compiler warnings with proper casts --- src/bplist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bplist.c b/src/bplist.c index 8e0dcd1..fe80458 100644 --- a/src/bplist.c +++ b/src/bplist.c @@ -183,7 +183,7 @@ union plist_uint_ptr #endif #if __has_builtin(__builtin_umulll_overflow) || __GNUC__ >= 5 -#define uint64_mul_overflow(a, b, r) __builtin_umulll_overflow(a, b, r) +#define uint64_mul_overflow(a, b, r) __builtin_umulll_overflow(a, b, (unsigned long long*)r) #else static int uint64_mul_overflow(uint64_t a, uint64_t b, uint64_t *res) { @@ -575,7 +575,7 @@ static plist_t parse_bin_node(struct bplist_data *bplist, const char** object) uint16_t type = 0; uint64_t size = 0; uint64_t pobject = 0; - uint64_t poffset_table = (uint64_t)bplist->offset_table; + uint64_t poffset_table = (uint64_t)(uintptr_t)bplist->offset_table; if (!object) return NULL; @@ -613,7 +613,7 @@ static plist_t parse_bin_node(struct bplist_data *bplist, const char** object) } } - pobject = (uint64_t)*object; + pobject = (uint64_t)(uintptr_t)*object; switch (type) { -- cgit v1.1-32-gdbae