Commit 6bdfcf31 authored by JINMEI Tatuya's avatar JINMEI Tatuya

[trac613] avoid using an unused temporary variable.

parent 33deff72
......@@ -70,12 +70,15 @@ host_lookup(const char* const name, const char* const type) {
msg.toWire(renderer);
struct addrinfo hints, *res;
int e;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = 0; // not using AI_NUMERICHOST in case to bootstrap
e = getaddrinfo(server, server_port, &hints, &res);
if (getaddrinfo(server, server_port, &hints, &res) != 0) {
cerr << "address/port conversion for " << server << ":"
<< server_port << " failed" << endl;
return (1);
}
if (verbose) {
cout << "Trying \"" << name << "\"\n";
......
......@@ -138,7 +138,7 @@ public:
}
/// \brief Get number of bytes transferred in I/O
size_t getLength() {
size_t getLength() const {
return (ptr_->length_);
}
......@@ -150,7 +150,7 @@ public:
}
/// \brief Get flag to say when callback was called
bool getCalled() {
bool getCalled() const {
return (ptr_->called_);
}
......@@ -162,7 +162,7 @@ public:
}
/// \brief Return instance of callback name
std::string getName() {
std::string getName() const {
return (ptr_->name_);
}
......
......@@ -55,7 +55,7 @@ const char* const LoadQueryTest::DATA_DIR = TEST_DATA_DIR;
class QueryInserter {
public:
QueryInserter(stringstream& stream) : stream_(stream) {}
void operator()(const QueryParam& query) {
void operator()(const QueryParam& query) const {
stream_ << query.first << " " << query.second << endl;
}
private:
......
......@@ -74,7 +74,7 @@ public:
}
void
acceptHandler(const asio::error_code&) {
acceptHandler(const asio::error_code&) const {
}
void
......
......@@ -46,7 +46,7 @@ public:
}
/// \return true if two addresses are equal
bool equal(const IOAddress& address)
bool equal(const IOAddress& address) const
{return (toText() == address.toText());}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment