From 99e1c1fd5251955080e5c6985fc6204cb069c7af Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Fri, 11 Sep 2015 08:54:51 -0400 Subject: [PATCH] fix warnings --- include/fc/crypto/sha224.hpp | 2 +- include/fc/static_variant.hpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/fc/crypto/sha224.hpp b/include/fc/crypto/sha224.hpp index 66db6ea..a621208 100644 --- a/include/fc/crypto/sha224.hpp +++ b/include/fc/crypto/sha224.hpp @@ -65,7 +65,7 @@ class sha224 friend bool operator >= ( const sha224& h1, const sha224& h2 ); friend bool operator > ( const sha224& h1, const sha224& h2 ); friend bool operator < ( const sha224& h1, const sha224& h2 ); - friend std::size_t hash_value( const sha224& v ) { return ((std::size_t*)v._hash)[1]; } + friend std::size_t hash_value( const sha224& v ) { return uint64_t(v._hash[1])<<32 | v._hash[2]; } uint32_t _hash[7]; }; diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp index a977e58..9aab790 100644 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -284,7 +284,8 @@ public: "Type not in static_variant." ); if(_tag == impl::position::pos) { - return *reinterpret_cast(storage); + void* tmp(storage); + return *reinterpret_cast(tmp); } else { FC_THROW_EXCEPTION( fc::assert_exception, "static_variant does not contain a value of type ${t}", ("t",fc::get_typename::name()) ); // std::string("static_variant does not contain value of type ") + typeid(X).name() @@ -298,7 +299,8 @@ public: "Type not in static_variant." ); if(_tag == impl::position::pos) { - return *reinterpret_cast(storage); + const void* tmp(storage); + return *reinterpret_cast(tmp); } else { FC_THROW_EXCEPTION( fc::assert_exception, "static_variant does not contain a value of type ${t}", ("t",fc::get_typename::name()) ); }