# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/audiofile/hotfix-clang.patch # Copyright (C) 2025 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- audiofile-0.3.6/test/FloatToInt.cpp.vanilla +++ audiofile-0.3.6/test/FloatToInt.cpp @@ -115,7 +115,7 @@ EXPECT_EQ(readData[i], expectedData[i]); } -static const int32_t kMinInt24 = -1<<23; +static const int32_t kMinInt24 = ~0u<<23; static const int32_t kMaxInt24 = (1<<23) - 1; TEST_F(FloatToIntTest, Int24) --- audiofile-0.3.6/test/IntToFloat.cpp.vanilla 2024-12-27 23:18:05.806038400 +0100 +++ audiofile-0.3.6/test/IntToFloat.cpp 2024-12-27 23:18:26.162704438 +0100 @@ -117,7 +117,7 @@ EXPECT_EQ(readData[i], expectedData[i]); } -static const int32_t kMinInt24 = -1<<23; +static const int32_t kMinInt24 = ~0u<<23; static const int32_t kMaxInt24 = (1<<23) - 1; TEST_F(IntToFloatTest, Int24) --- audiofile-0.3.6/test/NeXT.cpp.vanilla 2024-12-27 23:18:37.309370755 +0100 +++ audiofile-0.3.6/test/NeXT.cpp 2024-12-27 23:20:15.839367711 +0100 @@ -37,7 +37,7 @@ #include "TestUtilities.h" -const char kDataUnspecifiedLength[] = +const unsigned char kDataUnspecifiedLength[] = { '.', 's', 'n', 'd', 0, 0, 0, 24, // offset of 24 bytes @@ -57,7 +57,7 @@ 0, 55 }; -const char kDataTruncated[] = +const unsigned char kDataTruncated[] = { '.', 's', 'n', 'd', 0, 0, 0, 24, // offset of 24 bytes @@ -152,7 +152,7 @@ ASSERT_EQ(::unlink(testFileName.c_str()), 0); } -const char kDataZeroChannels[] = +const unsigned char kDataZeroChannels[] = { '.', 's', 'n', 'd', 0, 0, 0, 24, // offset of 24 bytes --- audiofile-0.3.6/test/Sign.cpp.vanilla 2024-12-27 23:20:22.092700858 +0100 +++ audiofile-0.3.6/test/Sign.cpp 2024-12-27 23:22:29.042696960 +0100 @@ -116,7 +116,7 @@ EXPECT_EQ(readData[i], expectedData[i]); } -static const int32_t kMinInt24 = -1<<23; +static const int32_t kMinInt24 = ~0u<<23; static const int32_t kMaxInt24 = (1<<23) - 1; static const uint32_t kMaxUInt24 = (1<<24) - 1; @@ -157,7 +157,7 @@ AFframecount framesRead = afReadFrames(file, AF_DEFAULT_TRACK, readData, frameCount); ASSERT_EQ(framesRead, frameCount); afCloseFile(file); - const uint32_t expectedData[] = { 0, -kMinInt32, kMaxUInt32 }; + const uint32_t expectedData[] = { 0, -static_cast(-kMinInt32), kMaxUInt32 }; for (int i=0; i::UnsignedType UnsignedType; static const int kScaleBits = (Format + 1) * CHAR_BIT - 1; - static const int kMinSignedValue = -1 << kScaleBits; + static const int kMinSignedValue = ~0u << kScaleBits; struct signedToUnsigned : public std::unary_function {