Commit e2129dd7 authored by Francis Dupont's avatar Francis Dupont
Browse files

[4024] Fixed c++11 detected errors

parent 4a9cb30e
......@@ -408,14 +408,14 @@ public:
///
/// @return returns true if the process instance exists.
bool checkProcess() {
return (getController()->process_);
return (getController()->process_.get() != 0);
}
/// @brief Tests the existence of the Controller's IOService.
///
/// @return returns true if the IOService exists.
bool checkIOService() {
return (getController()->io_service_);
return (getController()->io_service_.get() != 0);
}
/// @brief Gets the Controller's IOService.
......
......@@ -136,7 +136,7 @@ public:
if (getForwardDomain()) {
initServerSelection(getForwardDomain());
selectNextServer();
return (getCurrentServer());
return (getCurrentServer().get() != 0);
}
return (false);
......@@ -150,7 +150,7 @@ public:
if (getReverseDomain()) {
initServerSelection(getReverseDomain());
selectNextServer();
return (getCurrentServer());
return (getCurrentServer().get() != 0);
}
return (false);
......
......@@ -136,7 +136,7 @@ public:
if (getForwardDomain()) {
initServerSelection(getForwardDomain());
selectNextServer();
return (getCurrentServer());
return (getCurrentServer().get() != 0);
}
return (false);
......@@ -150,7 +150,7 @@ public:
if (getReverseDomain()) {
initServerSelection(getReverseDomain());
selectNextServer();
return (getCurrentServer());
return (getCurrentServer().get() != 0);
}
return (false);
......
......@@ -99,7 +99,7 @@ public:
if (getForwardDomain()) {
initServerSelection(getForwardDomain());
selectNextServer();
return (getCurrentServer());
return (getCurrentServer().get() != 0);
}
return (false);
......
......@@ -194,7 +194,7 @@ void
Dhcp4Client::createLease(const asiolink::IOAddress& addr,
const uint32_t valid_lft) {
Lease4 lease(addr, hwaddr_, 0, 0, valid_lft, valid_lft / 2, valid_lft,
time(NULL), false, false, "");
time(NULL), 0, false, false, "");
config_.lease_ = lease;
}
......
......@@ -146,23 +146,23 @@ Dhcpv4SrvTest::basicOptionsPresent(const Pkt4Ptr& pkt) {
errmsg << "option missing in the response";
if (!pkt->getOption(DHO_DOMAIN_NAME)) {
return (::testing::AssertionFailure(::testing::Message()
<< "domain-name " << errmsg));
<< "domain-name " << errmsg.str()));
} else if (!pkt->getOption(DHO_DOMAIN_NAME_SERVERS)) {
return (::testing::AssertionFailure(::testing::Message()
<< "dns-servers " << errmsg));
<< "dns-servers " << errmsg.str()));
} else if (!pkt->getOption(DHO_SUBNET_MASK)) {
return (::testing::AssertionFailure(::testing::Message()
<< "subnet-mask " << errmsg));
<< "subnet-mask " << errmsg.str()));
} else if (!pkt->getOption(DHO_ROUTERS)) {
return (::testing::AssertionFailure(::testing::Message() << "routers "
<< errmsg));
<< errmsg.str()));
} else if (!pkt->getOption(DHO_DHCP_LEASE_TIME)) {
return (::testing::AssertionFailure(::testing::Message() <<
"dhcp-lease-time " << errmsg));
"dhcp-lease-time " << errmsg.str()));
}
return (::testing::AssertionSuccess());
......@@ -175,23 +175,23 @@ Dhcpv4SrvTest::noBasicOptions(const Pkt4Ptr& pkt) {
errmsg << "option present in the response";
if (pkt->getOption(DHO_DOMAIN_NAME)) {
return (::testing::AssertionFailure(::testing::Message()
<< "domain-name " << errmsg));
<< "domain-name " << errmsg.str()));
} else if (pkt->getOption(DHO_DOMAIN_NAME_SERVERS)) {
return (::testing::AssertionFailure(::testing::Message()
<< "dns-servers " << errmsg));
<< "dns-servers " << errmsg.str()));
} else if (pkt->getOption(DHO_SUBNET_MASK)) {
return (::testing::AssertionFailure(::testing::Message()
<< "subnet-mask " << errmsg));
<< "subnet-mask " << errmsg.str()));
} else if (pkt->getOption(DHO_ROUTERS)) {
return (::testing::AssertionFailure(::testing::Message() << "routers "
<< errmsg));
<< errmsg.str()));
} else if (pkt->getOption(DHO_DHCP_LEASE_TIME)) {
return (::testing::AssertionFailure(::testing::Message()
<< "dhcp-lease-time " << errmsg));
<< "dhcp-lease-time " << errmsg.str()));
}
return (::testing::AssertionSuccess());
......@@ -203,11 +203,11 @@ Dhcpv4SrvTest::requestedOptionsPresent(const Pkt4Ptr& pkt) {
errmsg << "option missing in the response";
if (!pkt->getOption(DHO_LOG_SERVERS)) {
return (::testing::AssertionFailure(::testing::Message()
<< "log-servers " << errmsg));
<< "log-servers " << errmsg.str()));
} else if (!pkt->getOption(DHO_COOKIE_SERVERS)) {
return (::testing::AssertionFailure(::testing::Message()
<< "cookie-servers " << errmsg));
<< "cookie-servers " << errmsg.str()));
}
return (::testing::AssertionSuccess());
......@@ -219,11 +219,11 @@ Dhcpv4SrvTest::noRequestedOptions(const Pkt4Ptr& pkt) {
errmsg << "option present in the response";
if (pkt->getOption(DHO_LOG_SERVERS)) {
return (::testing::AssertionFailure(::testing::Message()
<< "log-servers " << errmsg));
<< "log-servers " << errmsg.str()));
} else if (pkt->getOption(DHO_COOKIE_SERVERS)) {
return (::testing::AssertionFailure(::testing::Message()
<< "cookie-servers " << errmsg));
<< "cookie-servers " << errmsg.str()));
}
return (::testing::AssertionSuccess());
......
......@@ -261,7 +261,8 @@ PktFilterBPF::openSocket(Iface& iface,
// All other errors are fatal, so close the fallback socket
// and throw.
close(fallback);
isc_throw(SocketConfigError, "Failed to open BPF device " << s);
isc_throw(SocketConfigError,
"Failed to open BPF device " << s.str());
}
}
......
......@@ -469,7 +469,7 @@ CfgHosts::add4(const HostPtr& host) {
} else if (duid) {
s << "for HW address: " << duid->toText();
}
isc_throw(BadValue, "specified reservation " << s
isc_throw(BadValue, "specified reservation " << s.str()
<< " must include at least one resource, i.e. "
"hostname, IPv4 address or IPv6 address/prefix");
}
......
......@@ -220,6 +220,10 @@ LFCSetup::getExitStatus() const {
return (process_->getExitStatus(pid_));
}
// Explicit definition of class static constants. Values are given in the
// declaration so they're not needed here.
const int Memfile_LeaseMgr::MAJOR_VERSION;
const int Memfile_LeaseMgr::MINOR_VERSION;
Memfile_LeaseMgr::Memfile_LeaseMgr(const ParameterMap& parameters)
: LeaseMgr(parameters),
......
......@@ -201,7 +201,7 @@ protected:
isc_throw(isc::Unexpected, "failed to create UNIX domain socket" <<
strerror(errno));
}
if (bind(listen_fd_, convertSockAddr(&test_un_), test_un_len_) == -1) {
if (::bind(listen_fd_, convertSockAddr(&test_un_), test_un_len_) == -1) {
isc_throw(isc::Unexpected, "failed to bind UNIX domain socket" <<
strerror(errno));
}
......
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