From 42c5474ffec0d14801a7ba3299b38e2d8592f139 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 20 Apr 2009 19:34:41 +0200 Subject: [PATCH] bytevector: Add proper cast. * src/bytevector.c (GENERIC_INTEGER_SET): Add correct cast of C_VALUE. This fixes a sign mismatch issue identified by GCC 4.3.1 on `sparc64-unknown-linux-gnu'. --- src/bytevector.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bytevector.c b/src/bytevector.c index d260f50..9d449aa 100644 --- a/src/bytevector.c +++ b/src/bytevector.c @@ -831,8 +831,11 @@ bytevector_unsigned_ref (const char *c_bv, size_t c_size, SCM endianness) \ swap = !scm_is_eq (endianness, native_endianness); \ \ - c_value16 = \ - swap ? bswap_16 (c_value) : c_value; \ + if (swap) \ + c_value16 = (INT_TYPE (16, _sign)) bswap_16 (c_value); \ + else \ + c_value16 = c_value; \ + \ memcpy (c_bv, &c_value16, 2); \ } \ else \ -- 2.11.4.GIT