From 33a002982e1b8b3ad8073382eea21fa1c3d0b5a8 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 21 May 2019 19:53:20 +0300 Subject: [PATCH] formatting/whitespace fixes --- contrib/epee/include/net/http_base.h | 2 +- contrib/epee/include/net/net_helper.h | 6 +++--- contrib/epee/include/profile_tools.h | 8 +++---- src/crypto/crypto.cpp | 8 +++---- src/simplewallet/simplewallet.cpp | 30 +++++++++++++-------------- src/stratum/stratum_server.cpp | 14 ++++++------- src/wallet/wallet2.cpp | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h index b6cab976..cca1add3 100644 --- a/contrib/epee/include/net/http_base.h +++ b/contrib/epee/include/net/http_base.h @@ -139,7 +139,7 @@ namespace net_utils m_http_ver_hi(0), m_http_ver_lo(0), m_have_to_block(false), - m_full_request_buf_size{} + m_full_request_buf_size(0) {} http_method m_http_method; diff --git a/contrib/epee/include/net/net_helper.h b/contrib/epee/include/net/net_helper.h index 190f0810..72ff4e75 100644 --- a/contrib/epee/include/net/net_helper.h +++ b/contrib/epee/include/net/net_helper.h @@ -107,13 +107,13 @@ namespace net_utils inline ~blocked_mode_client() { - NESTED_TRY_ENTRY(); + NESTED_TRY_ENTRY(); //profile_tools::local_coast lc("~blocked_mode_client()", 3); shutdown(); - NESTED_CATCH_ENTRY(__func__); - } + NESTED_CATCH_ENTRY(__func__); + } inline void set_recv_timeout(int reciev_timeout) { diff --git a/contrib/epee/include/profile_tools.h b/contrib/epee/include/profile_tools.h index 0750419a..b66adac4 100644 --- a/contrib/epee/include/profile_tools.h +++ b/contrib/epee/include/profile_tools.h @@ -107,20 +107,20 @@ namespace profile_tools } ~local_call_account() { - NESTED_TRY_ENTRY(); + NESTED_TRY_ENTRY(); LOG_PRINT2("profile_details.log", "PROFILE "<< std::left << std::setw(50) << (m_name + ":") << "av_time:" << std::setw(15) << epee::string_tools::print_fixed_decimal_point (m_count_of_call ? (m_summary_time_used / m_count_of_call) : 0, 3) << "sum_time: " << std::setw(15) << epee::string_tools::print_fixed_decimal_point(m_summary_time_used, 3) << "call_count: " << std::setw(15) << m_count_of_call, LOG_LEVEL_0); - NESTED_CATCH_ENTRY(__func__); - } + NESTED_CATCH_ENTRY(__func__); + } size_t m_count_of_call; uint64_t m_summary_time_used; std::string m_name; - }; + }; struct call_frame { diff --git a/src/crypto/crypto.cpp b/src/crypto/crypto.cpp index 8e2ee899..0eb6427e 100644 --- a/src/crypto/crypto.cpp +++ b/src/crypto/crypto.cpp @@ -142,10 +142,10 @@ namespace crypto { ge_p3 A = ge_p3(); ge_p2 R = ge_p2(); if (ge_frombytes_vartime(&A, reinterpret_cast(&P)) != 0) - { - assert(false); - throw std::runtime_error(__func__); - } + { + assert(false); + throw std::runtime_error(__func__); + } ge_scalarmult(&R, reinterpret_cast(&a), &A); key_image a_p = key_image(); ge_tobytes(reinterpret_cast(&a_p), &R); diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 742ef09e..49210f4a 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -114,23 +114,23 @@ namespace NESTED_TRY_ENTRY(); if (m_flush) + { + m_flush = false; + + LOG_PRINT(m_oss.str(), m_log_level) + + if (epee::log_space::console_color_default == m_color) { - m_flush = false; - - LOG_PRINT(m_oss.str(), m_log_level) - - if (epee::log_space::console_color_default == m_color) - { - std::cout << m_oss.str(); - } - else - { - epee::log_space::set_console_color(m_color, m_bright); - std::cout << m_oss.str(); - epee::log_space::reset_console_color(); - } - std::cout << std::endl; + std::cout << m_oss.str(); } + else + { + epee::log_space::set_console_color(m_color, m_bright); + std::cout << m_oss.str(); + epee::log_space::reset_console_color(); + } + std::cout << std::endl; + } NESTED_CATCH_ENTRY(__func__); } diff --git a/src/stratum/stratum_server.cpp b/src/stratum/stratum_server.cpp index 52d1a79b..92bc14fd 100644 --- a/src/stratum/stratum_server.cpp +++ b/src/stratum/stratum_server.cpp @@ -804,13 +804,12 @@ namespace NESTED_TRY_ENTRY(); if (m_connection_initialized) - { - m_config.remove_protocol_handler(this); - m_connection_initialized = false; - } + { + m_config.remove_protocol_handler(this); + m_connection_initialized = false; + } - LOG_PRINT_CC( - m_context, "stratum_protocol_handler::dtor()", LOG_LEVEL_4); + LOG_PRINT_CC(m_context, "stratum_protocol_handler::dtor()", LOG_LEVEL_4); NESTED_CATCH_ENTRY(__func__); } @@ -1094,7 +1093,8 @@ struct stratum_server_impl }; //------------------------------------------------------------------------------------------------------------------------------ stratum_server::stratum_server(core* c) - : m_p_core(c), m_threads_count{} + : m_p_core(c) + , m_threads_count(0) { m_impl = new stratum_server_impl(); } diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ec6d5f1c..44a78c5a 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2216,7 +2216,7 @@ void wallet2::sign_transfer(const std::string& tx_sources_blob, std::string& sig // calculate key images for each change output crypto::key_derivation derivation = AUTO_VAL_INIT(derivation); - CHECK_AND_ASSERT_THROW_MES( + WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX( crypto::generate_key_derivation( m_account.get_keys().m_account_address.m_view_public_key, ft.one_time_key,