From 29003e06a65e9cbd18f83d44e197e70542a2a6a2 Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Mon, 12 Dec 2011 15:39:41 +0000 Subject: [PATCH] [1470] Qualify "error_code" One compiler had a problem with the unqualifier data type "error_code". This has been changed to "asio::error_code". --- src/lib/asiodns/tcp_server.cc | 2 +- src/lib/asiodns/tests/io_fetch_unittest.cc | 15 ++++++++++----- src/lib/asiodns/udp_server.cc | 2 +- src/lib/asiolink/io_address.cc | 2 +- .../tests/recursive_query_unittest_2.cc | 19 ++++++++++++++----- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/lib/asiodns/tcp_server.cc b/src/lib/asiodns/tcp_server.cc index f91eb3293b..2606a21aa9 100644 --- a/src/lib/asiodns/tcp_server.cc +++ b/src/lib/asiodns/tcp_server.cc @@ -70,7 +70,7 @@ TCPServer::TCPServer(io_service& io_service, } void -TCPServer::operator()(error_code ec, size_t length) { +TCPServer::operator()(asio::error_code ec, size_t length) { /// Because the coroutine reentry block is implemented as /// a switch statement, inline variable declarations are not /// permitted. Certain variables used below can be declared here. diff --git a/src/lib/asiodns/tests/io_fetch_unittest.cc b/src/lib/asiodns/tests/io_fetch_unittest.cc index 52a51a14d2..936c6c7354 100644 --- a/src/lib/asiodns/tests/io_fetch_unittest.cc +++ b/src/lib/asiodns/tests/io_fetch_unittest.cc @@ -169,8 +169,10 @@ public: /// sent with the correct QID. /// \param length Amount of data received. void udpReceiveHandler(udp::endpoint* remote, udp::socket* socket, - error_code ec = error_code(), size_t length = 0, - bool bad_qid = false, bool second_send = false) { + asio::error_code ec = asio::error_code(), + size_t length = 0, bool bad_qid = false, + bool second_send = false) + { if (debug_) { cout << "udpReceiveHandler(): error = " << ec.value() << ", length = " << length << endl; @@ -218,7 +220,8 @@ public: /// /// \param socket Socket on which data will be received /// \param ec Boost error code, value should be zero. - void tcpAcceptHandler(tcp::socket* socket, error_code ec = error_code()) + void tcpAcceptHandler(tcp::socket* socket, + asio::error_code ec = asio::error_code()) { if (debug_) { cout << "tcpAcceptHandler(): error = " << ec.value() << endl; @@ -257,7 +260,8 @@ public: /// \param ec ASIO error code, completion code of asynchronous I/O issued /// by the "server" to receive data. /// \param length Amount of data received. - void tcpReceiveHandler(tcp::socket* socket, error_code ec = error_code(), + void tcpReceiveHandler(tcp::socket* socket, + asio::error_code ec = asio::error_code(), size_t length = 0) { if (debug_) { @@ -386,7 +390,8 @@ public: /// \param ec Boost error code, value should be zero. /// \param length Number of bytes sent. void tcpSendHandler(size_t expected, tcp::socket* socket, - error_code ec = error_code(), size_t length = 0) + asio::error_code ec = asio::error_code(), + size_t length = 0) { if (debug_) { cout << "tcpSendHandler(): error = " << ec.value() << diff --git a/src/lib/asiodns/udp_server.cc b/src/lib/asiodns/udp_server.cc index f103e5a94c..72db2bfe8d 100644 --- a/src/lib/asiodns/udp_server.cc +++ b/src/lib/asiodns/udp_server.cc @@ -170,7 +170,7 @@ UDPServer::UDPServer(io_service& io_service, const ip::address& addr, /// The function operator is implemented with the "stackless coroutine" /// pattern; see internal/coroutine.h for details. void -UDPServer::operator()(error_code ec, size_t length) { +UDPServer::operator()(asio::error_code ec, size_t length) { /// Because the coroutine reentry block is implemented as /// a switch statement, inline variable declarations are not /// permitted. Certain variables used below can be declared here. diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc index 0fe1db45be..370e8f5af7 100644 --- a/src/lib/asiolink/io_address.cc +++ b/src/lib/asiolink/io_address.cc @@ -38,7 +38,7 @@ namespace asiolink { // XXX: we cannot simply construct the address in the initialization list, // because we'd like to throw our own exception on failure. IOAddress::IOAddress(const string& address_str) { - error_code err; + asio::error_code err; asio_address_ = ip::address::from_string(address_str, err); if (err) { isc_throw(IOError, "Failed to convert string to address '" diff --git a/src/lib/resolve/tests/recursive_query_unittest_2.cc b/src/lib/resolve/tests/recursive_query_unittest_2.cc index 3e62336d5e..ba93bd845b 100644 --- a/src/lib/resolve/tests/recursive_query_unittest_2.cc +++ b/src/lib/resolve/tests/recursive_query_unittest_2.cc @@ -275,7 +275,9 @@ public: /// \param ec ASIO error code, completion code of asynchronous I/O issued /// by the "server" to receive data. /// \param length Amount of data received. - void udpReceiveHandler(error_code ec = error_code(), size_t length = 0) { + void udpReceiveHandler(asio::error_code ec = asio::error_code(), + size_t length = 0) + { if (debug_) { cout << "udpReceiveHandler(): error = " << ec.value() << ", length = " << length << ", last state = " << last_ << @@ -368,7 +370,9 @@ public: /// /// \param ec Completion error code of the send. /// \param length Actual number of bytes sent. - void udpSendHandler(error_code ec = error_code(), size_t length = 0) { + void udpSendHandler(asio::error_code ec = asio::error_code(), + size_t length = 0) + { if (debug_) { cout << "udpSendHandler(): error = " << ec.value() << ", length = " << length << endl; @@ -392,7 +396,9 @@ public: /// /// \param socket Socket on which data will be received /// \param ec Boost error code, value should be zero. - void tcpAcceptHandler(error_code ec = error_code(), size_t length = 0) { + void tcpAcceptHandler(asio::error_code ec = asio::error_code(), + size_t length = 0) + { if (debug_) { cout << "tcpAcceptHandler(): error = " << ec.value() << ", length = " << length << endl; @@ -419,7 +425,9 @@ public: /// \param ec ASIO error code, completion code of asynchronous I/O issued /// by the "server" to receive data. /// \param length Amount of data received. - void tcpReceiveHandler(error_code ec = error_code(), size_t length = 0) { + void tcpReceiveHandler(asio::error_code ec = asio::error_code(), + size_t length = 0) + { if (debug_) { cout << "tcpReceiveHandler(): error = " << ec.value() << ", length = " << length << @@ -506,7 +514,8 @@ public: /// \param expected_length Number of bytes that were expected to have been sent. /// \param ec Boost error code, value should be zero. /// \param length Number of bytes sent. - void tcpSendHandler(size_t expected_length = 0, error_code ec = error_code(), + void tcpSendHandler(size_t expected_length = 0, + asio::error_code ec = asio::error_code(), size_t length = 0) { if (debug_) {