Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source fixes for GCC 6 #27

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libaudiofile/modules/SimpleModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct signConverter
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>
{
Expand Down
2 changes: 1 addition & 1 deletion test/FloatToInt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
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)
Expand Down
2 changes: 1 addition & 1 deletion test/IntToFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
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)
Expand Down
14 changes: 7 additions & 7 deletions test/NeXT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@

#include "TestUtilities.h"

const char kDataUnspecifiedLength[] =
const signed char kDataUnspecifiedLength[] =
{
'.', 's', 'n', 'd',
0, 0, 0, 24, // offset of 24 bytes
0xff, 0xff, 0xff, 0xff, // unspecified length
-1, -1, -1, -1, // unspecified length
0, 0, 0, 3, // 16-bit linear
0, 0, 172, 68, // 44100 Hz
0, 0, -84, 68, // 44100 Hz (0xAC44)
0, 0, 0, 1, // 1 channel
0, 1,
0, 1,
Expand All @@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] =
0, 55
};

const char kDataTruncated[] =
const signed char kDataTruncated[] =
{
'.', 's', 'n', 'd',
0, 0, 0, 24, // offset of 24 bytes
0, 0, 0, 20, // length of 20 bytes
0, 0, 0, 3, // 16-bit linear
0, 0, 172, 68, // 44100 Hz
0, 0, -84, 68, // 44100 Hz (0xAC44)
0, 0, 0, 1, // 1 channel
0, 1,
0, 1,
Expand Down Expand Up @@ -152,13 +152,13 @@ TEST(NeXT, Truncated)
ASSERT_EQ(::unlink(testFileName.c_str()), 0);
}

const char kDataZeroChannels[] =
const signed char kDataZeroChannels[] =
{
'.', 's', 'n', 'd',
0, 0, 0, 24, // offset of 24 bytes
0, 0, 0, 2, // 2 bytes
0, 0, 0, 3, // 16-bit linear
0, 0, 172, 68, // 44100 Hz
0, 0, -84, 68, // 44100 Hz (0xAC44)
0, 0, 0, 0, // 0 channels
0, 1
};
Expand Down
2 changes: 1 addition & 1 deletion test/Sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
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;

Expand Down