Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Fix build errors related to unused lambda captures (#1175)
Browse files Browse the repository at this point in the history
* Fix build errors related to unused lambda captures

* Add missing virtual destructors

Signed-off-by: Andrei Lebedev <[email protected]>
  • Loading branch information
lebdron authored Apr 3, 2018
1 parent f3dc3bb commit 9e0e190
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/mutable_storage_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace iroha {
function) {
auto execute_transaction = [this](auto &transaction) {
command_executor_->setCreatorAccountId(transaction->creatorAccountId());
auto execute_command = [this, &transaction](auto command) {
auto execute_command = [this](auto command) {
auto result =
boost::apply_visitor(*command_executor_, command->get());
return result.match([](expected::Value<void> &v) { return true; },
Expand Down
6 changes: 3 additions & 3 deletions irohad/ametsuchi/impl/postgres_block_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace iroha {
shared_model::proto::from_old(block_old));
};
return rxcpp::observable<>::create<PostgresBlockQuery::wBlock>(
[this, block{std::move(block)}](auto s) {
[block{std::move(block)}](auto s) {
if (block) {
s.on_next(block);
}
Expand Down Expand Up @@ -120,7 +120,7 @@ namespace iroha {
*model::converters::stringToJson(bytesToString(bytes)))));
};
boost::for_each(
result | boost::adaptors::transformed([&block](const auto &x) {
result | boost::adaptors::transformed([](const auto &x) {
return x.at("index").template as<size_t>();
}),
[&](auto x) {
Expand Down Expand Up @@ -198,7 +198,7 @@ namespace iroha {
const shared_model::crypto::Hash &hash) {
return getBlockId(hash) |
[this](auto blockId) { return block_store_.get(blockId); } |
[this](auto bytes) {
[](auto bytes) {
// TODO IR-975 victordrobny 12.02.2018 convert directly to
// shared_model::proto::Block after FlatFile will be reworked to new
// model
Expand Down
2 changes: 2 additions & 0 deletions irohad/ametsuchi/ordering_service_persistent_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace iroha {
* Reset storage to default state
*/
virtual bool resetState() = 0;

virtual ~OrderingServicePersistentState() = default;
};
} // namespace ametsuchi
} // namespace iroha
Expand Down
2 changes: 1 addition & 1 deletion irohad/network/impl/block_loader_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ rxcpp::observable<std::shared_ptr<Block>> BlockLoaderImpl::retrieveBlocks(
.build(block)
.match(
// success case
[this, &context, &subscriber](
[&subscriber](
const iroha::expected::Value<shared_model::proto::Block>
&result) {
subscriber.on_next(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/acceptance/get_transactions_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ TEST_F(GetTransactions, HaveGetMyTx) {
*/
TEST_F(GetTransactions, InvalidSignatures) {
auto dummy_tx = dummyTx();
auto check = [&dummy_tx](auto &status) {
auto check = [](auto &status) {
auto resp = boost::get<shared_model::detail::PolymorphicWrapper<
interface::ErrorQueryResponse>>(status.get());
ASSERT_NO_THROW(boost::get<shared_model::detail::PolymorphicWrapper<
Expand Down
1 change: 1 addition & 0 deletions test/module/libs/common/result_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class Base {
virtual int getNumber() {
return 0;
}
virtual ~Base() = default;
};

class Derived : public Base {
Expand Down
3 changes: 1 addition & 2 deletions test/module/shared_model/cryptography/crypto_usage_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class CryptoUsageTest : public ::testing::Test {
and std::all_of(
signable.signatures().begin(),
signable.signatures().end(),
[this,
&signable](const shared_model::detail::PolymorphicWrapper<
[&signable](const shared_model::detail::PolymorphicWrapper<
shared_model::interface::Signature> &signature) {
return shared_model::crypto::CryptoVerifier<>::verify(
signature->signedData(),
Expand Down

0 comments on commit 9e0e190

Please sign in to comment.