1 http://patchwork.ozlabs.org/patch/630200/
3 From 28cfdbbcb96a69087c3d21faf69b5eae7bcf6d69 Mon Sep 17 00:00:00 2001
4 From: Hodorgasm <nsane457@gmail.com>
5 Date: Wed, 11 May 2016 21:42:07 -0400
6 Subject: [PATCH] Cast to unsigned while left bit-shifting
8 GCC-6 now treats the left bitwise-shift of a negative integer as nonconformant so explicitly cast to an unsigned int while bit-shifting.
10 Downloaded from upstream PR:
11 https://github.com/mpruett/audiofile/pull/28
13 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
15 libaudiofile/modules/SimpleModule.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
18 diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h
19 index 03c6c69..4014fb2 100644
20 --- a/libaudiofile/modules/SimpleModule.h
21 +++ b/libaudiofile/modules/SimpleModule.h
22 @@ -123,7 +123,7 @@ struct signConverter
23 typedef typename IntTypes<Format>::UnsignedType UnsignedType;
25 static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
26 - static const int kMinSignedValue = -1 << kScaleBits;
27 + static const int kMinSignedValue = static_cast<signed>(static_cast<unsigned>(-1) << kScaleBits);;
29 struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>