diff --git a/test/objects/exception.hpp b/test/objects/exception.hpp index 07f343fb..b684d686 100644 --- a/test/objects/exception.hpp +++ b/test/objects/exception.hpp @@ -194,18 +194,19 @@ namespace test { std::size_t hash_impl(object const& x) const { - int result; + unsigned result; switch (tag_) { case 1: - result = x.tag1_; + result = static_cast(x.tag1_); break; case 2: - result = x.tag2_; + result = static_cast(x.tag2_); break; default: - result = x.tag1_ + x.tag2_; + result = + static_cast(x.tag1_) + static_cast(x.tag2_); } - return static_cast(result); + return result; } friend bool operator==(hash const& x1, hash const& x2) diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 7ce21fa9..137c01c8 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -195,34 +195,36 @@ namespace test { std::size_t operator()(object const& x) const { - int result; + unsigned result; switch (type_) { case 1: - result = x.tag1_; + result = static_cast(x.tag1_); break; case 2: - result = x.tag2_; + result = static_cast(x.tag2_); break; default: - result = x.tag1_ + x.tag2_; + result = + static_cast(x.tag1_) + static_cast(x.tag2_); } - return static_cast(result); + return result; } std::size_t operator()(movable const& x) const { - int result; + unsigned result; switch (type_) { case 1: - result = x.tag1_; + result = static_cast(x.tag1_); break; case 2: - result = x.tag2_; + result = static_cast(x.tag2_); break; default: - result = x.tag1_ + x.tag2_; + result = + static_cast(x.tag1_) + static_cast(x.tag2_); } - return static_cast(result); + return result; } std::size_t operator()(int x) const