audiofile/audiofile-0.3.6-left-shift-neg.patch
2016-02-04 10:16:55 +01:00

49 lines
2.1 KiB
Diff

diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/libaudiofile/modules/SimpleModule.h audiofile-0.3.6/libaudiofile/modules/SimpleModule.h
--- audiofile-0.3.6-orig/libaudiofile/modules/SimpleModule.h 2013-03-06 06:30:03.000000000 +0100
+++ audiofile-0.3.6/libaudiofile/modules/SimpleModule.h 2016-02-03 21:19:43.065454454 +0100
@@ -123,7 +123,7 @@
typedef typename IntTypes<Format>::UnsignedType UnsignedType;
static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
- static const int kMinSignedValue = -1 << kScaleBits;
+ static const int kMinSignedValue = 0-(1U<<kScaleBits);
struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
{
diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/test/FloatToInt.cpp audiofile-0.3.6/test/FloatToInt.cpp
--- audiofile-0.3.6-orig/test/FloatToInt.cpp 2013-02-11 18:23:26.000000000 +0100
+++ audiofile-0.3.6/test/FloatToInt.cpp 2016-02-03 21:21:14.714510229 +0100
@@ -115,7 +115,7 @@
EXPECT_EQ(readData[i], expectedData[i]);
}
-static const int32_t kMinInt24 = -1<<23;
+static const int32_t kMinInt24 = 0-(1U<<23);
static const int32_t kMaxInt24 = (1<<23) - 1;
TEST_F(FloatToIntTest, Int24)
diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/test/IntToFloat.cpp audiofile-0.3.6/test/IntToFloat.cpp
--- audiofile-0.3.6-orig/test/IntToFloat.cpp 2013-02-11 18:23:26.000000000 +0100
+++ audiofile-0.3.6/test/IntToFloat.cpp 2016-02-03 21:20:57.380445355 +0100
@@ -117,7 +117,7 @@
EXPECT_EQ(readData[i], expectedData[i]);
}
-static const int32_t kMinInt24 = -1<<23;
+static const int32_t kMinInt24 = 0-(1U<<23);
static const int32_t kMaxInt24 = (1<<23) - 1;
TEST_F(IntToFloatTest, Int24)
diff -Nurb --strip-trailing-cr audiofile-0.3.6-orig/test/Sign.cpp audiofile-0.3.6/test/Sign.cpp
--- audiofile-0.3.6-orig/test/Sign.cpp 2013-02-11 18:23:26.000000000 +0100
+++ audiofile-0.3.6/test/Sign.cpp 2016-02-03 21:20:38.742450826 +0100
@@ -116,7 +116,7 @@
EXPECT_EQ(readData[i], expectedData[i]);
}
-static const int32_t kMinInt24 = -1<<23;
+static const int32_t kMinInt24 = 0-(1U<<23);
static const int32_t kMaxInt24 = (1<<23) - 1;
static const uint32_t kMaxUInt24 = (1<<24) - 1;