]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1308] cleanup
authorRazvan Becheriu <razvan@isc.org>
Thu, 13 Aug 2020 11:54:05 +0000 (14:54 +0300)
committerTomek Mrugalski <tomek@isc.org>
Thu, 13 Aug 2020 13:54:14 +0000 (13:54 +0000)
17 files changed:
src/bin/d2/tests/dns_client_unittests.cc
src/lib/asiolink/interval_timer.cc
src/lib/asiolink/tests/tcp_acceptor_unittest.cc
src/lib/asiolink/testutils/test_server_unix_socket.cc
src/lib/dhcp_ddns/ncr_udp.cc
src/lib/dhcpsrv/parsers/client_class_def_parser.cc
src/lib/dns/masterload.cc
src/lib/dns/rrcollator.cc
src/lib/dns/zone_checker.cc
src/lib/http/client.cc
src/lib/http/connection.cc
src/lib/http/listener_impl.cc
src/lib/process/d_controller.cc
src/lib/process/daemon.cc
src/lib/process/io_service_signal.cc
src/lib/process/tests/io_service_signal_unittests.cc
src/lib/util/process_spawn.cc

index 7f1b34d5a78557e215be2248751341d66a4d20cd..02bbc569c8ebb37413f3c56638d632295523ba59 100644 (file)
@@ -29,7 +29,6 @@ using namespace isc::dns;
 using namespace isc::util;
 using namespace boost::asio;
 using namespace boost::asio::ip;
-
 namespace ph = std::placeholders;
 
 namespace {
index b74901969ea2a9e902c8aaf6cf7a4ed1d74f0c02..2cda9b0085b7ec74737dd8ad2fc588f52dbf34ea 100644 (file)
@@ -20,6 +20,7 @@
 #include <mutex>
 
 using namespace std;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace asiolink {
@@ -142,7 +143,7 @@ IntervalTimerImpl::update() {
         // Pass a function bound with a shared_ptr to this.
         timer_.async_wait(std::bind(&IntervalTimerImpl::callback,
                                     shared_from_this(),
-                                    std::placeholders::_1)); //error
+                                    ph::_1)); //error
     } catch (const boost::system::system_error& e) {
         isc_throw(isc::Unexpected, "Failed to update timer: " << e.what());
     } catch (const boost::bad_weak_ptr&) {
index 8229bbcdb7c56dee08ed6f008f307ac525ef1603..d674146fd3993948f146d3c3d9b9a2d8780978ae 100644 (file)
@@ -20,6 +20,7 @@
 #include <string>
 
 using namespace isc::asiolink;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -83,7 +84,7 @@ public:
                      SERVER_PORT);
         socket_.async_connect(endpoint,
                               std::bind(&TCPClient::connectHandler, this,
-                                        std::placeholders::_1));
+                                        ph::_1));
     }
 
     /// @brief Callback function for connect().
@@ -251,7 +252,7 @@ public:
     /// retained in the connections_ list.
     void accept() {
         TCPAcceptorCallback cb = std::bind(&TCPAcceptorTest::acceptHandler,
-                                           this, std::placeholders::_1);
+                                           this, ph::_1);
         AcceptorPtr conn(new Acceptor(io_service_, acceptor_, cb));
         connections_.push_back(conn);
         connections_.back()->accept();
index d22b9802a1ae50671b96275dbef8fde34336fd22..7f7007d01822edc3fcabc318fdebb4e1ef2e1365 100644 (file)
@@ -15,6 +15,7 @@
 #include <sstream>
 
 using namespace boost::asio::local;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace asiolink {
@@ -55,8 +56,8 @@ public:
     void start() {
        socket_->async_read_some(boost::asio::buffer(&raw_buf_[0], raw_buf_.size()),
            std::bind(&Connection::readHandler, shared_from_this(),
-                     std::placeholders::_1,   // error
-                     std::placeholders::_2)); // bytes_transferred
+                     ph::_1,   // error
+                     ph::_2)); // bytes_transferred
     }
 
     /// @brief Closes the socket.
@@ -293,7 +294,7 @@ void
 TestServerUnixSocket::accept() {
     server_acceptor_.async_accept(*(connection_pool_->getSocket()),
         std::bind(&TestServerUnixSocket::acceptHandler, this,
-                  std::placeholders::_1)); // error
+                  ph::_1)); // error
 }
 
 void
index 1fcbdd7713a23c57fc67c86bf90b537ec3193aa3..8293fd77e04b1fa1a2e52f5b4861f9bcebfcb32a 100644 (file)
@@ -76,7 +76,7 @@ NameChangeUDPListener(const isc::asiolink::IOAddress& ip_address,
     UDPEndpointPtr data_source(new asiolink::UDPEndpoint());
     recv_callback_.reset(new UDPCallback(buffer, RECV_BUF_MAX, data_source,
         std::bind(&NameChangeUDPListener::receiveCompletionHandler,
-                 this, ph::_1, ph::_2)));
+                  this, ph::_1, ph::_2)));
 }
 
 NameChangeUDPListener::~NameChangeUDPListener() {
index 4be5e85dcf99c07b962894b6b8ac2c845c0b0ee4..91fb089322ced7100ccdd5c7ba5431083eaa0e34 100644 (file)
@@ -86,7 +86,6 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
     bool depend_on_known = false;
     if (test_cfg) {
         ExpressionParser parser;
-        using std::placeholders::_1;
         auto check_defined =
             [&class_dictionary, &depend_on_known]
             (const ClientClass& cclass) {
index ef32ea2daeb5f7457598bb537a724a62351c03c1..94638c17aedc45787db7d3e75d7e88c8d3e8d9ad 100644 (file)
 #include <cctype>
 #include <cerrno>
 
-using namespace std;
 using namespace isc::dns::rdata;
 
+using namespace std;
+namespace ph = std::placeholders;
+
 namespace isc {
 namespace dns {
 namespace {
@@ -62,8 +64,8 @@ void
 loadHelper(InputType input, const Name& origin,
            const RRClass& zone_class, MasterLoadCallback callback)
 {
-    RRCollator rr_collator(std::bind(callbackWrapper, std::placeholders::_1,
-                                     callback, &origin));
+    RRCollator rr_collator(std::bind(callbackWrapper, ph::_1, callback,
+                                     &origin));
     MasterLoader loader(input, origin, zone_class,
                         MasterLoaderCallbacks::getNullCallbacks(),
                         rr_collator.getCallback());
index d204e3e421d9fb7ce36da1409a1a9eeb21e9fa06..83780216750123b597a998d139b054cdeef5759e 100644 (file)
 #include <algorithm>
 #include <functional>
 
+using namespace isc::dns::rdata;
+namespace ph = std::placeholders;
+
 namespace isc {
 namespace dns {
-using namespace rdata;
 
 class RRCollator::Impl {
 public:
@@ -87,7 +89,6 @@ RRCollator::~RRCollator() {
 
 AddRRCallback
 RRCollator::getCallback() {
-    namespace ph = std::placeholders;
     return (std::bind(&RRCollator::Impl::addRR, this->impl_,
                       ph::_1, ph::_2, ph::_3, ph::_4, ph::_5));
 }
index e87cb7850a068f7f72a19a0f9f8ca4b6da3270bb..def989627f34560c7d0d1f6730abe0351b9e924d 100644 (file)
@@ -22,6 +22,7 @@
 
 using boost::lexical_cast;
 using std::string;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace dns {
@@ -177,8 +178,8 @@ checkZone(const Name& zone_name, const RRClass& zone_class,
           const ZoneCheckerCallbacks& callbacks) {
     bool had_error = false;
     ZoneCheckerCallbacks my_callbacks(
-        std::bind(errorWrapper, std::placeholders::_1, &callbacks, &had_error),
-        std::bind(&ZoneCheckerCallbacks::warn, &callbacks, std::placeholders::_1));
+        std::bind(errorWrapper, ph::_1, &callbacks, &had_error),
+        std::bind(&ZoneCheckerCallbacks::warn, &callbacks, ph::_1));
 
     checkSOA(zone_name, zone_class, zone_rrsets, my_callbacks);
     checkNS(zone_name, zone_class, zone_rrsets, my_callbacks);
index bf1acc59e7ae4197862a1c3ae010a0f64aa2bc2e..65dd721bd4304a5233b01ab57786ac1c86d29172 100644 (file)
@@ -32,6 +32,7 @@ using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::http;
 using namespace isc::util;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -833,7 +834,7 @@ Connection::doTransactionInternal(const HttpRequestPtr& request,
                              static_cast<unsigned short>(url_.getPort()));
         SocketCallback socket_cb(std::bind(&Connection::connectCallback, shared_from_this(),
                                            connect_callback, current_transid_,
-                                           std::placeholders::_1));
+                                           ph::_1));
 
         // Establish new connection or use existing connection.
         socket_.open(&endpoint, socket_cb);
@@ -1002,8 +1003,8 @@ Connection::doSend(const uint64_t transid) {
     SocketCallback socket_cb(std::bind(&Connection::sendCallback,
                                        shared_from_this(),
                                        transid,
-                                       std::placeholders::_1,
-                                       std::placeholders::_2));
+                                       ph::_1,
+                                       ph::_2));
     try {
         socket_.asyncSend(&buf_[0], buf_.size(), socket_cb);
 
@@ -1018,8 +1019,8 @@ Connection::doReceive(const uint64_t transid) {
     SocketCallback socket_cb(std::bind(&Connection::receiveCallback,
                                        shared_from_this(),
                                        transid,
-                                       std::placeholders::_1,
-                                       std::placeholders::_2));
+                                       ph::_1,
+                                       ph::_2));
 
     try {
         socket_.asyncReceive(static_cast<void*>(input_buf_.data()), input_buf_.size(), 0,
index f2dbfd8f3e57411967dd09b0dd8546050c29411e..cc843e78da01ddf6ee3585edd2477fa7f85ccf0a 100644 (file)
@@ -15,6 +15,7 @@
 #include <functional>
 
 using namespace isc::asiolink;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -107,7 +108,7 @@ HttpConnection::asyncAccept() {
     // as needed.
     HttpAcceptorCallback cb = std::bind(&HttpConnection::acceptorCallback,
                                         shared_from_this(),
-                                        std::placeholders::_1); // error
+                                        ph::_1); // error
     try {
         acceptor_.asyncAccept(socket_, cb);
 
@@ -134,8 +135,8 @@ HttpConnection::doRead(TransactionPtr transaction) {
         SocketCallback cb(std::bind(&HttpConnection::socketReadCallback,
                                     shared_from_this(),
                                     transaction,
-                                    std::placeholders::_1,   // error
-                                    std::placeholders::_2)); //bytes_transferred
+                                    ph::_1,   // error
+                                    ph::_2)); //bytes_transferred
         socket_.asyncReceive(static_cast<void*>(transaction->getInputBufData()),
                              transaction->getInputBufSize(),
                              0, &endpoint, cb);
@@ -155,8 +156,8 @@ HttpConnection::doWrite(HttpConnection::TransactionPtr transaction) {
             SocketCallback cb(std::bind(&HttpConnection::socketWriteCallback,
                                         shared_from_this(),
                                         transaction,
-                                        std::placeholders::_1,   // error
-                                        std::placeholders::_2)); // bytes_transferred
+                                        ph::_1,   // error
+                                        ph::_2)); // bytes_transferred
             socket_.asyncSend(transaction->getOutputBufData(),
                               transaction->getOutputBufSize(),
                               cb);
index d6ab95f4bb67243a037c55926b1cac1378a7f08d..1a80f6817ff205b9b52315aeb7c609aa055404b5 100644 (file)
@@ -11,6 +11,7 @@
 #include <http/listener_impl.h>
 
 using namespace isc::asiolink;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace http {
@@ -88,8 +89,7 @@ HttpListenerImpl::accept() {
     // depends on the use case.
     HttpResponseCreatorPtr response_creator = creator_factory_->create();
     HttpAcceptorCallback acceptor_callback =
-        std::bind(&HttpListenerImpl::acceptHandler, this,
-                  std::placeholders::_1);
+        std::bind(&HttpListenerImpl::acceptHandler, this, ph::_1);
     HttpConnectionPtr conn = createConnection(response_creator,
                                               acceptor_callback);
     // Add this new connection to the pool.
index ae14572ec07ca6baa040491b8dc0fd437d6f4187..b9ee7ce37fb8221fb7627b5849eaf4561ae744b8 100644 (file)
@@ -21,6 +21,7 @@
 
 using namespace isc::data;
 using namespace isc::config;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace process {
@@ -741,8 +742,7 @@ DControllerBase::initSignalHandling() {
     io_signal_set_.reset(new IOSignalSet(io_service_,
                                          std::bind(&DControllerBase::
                                                    processSignal,
-                                                   this,
-                                                   std::placeholders::_1)));
+                                                   this, ph::_1)));
     // Register for the signals we wish to handle.
     io_signal_set_->add(SIGHUP);
     io_signal_set_->add(SIGINT);
index aa42e21fb836c412e442342b10d55bf55745628d..a7dba8af38fe7bfc624cf93e7effc65187571209 100644 (file)
@@ -20,6 +20,7 @@
 #include <errno.h>
 
 using namespace isc::data;
+namespace ph = std::placeholders;
 
 /// @brief provides default implementation for basic daemon operations
 ///
@@ -62,7 +63,7 @@ void Daemon::shutdown() {
 
 void Daemon::handleSignal() {
     if (signal_set_ && signal_handler_) {
-        signal_set_->handleNext(std::bind(signal_handler_, std::placeholders::_1));
+        signal_set_->handleNext(std::bind(signal_handler_, ph::_1));
     }
 }
 
index 448fd1171f399491489b6796e75ee21687748908..0e80723f89eddcfe75138d83c2990f322d7ba401 100644 (file)
@@ -16,6 +16,7 @@
 #include <functional>
 
 using namespace isc::asiolink;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace process {
@@ -83,9 +84,7 @@ IOSignalSetImpl::callback(const boost::system::error_code& ec, int signum) {
 void
 IOSignalSetImpl::install() {
     signal_set_.async_wait(std::bind(&IOSignalSetImpl::callback,
-                                     shared_from_this(),
-                                     std::placeholders::_1,
-                                     std::placeholders::_2));
+                                     shared_from_this(), ph::_1, ph::_2));
 }
 
 void
index f313998a599709f4416bff442e8163b16725f585..dbbe0cfbbb12425be4dbb3a9c5c750b5f6389e22 100644 (file)
@@ -14,6 +14,8 @@
 #include <functional>
 #include <queue>
 
+namespace ph = std::placeholders;
+
 namespace isc {
 namespace process {
 
@@ -53,7 +55,7 @@ public:
         io_signal_set_.reset(new IOSignalSet(
                                      io_service_,
                                      std::bind(&IOSignalTest::processSignal,
-                                               this, std::placeholders::_1)));
+                                               this, ph::_1)));
     }
 
     /// @brief Destructor.
index 15302bbeec2b1e2463eb94202262efcde758cea8..1cc371735698910fb78c06b9255ad64b7e3d9eaa 100644 (file)
@@ -18,6 +18,8 @@
 #include <unistd.h>
 #include <sys/wait.h>
 
+namespace ph = std::placeholders;
+
 namespace isc {
 namespace util {
 
@@ -154,7 +156,7 @@ ProcessSpawnImpl::ProcessSpawnImpl(const std::string& executable,
     // Set the handler which is invoked immediately when the signal
     // is received.
     signals_->setOnReceiptHandler(std::bind(&ProcessSpawnImpl::waitForProcess,
-                                            this, std::placeholders::_1));
+                                            this, ph::_1));
     // Conversion of the arguments to the C-style array we start by setting
     // all pointers within an array to NULL to indicate that they haven't
     // been allocated yet.