diff --git a/src/FSize.h b/src/FSize.h index b30a7aff5..7d9e7109a 100644 --- a/src/FSize.h +++ b/src/FSize.h @@ -146,6 +146,7 @@ class FSize : * - 1.66 - returns just the lower bits **/ explicit operator long long() const { return static_cast(_size); } + explicit operator unsigned long long() const { return static_cast(_size); } explicit operator int() const { return static_cast(_size); } explicit operator double() const { return static_cast(_size); } diff --git a/tests/FSize_test.cc b/tests/FSize_test.cc index 2c28e1920..d714b3e1b 100644 --- a/tests/FSize_test.cc +++ b/tests/FSize_test.cc @@ -177,9 +177,9 @@ BOOST_AUTO_TEST_CASE( comparing_with_limits ) FSize fsize(cpp_int(1) << 1024); // even bigger than the max long long - BOOST_CHECK(fsize > std::numeric_limits::max()); + BOOST_CHECK((long long)fsize > std::numeric_limits::max()); // even bigger than the max unsigned long long - BOOST_CHECK(fsize > std::numeric_limits::max()); + BOOST_CHECK((unsigned long long)fsize > std::numeric_limits::max()); // even bigger than the max double BOOST_CHECK(fsize > std::numeric_limits::max());