From e6ba9158e00795d99b2ec47439af79b1cd3aecbc Mon Sep 17 00:00:00 2001 From: Ashlesh Gawande Date: Fri, 30 Mar 2018 01:15:00 -0500 Subject: [PATCH] Fix build with clang-5.0 refs: #4547 Change-Id: I7fd0411b3dc7c62651875aa035bbfb6ca269bf81 --- src/nlsr.cpp | 4 ++-- tests/test-fib.cpp | 4 ++-- tests/test-nlsr.cpp | 3 +-- tests/test-sync-logic-handler.cpp | 12 ++++++------ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/nlsr.cpp b/src/nlsr.cpp index 384d4e9..71970ec 100644 --- a/src/nlsr.cpp +++ b/src/nlsr.cpp @@ -165,13 +165,13 @@ Nlsr::canonizeNeighborUris(std::list::iterator currentNeighbor, { if (currentNeighbor != m_adjacencyList.getAdjList().end()) { ndn::FaceUri uri(currentNeighbor->getFaceUri()); - uri.canonize([this, then, currentNeighbor] (ndn::FaceUri canonicalUri) { + uri.canonize([then, currentNeighbor] (ndn::FaceUri canonicalUri) { NLSR_LOG_DEBUG("Canonized URI: " << currentNeighbor->getFaceUri() << " to: " << canonicalUri); currentNeighbor->setFaceUri(canonicalUri); then(std::next(currentNeighbor)); }, - [this, then, currentNeighbor] (const std::string& reason) { + [then, currentNeighbor] (const std::string& reason) { NLSR_LOG_ERROR("Could not canonize URI: " << currentNeighbor->getFaceUri() << " because: " << reason); then(std::next(currentNeighbor)); diff --git a/tests/test-fib.cpp b/tests/test-fib.cpp index d47d3a8..629f933 100644 --- a/tests/test-fib.cpp +++ b/tests/test-fib.cpp @@ -308,8 +308,8 @@ BOOST_FIXTURE_TEST_CASE(ScheduleFibEntryRefresh, FibFixture) int origSeqNo = fe.getSeqNo(); fib->scheduleEntryRefresh(fe, - [&, this] (FibEntry& entry) { - BOOST_CHECK_EQUAL(origSeqNo+1, entry.getSeqNo()); + [&] (FibEntry& entry) { + BOOST_CHECK_EQUAL(origSeqNo + 1, entry.getSeqNo()); }); this->advanceClocks(ndn::time::milliseconds(10), 1); } diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp index 5c91312..efab71f 100644 --- a/tests/test-nlsr.cpp +++ b/tests/test-nlsr.cpp @@ -452,8 +452,7 @@ BOOST_AUTO_TEST_CASE(CanonizeUris) nlsr.canonizeNeighborUris(iterator, thenCallback, finallyCallback); }; nlsr.canonizeNeighborUris(nlsr.getAdjacencyList().getAdjList().begin(), - [&thenCallback, &finallyCallback] - (std::list::iterator iterator) { + [&] (std::list::iterator iterator) { thenCallback(iterator); }, finallyCallback); diff --git a/tests/test-sync-logic-handler.cpp b/tests/test-sync-logic-handler.cpp index b233b22..9f8192e 100644 --- a/tests/test-sync-logic-handler.cpp +++ b/tests/test-sync-logic-handler.cpp @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherLS) // Actual testing done here -- signal function callback ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect( - [&, this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { + [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); }); @@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherHR) + OTHER_ROUTER_NAME + std::to_string(lsaType); ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect( - [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { + [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); }); @@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry) + OTHER_ROUTER_NAME + std::to_string(lsaType); ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect( - [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { + [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); }); @@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(NoUpdateForSelf) updateName.append(CONFIG_SITE).append(CONFIG_ROUTER_NAME).append(std::to_string(lsaType)); ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect( - [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { + [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { BOOST_FAIL("Updates for self should not be emitted!"); }); @@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE(MalformedUpdate) updateName.append(CONFIG_ROUTER_NAME).append(std::to_string(lsaType)); ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect( - [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { + [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { BOOST_FAIL("Malformed updates should not be emitted!"); }); @@ -240,7 +240,7 @@ BOOST_AUTO_TEST_CASE(LsaNotNew) SyncLogicHandler sync{face, testLsaAlwaysFalse, conf}; sync.createSyncSocket(conf.getChronosyncPrefix()); ndn::util::signal::ScopedConnection connection = sync.onNewLsa->connect( - [& ,this] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { + [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber) { BOOST_FAIL("An update for an LSA with non-new sequence number should not emit!"); });