From 3fdf65248f842c01cb939c4aeb1ab408157fcad0 Mon Sep 17 00:00:00 2001 From: Abit Date: Mon, 9 Jul 2018 22:43:51 +0200 Subject: [PATCH] Fix compiler warnings --- libraries/wallet/include/graphene/wallet/reflect_util.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/wallet/include/graphene/wallet/reflect_util.hpp b/libraries/wallet/include/graphene/wallet/reflect_util.hpp index 6a138e1e10..7a9e6e0812 100644 --- a/libraries/wallet/include/graphene/wallet/reflect_util.hpp +++ b/libraries/wallet/include/graphene/wallet/reflect_util.hpp @@ -61,14 +61,14 @@ struct static_variant_map_visitor template< typename T > result_type operator()( const T& dummy ) { - assert( which == m.which_to_name.size() ); + FC_ASSERT( which == m.which_to_name.size(), "This should not happen" ); std::string name = clean_name( fc::get_typename::name() ); m.name_to_which[ name ] = which; m.which_to_name.push_back( name ); } static_variant_map m; - int which; + uint16_t which; // 16 bit should be practically enough }; template< typename StaticVariant > @@ -107,6 +107,7 @@ static_variant_map create_static_variant_map() { T dummy; int n = dummy.count(); + FC_ASSERT( n <= std::numeric_limits::max(), "Too many items in this static_variant" ); impl::static_variant_map_visitor vtor; for( int i=0; i