01_gcc6.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. --- a/libaudiofile/modules/SimpleModule.h
  8. +++ b/libaudiofile/modules/SimpleModule.h
  9. @@ -123,7 +123,7 @@ struct signConverter
  10. typedef typename IntTypes<Format>::UnsignedType UnsignedType;
  11. static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
  12. - static const int kMinSignedValue = -1 << kScaleBits;
  13. + static const int kMinSignedValue = 0-(1U<<kScaleBits);
  14. struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
  15. {
  16. --- a/test/FloatToInt.cpp
  17. +++ b/test/FloatToInt.cpp
  18. @@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
  19. EXPECT_EQ(readData[i], expectedData[i]);
  20. }
  21. -static const int32_t kMinInt24 = -1<<23;
  22. +static const int32_t kMinInt24 = 0-(1U<<23);
  23. static const int32_t kMaxInt24 = (1<<23) - 1;
  24. TEST_F(FloatToIntTest, Int24)
  25. --- a/test/IntToFloat.cpp
  26. +++ b/test/IntToFloat.cpp
  27. @@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
  28. EXPECT_EQ(readData[i], expectedData[i]);
  29. }
  30. -static const int32_t kMinInt24 = -1<<23;
  31. +static const int32_t kMinInt24 = 0-(1U<<23);
  32. static const int32_t kMaxInt24 = (1<<23) - 1;
  33. TEST_F(IntToFloatTest, Int24)
  34. --- a/test/NeXT.cpp
  35. +++ b/test/NeXT.cpp
  36. @@ -37,13 +37,13 @@
  37. #include "TestUtilities.h"
  38. -const char kDataUnspecifiedLength[] =
  39. +const signed char kDataUnspecifiedLength[] =
  40. {
  41. '.', 's', 'n', 'd',
  42. 0, 0, 0, 24, // offset of 24 bytes
  43. - 0xff, 0xff, 0xff, 0xff, // unspecified length
  44. + -1, -1, -1, -1, // unspecified length
  45. 0, 0, 0, 3, // 16-bit linear
  46. - 0, 0, 172, 68, // 44100 Hz
  47. + 0, 0, -84, 68, // 44100 Hz (0xAC44)
  48. 0, 0, 0, 1, // 1 channel
  49. 0, 1,
  50. 0, 1,
  51. @@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] =
  52. 0, 55
  53. };
  54. -const char kDataTruncated[] =
  55. +const signed char kDataTruncated[] =
  56. {
  57. '.', 's', 'n', 'd',
  58. 0, 0, 0, 24, // offset of 24 bytes
  59. 0, 0, 0, 20, // length of 20 bytes
  60. 0, 0, 0, 3, // 16-bit linear
  61. - 0, 0, 172, 68, // 44100 Hz
  62. + 0, 0, -84, 68, // 44100 Hz (0xAC44)
  63. 0, 0, 0, 1, // 1 channel
  64. 0, 1,
  65. 0, 1,
  66. @@ -152,13 +152,13 @@ TEST(NeXT, Truncated)
  67. ASSERT_EQ(::unlink(testFileName.c_str()), 0);
  68. }
  69. -const char kDataZeroChannels[] =
  70. +const signed char kDataZeroChannels[] =
  71. {
  72. '.', 's', 'n', 'd',
  73. 0, 0, 0, 24, // offset of 24 bytes
  74. 0, 0, 0, 2, // 2 bytes
  75. 0, 0, 0, 3, // 16-bit linear
  76. - 0, 0, 172, 68, // 44100 Hz
  77. + 0, 0, -84, 68, // 44100 Hz (0xAC44)
  78. 0, 0, 0, 0, // 0 channels
  79. 0, 1
  80. };
  81. --- a/test/Sign.cpp
  82. +++ b/test/Sign.cpp
  83. @@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
  84. EXPECT_EQ(readData[i], expectedData[i]);
  85. }
  86. -static const int32_t kMinInt24 = -1<<23;
  87. +static const int32_t kMinInt24 = 0-(1U<<23);
  88. static const int32_t kMaxInt24 = (1<<23) - 1;
  89. static const uint32_t kMaxUInt24 = (1<<24) - 1;