1
0
Fork 0
forked from lthn/blockchain

Merge pull request #12 from anonimal/clang-warnings

Zano: resolve Clang build warnings
This commit is contained in:
cryptozoidberg 2019-02-20 19:21:25 +01:00 committed by GitHub
commit 74bc17fb6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 18 additions and 10 deletions

View file

@ -12,6 +12,8 @@ namespace currency
{
struct i_bc_service
{
virtual ~i_bc_service() = default;
virtual std::string get_id() = 0;
virtual bool init(const std::string& config_folder, const boost::program_options::variables_map& vm) = 0;
virtual bool deinit() = 0;

View file

@ -3544,7 +3544,7 @@ bool blockchain_storage::check_tx_inputs(const transaction& tx, const crypto::ha
if (!m_is_in_checkpoint_zone)
{
CHECK_AND_ASSERT_MES(tx.signatures.size() == sig_index, false, "tx signatures count differs from inputs");
if (!get_tx_flags(tx)&TX_FLAG_SIGNATURE_MODE_SEPARATE)
if (!(get_tx_flags(tx) & TX_FLAG_SIGNATURE_MODE_SEPARATE))
{
bool r = validate_attachment_info(tx.extra, tx.attachment, false);
CHECK_AND_ASSERT_MES(r, false, "Failed to validate attachments in tx " << tx_prefix_hash << ": incorrect extra_attachment_info in tx.extra");

View file

@ -1109,7 +1109,7 @@ namespace currency
att_count++;
}
}
if (!flags&TX_FLAG_SIGNATURE_MODE_SEPARATE)
if (!(flags & TX_FLAG_SIGNATURE_MODE_SEPARATE))
{
//take hash from attachment and put into extra
if (tx.attachment.size())
@ -2374,7 +2374,7 @@ namespace currency
//---------------------------------------------------------------
bool is_pos_block(const block& b)
{
if (!b.flags&CURRENCY_BLOCK_FLAG_POS_BLOCK)
if (!(b.flags & CURRENCY_BLOCK_FLAG_POS_BLOCK))
return false;
return is_pos_block(b.miner_tx);
}

View file

@ -124,7 +124,7 @@ namespace tools
return m_rpc.on_get_current_core_tx_expiration_median(req, res, m_cntxt_stub);
}
//------------------------------------------------------------------------------------------------------------------------------
bool call_COMMAND_RPC_GET_POOL_INFO(const currency::COMMAND_RPC_GET_POOL_INFO::request& req, currency::COMMAND_RPC_GET_POOL_INFO::response& res)
bool call_COMMAND_RPC_GET_POOL_INFO(const currency::COMMAND_RPC_GET_POOL_INFO::request& req, currency::COMMAND_RPC_GET_POOL_INFO::response& res) override
{
return m_rpc.on_get_pool_info(req, res, m_cntxt_stub);
}

View file

@ -1401,7 +1401,7 @@ int main(int argc, char* argv[])
bool r = wrpc.init(vm);
CHECK_AND_ASSERT_MES(r, 1, "Failed to initialize wallet rpc server");
tools::signal_handler::install([&wrpc, &wal] {
tools::signal_handler::install([&wrpc/*, &wal*/ /* TODO(unassigned): use? */] {
wrpc.send_stop_signal();
});
LOG_PRINT_L0("Starting wallet rpc server");

View file

@ -22,7 +22,7 @@ namespace currency
/************************************************************************/
/* */
/************************************************************************/
class simple_wallet : public tools::i_wallet2_callback,
class simple_wallet final : public tools::i_wallet2_callback,
public std::enable_shared_from_this<simple_wallet>
{
public:

View file

@ -16,7 +16,7 @@
namespace tools
{
class default_http_core_proxy: public i_core_proxy
class default_http_core_proxy final : public i_core_proxy
{
public:

View file

@ -16,6 +16,8 @@ namespace tools
*/
struct i_core_proxy
{
virtual ~i_core_proxy() = default;
virtual bool set_connection_addr(const std::string& url){ return false; }
virtual bool call_COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES(const currency::COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES::request& rqt, currency::COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES::response& rsp){ return false; }
virtual bool call_COMMAND_RPC_GET_BLOCKS_FAST(const currency::COMMAND_RPC_GET_BLOCKS_FAST::request& rqt, currency::COMMAND_RPC_GET_BLOCKS_FAST::response& rsp){ return false; }

View file

@ -68,6 +68,8 @@ namespace tools
class i_wallet2_callback
{
public:
virtual ~i_wallet2_callback() = default;
virtual void on_new_block(uint64_t /*height*/, const currency::block& /*block*/) {}
virtual void on_transfer2(const wallet_rpc::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) {}
virtual void on_pos_block_found(const currency::block& /*block*/) {}
@ -1204,4 +1206,4 @@ namespace tools
#undef LOG_DEFAULT_CHANNEL
#define LOG_DEFAULT_CHANNEL "wallet"
ENABLE_CHANNEL_BY_DEFAULT("wallet");
ENABLE_CHANNEL_BY_DEFAULT("wallet");

View file

@ -989,7 +989,7 @@ bool pos_altblocks_validation::generate(std::vector<test_event_entry>& events) c
// || \- (2a)- #3a#- | <- alt chain
// |+--------------+ \ | \ PoS block 2a uses stake already spent in main chain (okay)
// +---------------|-------+ \ PoS block 3a uses stake already spent in current alt chain (fail)
// | \ \
// | \ \
// | \ ...... (2br)- (3b)- #4b# <- alt chain
// | |
// +-----------------------+ PoS block 3b uses as stake an output, created in current alt chain (2a)

View file

@ -12,6 +12,8 @@
class test_core_listener
{
public:
virtual ~test_core_listener() = default;
virtual void before_tx_pushed_to_core(const currency::transaction& tx, const currency::blobdata& blob, currency::core& c, bool invalid_tx = false) {} // invalid_tx is true when processing a tx, marked as invalid in a test
virtual void before_block_pushed_to_core(const currency::block& block, const currency::blobdata& blob, currency::core& c) {}
};

View file

@ -264,7 +264,7 @@ TEST_F(positive_test_connection_to_levin_protocol_handler_calls, handler_initial
TEST_F(positive_test_connection_to_levin_protocol_handler_calls, concurent_handler_initialization_and_destruction_is_correct)
{
const size_t connection_count = 10000;
auto create_and_destroy_connections = [this, connection_count]()
auto create_and_destroy_connections = [this]()
{
std::vector<test_connection_ptr> connections(connection_count);
for (size_t i = 0; i < connection_count; ++i)