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