]> git.pld-linux.org Git - packages/audiofile.git/blob - gcc6.patch
flac rebuild
[packages/audiofile.git] / gcc6.patch
1 Description: Fix FTBFS with GCC 6
2 Author: Michael Schwendt <mschwendt@fedoraproject.org>
3 Origin: vendor, https://github.com/mpruett/audiofile/pull/27
4 Bug-Debian: https://bugs.debian.org/812055
5 ---
6 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
7
8 --- a/libaudiofile/modules/SimpleModule.h
9 +++ b/libaudiofile/modules/SimpleModule.h
10 @@ -123,7 +123,7 @@ struct signConverter
11         typedef typename IntTypes<Format>::UnsignedType UnsignedType;
12  
13         static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
14 -       static const int kMinSignedValue = -1 << kScaleBits;
15 +       static const int kMinSignedValue = 0-(1U<<kScaleBits);
16  
17         struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
18         {
19 --- a/test/FloatToInt.cpp
20 +++ b/test/FloatToInt.cpp
21 @@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
22                 EXPECT_EQ(readData[i], expectedData[i]);
23  }
24  
25 -static const int32_t kMinInt24 = -1<<23;
26 +static const int32_t kMinInt24 = 0-(1U<<23);
27  static const int32_t kMaxInt24 = (1<<23) - 1;
28  
29  TEST_F(FloatToIntTest, Int24)
30 --- a/test/IntToFloat.cpp
31 +++ b/test/IntToFloat.cpp
32 @@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
33                 EXPECT_EQ(readData[i], expectedData[i]);
34  }
35  
36 -static const int32_t kMinInt24 = -1<<23;
37 +static const int32_t kMinInt24 = 0-(1U<<23);
38  static const int32_t kMaxInt24 = (1<<23) - 1;
39  
40  TEST_F(IntToFloatTest, Int24)
41 --- a/test/NeXT.cpp
42 +++ b/test/NeXT.cpp
43 @@ -37,13 +37,13 @@
44  
45  #include "TestUtilities.h"
46  
47 -const char kDataUnspecifiedLength[] =
48 +const signed char kDataUnspecifiedLength[] =
49  {
50         '.', 's', 'n', 'd',
51         0, 0, 0, 24, // offset of 24 bytes
52 -       0xff, 0xff, 0xff, 0xff, // unspecified length
53 +       -1, -1, -1, -1, // unspecified length
54         0, 0, 0, 3, // 16-bit linear
55 -       0, 0, 172, 68, // 44100 Hz
56 +       0, 0, -84, 68, // 44100 Hz (0xAC44)
57         0, 0, 0, 1, // 1 channel
58         0, 1,
59         0, 1,
60 @@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] =
61         0, 55
62  };
63  
64 -const char kDataTruncated[] =
65 +const signed char kDataTruncated[] =
66  {
67         '.', 's', 'n', 'd',
68         0, 0, 0, 24, // offset of 24 bytes
69         0, 0, 0, 20, // length of 20 bytes
70         0, 0, 0, 3, // 16-bit linear
71 -       0, 0, 172, 68, // 44100 Hz
72 +       0, 0, -84, 68, // 44100 Hz (0xAC44)
73         0, 0, 0, 1, // 1 channel
74         0, 1,
75         0, 1,
76 @@ -152,13 +152,13 @@ TEST(NeXT, Truncated)
77         ASSERT_EQ(::unlink(testFileName.c_str()), 0);
78  }
79  
80 -const char kDataZeroChannels[] =
81 +const signed char kDataZeroChannels[] =
82  {
83         '.', 's', 'n', 'd',
84         0, 0, 0, 24, // offset of 24 bytes
85         0, 0, 0, 2, // 2 bytes
86         0, 0, 0, 3, // 16-bit linear
87 -       0, 0, 172, 68, // 44100 Hz
88 +       0, 0, -84, 68, // 44100 Hz (0xAC44)
89         0, 0, 0, 0, // 0 channels
90         0, 1
91  };
92 --- a/test/Sign.cpp
93 +++ b/test/Sign.cpp
94 @@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
95                 EXPECT_EQ(readData[i], expectedData[i]);
96  }
97  
98 -static const int32_t kMinInt24 = -1<<23;
99 +static const int32_t kMinInt24 = 0-(1U<<23);
100  static const int32_t kMaxInt24 = (1<<23) - 1;
101  static const uint32_t kMaxUInt24 = (1<<24) - 1;
102  
This page took 0.071621 seconds and 3 git commands to generate.