From b073b7a990deb1cb3425db45642fa18c8b3cb65c Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 18 Nov 2009 14:53:27 +0100 Subject: [PATCH] Explicitly truncate bswap operand to uint32_t There are some places in git where a long is passed to htonl/ntohl. llvm doesn't support matching operands of different bitwidths intentionally. This patch fixes the build with llvm-gcc (and clang) on x86_64. Signed-off-by: Benjamin Kramer Signed-off-by: Junio C Hamano --- compat/bswap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/bswap.h b/compat/bswap.h index 279e0b48b..f3b8c4418 100644 --- a/compat/bswap.h +++ b/compat/bswap.h @@ -24,7 +24,7 @@ static inline uint32_t default_swab32(uint32_t val) if (__builtin_constant_p(x)) { \ __res = default_swab32(x); \ } else { \ - __asm__("bswap %0" : "=r" (__res) : "0" (x)); \ + __asm__("bswap %0" : "=r" (__res) : "0" ((uint32_t)(x))); \ } \ __res; }) -- 2.30.2