More fixes

Fix errors and warnings and generally coax it to build
This commit is contained in:
Nathan Hourt 2020-08-21 15:23:12 -05:00
parent a31e56f531
commit b8c3e63f1b
No known key found for this signature in database
GPG key ID: B4344309A110851E
5 changed files with 21 additions and 21 deletions

View file

@ -374,7 +374,7 @@ private:
// return true if any of my_accounts are players in this tournament // return true if any of my_accounts are players in this tournament
bool tournament_is_relevant_to_my_accounts(const tournament_object& tournament_obj) bool tournament_is_relevant_to_my_accounts(const tournament_object& tournament_obj)
{ {
tournament_details_object tournament_details = get_object<tournament_details_object>(tournament_obj.tournament_details_id); tournament_details_object tournament_details = get_object(tournament_obj.tournament_details_id);
for (const account_object& account_obj : _wallet.my_accounts) for (const account_object& account_obj : _wallet.my_accounts)
if (tournament_details.registered_players.find(account_obj.id) != tournament_details.registered_players.end()) if (tournament_details.registered_players.find(account_obj.id) != tournament_details.registered_players.end())
return true; return true;
@ -967,7 +967,7 @@ public:
("match", match_obj.id)("account", get_account(account_id).name)); ("match", match_obj.id)("account", get_account(account_id).name));
for (const game_id_type& game_id : match_obj.games) for (const game_id_type& game_id : match_obj.games)
{ {
game_object game_obj = get_object<game_object>(game_id); game_object game_obj = get_object(game_id);
auto insert_result = game_cache.insert(game_obj); auto insert_result = game_cache.insert(game_obj);
if (insert_result.second) if (insert_result.second)
game_in_new_state(game_obj); game_in_new_state(game_obj);
@ -981,10 +981,10 @@ public:
// updates on those matches // updates on those matches
void monitor_matches_in_tournament(const tournament_object& tournament_obj) void monitor_matches_in_tournament(const tournament_object& tournament_obj)
{ try { { try {
tournament_details_object tournament_details = get_object<tournament_details_object>(tournament_obj.tournament_details_id); tournament_details_object tournament_details = get_object(tournament_obj.tournament_details_id);
for (const match_id_type& match_id : tournament_details.matches) for (const match_id_type& match_id : tournament_details.matches)
{ {
match_object match_obj = get_object<match_object>(match_id); match_object match_obj = get_object(match_id);
auto insert_result = match_cache.insert(match_obj); auto insert_result = match_cache.insert(match_obj);
if (insert_result.second) if (insert_result.second)
match_in_new_state(match_obj); match_in_new_state(match_obj);
@ -1006,7 +1006,7 @@ public:
{ {
try try
{ {
tournament_object tournament = get_object<tournament_object>(tournament_id); tournament_object tournament = get_object(tournament_id);
auto insert_result = tournament_cache.insert(tournament); auto insert_result = tournament_cache.insert(tournament);
if (insert_result.second) if (insert_result.second)
{ {
@ -2118,7 +2118,7 @@ public:
FC_THROW("Account ${account} has no core Token ${TOKEN} vested and thus its not allowed to withdraw.", ("account", witness_name)("TOKEN", GRAPHENE_SYMBOL)); FC_THROW("Account ${account} has no core Token ${TOKEN} vested and thus its not allowed to withdraw.", ("account", witness_name)("TOKEN", GRAPHENE_SYMBOL));
} }
vesting_balance_object vbo = get_object< vesting_balance_object >( *vbid ); vesting_balance_object vbo = get_object( *vbid );
if(vbo.balance_type != vesting_balance_type::normal) if(vbo.balance_type != vesting_balance_type::normal)
FC_THROW("Allowed to withdraw only Normal type vest balances with this method"); FC_THROW("Allowed to withdraw only Normal type vest balances with this method");
@ -2163,7 +2163,7 @@ public:
//whether it is a witness or user, keep it in a container and iterate over to process all vesting balances and types //whether it is a witness or user, keep it in a container and iterate over to process all vesting balances and types
if(!vbos.size()) if(!vbos.size())
vbos.emplace_back( get_object<vesting_balance_object>(*vbid) ); vbos.emplace_back( get_object(*vbid) );
for (const vesting_balance_object& vesting_balance_obj: vbos) { for (const vesting_balance_object& vesting_balance_obj: vbos) {
if(vesting_balance_obj.balance_type == vesting_balance_type::gpos) if(vesting_balance_obj.balance_type == vesting_balance_type::gpos)
@ -2924,7 +2924,7 @@ public:
std::string player_name; std::string player_name;
if (round == num_rounds) if (round == num_rounds)
{ {
match_object match = get_object<match_object>(tournament_details.matches[num_matches - 1]); match_object match = get_object(tournament_details.matches[num_matches - 1]);
if (match.get_state() == match_state::match_complete && if (match.get_state() == match_state::match_complete &&
!match.match_winners.empty()) !match.match_winners.empty())
{ {
@ -2934,7 +2934,7 @@ public:
} }
else else
{ {
match_object match = get_object<match_object>(tournament_details.matches[match_number]); match_object match = get_object(tournament_details.matches[match_number]);
if (!match.players.empty()) if (!match.players.empty())
{ {
if (player_in_match < match.players.size()) if (player_in_match < match.players.size())
@ -2972,7 +2972,7 @@ public:
return ss.str(); return ss.str();
}; };
m["get_order_book"] = [this](variant result, const fc::variants& a) m["get_order_book"] = [](variant result, const fc::variants&)
{ {
auto orders = result.as<order_book>( GRAPHENE_MAX_NESTED_OBJECTS ); auto orders = result.as<order_book>( GRAPHENE_MAX_NESTED_OBJECTS );
auto bids = orders.bids; auto bids = orders.bids;
@ -4773,7 +4773,7 @@ string wallet_api::help()const
{ {
std::vector<std::string> method_names = my->method_documentation.get_method_names(); std::vector<std::string> method_names = my->method_documentation.get_method_names();
std::stringstream ss; std::stringstream ss;
for (const std::string method_name : method_names) for (const std::string& method_name : method_names)
{ {
try try
{ {
@ -6296,9 +6296,9 @@ signed_transaction wallet_api::rps_throw(game_id_type game_id,
FC_ASSERT( !is_locked() ); FC_ASSERT( !is_locked() );
// check whether the gesture is appropriate for the game we're playing // check whether the gesture is appropriate for the game we're playing
graphene::chain::game_object game_obj = my->get_object<graphene::chain::game_object>(game_id); graphene::chain::game_object game_obj = my->get_object(game_id);
graphene::chain::match_object match_obj = my->get_object<graphene::chain::match_object>(game_obj.match_id); graphene::chain::match_object match_obj = my->get_object(game_obj.match_id);
graphene::chain::tournament_object tournament_obj = my->get_object<graphene::chain::tournament_object>(match_obj.tournament_id); graphene::chain::tournament_object tournament_obj = my->get_object(match_obj.tournament_id);
graphene::chain::rock_paper_scissors_game_options game_options = graphene::chain::rock_paper_scissors_game_options game_options =
tournament_obj.options.game_options.get<graphene::chain::rock_paper_scissors_game_options>(); tournament_obj.options.game_options.get<graphene::chain::rock_paper_scissors_game_options>();
if ((int)gesture >= game_options.number_of_gestures) if ((int)gesture >= game_options.number_of_gestures)

View file

@ -109,7 +109,7 @@ void class_processor::process_class( const static_variant< T... >* dummy )
} }
} }
template<typename IsEnum = fc::false_type> template<bool IsEnum>
struct if_enum struct if_enum
{ {
template< typename T > template< typename T >
@ -130,7 +130,7 @@ struct if_enum
}; };
template<> template<>
struct if_enum<fc::true_type> struct if_enum<true>
{ {
template< typename T > template< typename T >
static void process_class( class_processor* proc, const T* dummy ) static void process_class( class_processor* proc, const T* dummy )
@ -157,7 +157,7 @@ struct if_reflected<fc::true_type>
template< typename T > template< typename T >
static void process_class( class_processor* proc, const T* dummy ) static void process_class( class_processor* proc, const T* dummy )
{ {
if_enum< typename fc::reflector<T>::is_enum >::process_class(proc, dummy); if_enum< std::is_enum<T>::value >::process_class(proc, dummy);
} }
}; };
@ -216,7 +216,7 @@ int main( int argc, char** argv )
graphene::member_enumerator::class_processor::process_class<signed_block>(result); graphene::member_enumerator::class_processor::process_class<signed_block>(result);
fc::mutable_variant_object mvo; fc::mutable_variant_object mvo;
for( const std::pair< std::string, std::vector< std::string > >& e : result ) for( const auto& e : result )
{ {
variant v; variant v;
to_variant( e.second, v , 1); to_variant( e.second, v , 1);

View file

@ -164,7 +164,7 @@ int main(int argc, char** argv) {
node->startup(); node->startup();
node->startup_plugins(); node->startup_plugins();
fc::promise<int>::ptr exit_promise = new fc::promise<int>("UNIX Signal Handler"); fc::promise<int>::ptr exit_promise = fc::promise<int>::create("UNIX Signal Handler");
fc::set_signal_handler([&exit_promise](int signal) { fc::set_signal_handler([&exit_promise](int signal) {
elog( "Caught SIGINT attempting to exit cleanly" ); elog( "Caught SIGINT attempting to exit cleanly" );

View file

@ -224,7 +224,7 @@ public:
wallet_data.ws_password = ""; wallet_data.ws_password = "";
websocket_connection = websocket_client.connect( wallet_data.ws_server ); websocket_connection = websocket_client.connect( wallet_data.ws_server );
api_connection = std::make_shared<fc::rpc::websocket_api_connection>(*websocket_connection, GRAPHENE_MAX_NESTED_OBJECTS); api_connection = std::make_shared<fc::rpc::websocket_api_connection>(websocket_connection, GRAPHENE_MAX_NESTED_OBJECTS);
remote_login_api = api_connection->get_remote_api< graphene::app::login_api >(1); remote_login_api = api_connection->get_remote_api< graphene::app::login_api >(1);
BOOST_CHECK(remote_login_api->login( wallet_data.ws_user, wallet_data.ws_password ) ); BOOST_CHECK(remote_login_api->login( wallet_data.ws_user, wallet_data.ws_password ) );

View file

@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE( flat_index_test )
price_feed current_feed; price_feed current_feed;
current_feed.settlement_price = bitusd.amount(100) / asset(100); current_feed.settlement_price = bitusd.amount(100) / asset(100);
publish_feed(bitusd, sam, current_feed); publish_feed(bitusd, sam, current_feed);
FC_ASSERT( bitusd.bitasset_data_id->instance == 0 ); FC_ASSERT( bitusd.bitasset_data_id->instance.value == 0 );
FC_ASSERT( !(*bitusd.bitasset_data_id)(db).current_feed.settlement_price.is_null() ); FC_ASSERT( !(*bitusd.bitasset_data_id)(db).current_feed.settlement_price.is_null() );
try { try {
auto ses = db._undo_db.start_undo_session(); auto ses = db._undo_db.start_undo_session();