[trunnel/master] Silence spurious clang implicit 64 to 32 bit truncation warnings in trunnel

commit 8d372beb3fa7c5fc03648e2f60e08ffa6bcf5010 Author: teor <teor2345@gmail.com> Date: Fri Oct 31 08:53:39 2014 -0400 Silence spurious clang implicit 64 to 32 bit truncation warnings in trunnel clang warns that a few implicit casts in trunnel truncate values from 64 to 32 bit. We do explicit casts to silence these warnings. --- lib/trunnel/data/trunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/trunnel/data/trunnel.c b/lib/trunnel/data/trunnel.c index 4bc28e3..4c56449 100644 --- a/lib/trunnel/data/trunnel.c +++ b/lib/trunnel/data/trunnel.c @@ -71,7 +71,8 @@ uint64_t trunnel_htonll(uint64_t a) { #ifdef IS_LITTLE_ENDIAN - return trunnel_htonl(a>>32) | (((uint64_t)trunnel_htonl(a))<<32); + return trunnel_htonl((uint32_t)(a>>32)) + | (((uint64_t)trunnel_htonl((uint32_t)a))<<32); #else return a; #endif
participants (1)
-
nickm@torproject.org