Skip to content
Snippets Groups Projects
Commit c3ad3368 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

misc: fix various warnings

parent 9c5e5cd7
Branches
Tags
No related merge requests found
...@@ -567,6 +567,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn ...@@ -567,6 +567,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn
} }
auto& base = ssl_socket_? ssl_socket_->lowest_layer() : *socket_; auto& base = ssl_socket_? ssl_socket_->lowest_layer() : *socket_;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
ConnectHandlerCb wcb = [&base, cb=std::move(cb)](const asio::error_code& ec, const asio::ip::tcp::endpoint& endpoint) { ConnectHandlerCb wcb = [&base, cb=std::move(cb)](const asio::error_code& ec, const asio::ip::tcp::endpoint& endpoint) {
if (!ec) { if (!ec) {
auto socket = base.native_handle(); auto socket = base.native_handle();
...@@ -614,6 +616,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn ...@@ -614,6 +616,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn
if (cb) if (cb)
cb(ec, endpoint); cb(ec, endpoint);
}; };
#pragma GCC diagnostic pop
if (ssl_socket_) if (ssl_socket_)
asio::async_connect(ssl_socket_->lowest_layer(), std::move(endpoints), wrapCallabck(std::move(wcb))); asio::async_connect(ssl_socket_->lowest_layer(), std::move(endpoints), wrapCallabck(std::move(wcb)));
else else
......
...@@ -148,6 +148,8 @@ UdpSocket::sendTo(const SockAddr& dest, const uint8_t* data, size_t size, bool r ...@@ -148,6 +148,8 @@ UdpSocket::sendTo(const SockAddr& dest, const uint8_t* data, size_t size, bool r
#ifdef MSG_CONFIRM #ifdef MSG_CONFIRM
if (replied) if (replied)
flags |= MSG_CONFIRM; flags |= MSG_CONFIRM;
#else
(void) replied;
#endif #endif
#ifdef MSG_NOSIGNAL #ifdef MSG_NOSIGNAL
flags |= MSG_NOSIGNAL; flags |= MSG_NOSIGNAL;
......
...@@ -309,13 +309,13 @@ DhtProxyTester::testShutdownStop() ...@@ -309,13 +309,13 @@ DhtProxyTester::testShutdownStop()
for (size_t i = 0; i < C; i++) { for (size_t i = 0; i < C; i++) {
auto nodeTest = std::make_shared<dht::DhtRunner>(); auto nodeTest = std::make_shared<dht::DhtRunner>();
nodeTest->run(0, clientConfig); nodeTest->run(0, clientConfig);
nodeTest->put(key, dht::Value(mtu), [&](bool ok) { nodeTest->put(key, dht::Value(mtu), [&](bool /*ok*/) {
callback_count++; callback_count++;
}); });
nodeTest->get(key, [&](const std::vector<std::shared_ptr<dht::Value>>& vals){ nodeTest->get(key, [&](const std::vector<std::shared_ptr<dht::Value>>& vals){
values.insert(values.end(), vals.begin(), vals.end()); values.insert(values.end(), vals.begin(), vals.end());
return true; return true;
},[&](bool ok){ },[&](bool /*ok*/){
callback_count++; callback_count++;
}); });
bool done = false; bool done = false;
......
...@@ -94,7 +94,6 @@ void ...@@ -94,7 +94,6 @@ void
DhtRunnerTester::testListen() { DhtRunnerTester::testListen() {
std::mutex mutex; std::mutex mutex;
std::condition_variable cv; std::condition_variable cv;
std::atomic_uint valueCount(0);
std::atomic_uint valueCounta(0); std::atomic_uint valueCounta(0);
std::atomic_uint valueCountb(0); std::atomic_uint valueCountb(0);
std::atomic_uint valueCountc(0); std::atomic_uint valueCountc(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment