Skip to content

Commit

Permalink
cast unsigned vals back to signed to fix compiler warnings
Browse files Browse the repository at this point in the history
chuckremes committed Mar 24, 2016
1 parent 8884d8b commit 8374329
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions machine/test/test_bignum.hpp
Original file line number Diff line number Diff line change
@@ -648,7 +648,7 @@ class TestBignum : public CxxTest::TestSuite, public VMTest {
fix = neg_one->left_shift(state, width_minus1);

TS_ASSERT(kind_of<Fixnum>(fix));
TS_ASSERT_EQUALS((0UL - 1L) << (FIXNUM_WIDTH-1), fix->to_native());
TS_ASSERT_EQUALS((native_int)(0UL - 1L) << (FIXNUM_WIDTH-1), fix->to_native());

Integer* max_plus1 = one->left_shift(state, width);

@@ -676,7 +676,7 @@ class TestBignum : public CxxTest::TestSuite, public VMTest {
fix = neg_one->right_shift(state, neg_width_minus1);

TS_ASSERT(kind_of<Fixnum>(fix));
TS_ASSERT_EQUALS((0UL - 1L) << (FIXNUM_WIDTH-1), fix->to_native());
TS_ASSERT_EQUALS((native_int)(0UL - 1L) << (FIXNUM_WIDTH-1), fix->to_native());

Integer* max_plus1 = one->right_shift(state, neg_width);

@@ -704,7 +704,7 @@ class TestBignum : public CxxTest::TestSuite, public VMTest {
fix = as<Integer>(neg_two->pow(state, width_minus1));

TS_ASSERT(kind_of<Fixnum>(fix));
TS_ASSERT_EQUALS((0UL - 1L) << (FIXNUM_WIDTH-1), fix->to_native());
TS_ASSERT_EQUALS((native_int)(0UL - 1L) << (FIXNUM_WIDTH-1), fix->to_native());

Integer* max_plus1 = as<Integer>(two->pow(state, width));

@@ -719,7 +719,7 @@ class TestBignum : public CxxTest::TestSuite, public VMTest {
big = as<Integer>(neg_two->pow(state, Fixnum::from(FIXNUM_WIDTH+1)));

TS_ASSERT(kind_of<Bignum>(big));
TS_ASSERT_EQUALS((0ULL - 1LL) << (FIXNUM_WIDTH+1), as<Bignum>(big)->to_long_long());
TS_ASSERT_EQUALS((long long)(0ULL - 1LL) << (FIXNUM_WIDTH+1), as<Bignum>(big)->to_long_long());
}

void test_equal() {

0 comments on commit 8374329

Please sign in to comment.