Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-11-18 16:53:27 +0300
committerJunio C Hamano <gitster@pobox.com>2009-11-25 11:16:38 +0300
commitb073b7a990deb1cb3425db45642fa18c8b3cb65c (patch)
tree8e2151608a1b772124490d68454b3dea5fd2088e /compat/bswap.h
parent5d166ccb89faadb7ce5f36d2e33abbd7bb103117 (diff)
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 <benny.kra@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/bswap.h')
-rw-r--r--compat/bswap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/bswap.h b/compat/bswap.h
index 279e0b48b1..f3b8c44181 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; })