summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-01-06 14:56:17 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-01-13 10:06:37 (GMT)
commit188fc285c6555eadd3c9d50ab8a94adcade78d89 (patch)
treef02f5e249f8b511300d55a826d3b727f9d8d844f /Swiften/Network/NATPMPInterface.cpp
parentd5cab0388f6a40db6156a993e5f00acf9e63b577 (diff)
downloadswift-contrib-188fc285c6555eadd3c9d50ab8a94adcade78d89.zip
swift-contrib-188fc285c6555eadd3c9d50ab8a94adcade78d89.tar.bz2
Fix more warnings.
Fix sign conversion warnings. Removing heavy unnecessary includes. Change-Id: I992f43065498823098a875badb020c7c84fc4797
Diffstat (limited to 'Swiften/Network/NATPMPInterface.cpp')
-rw-r--r--Swiften/Network/NATPMPInterface.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/Network/NATPMPInterface.cpp b/Swiften/Network/NATPMPInterface.cpp
index 15508b5..c7a41ff 100644
--- a/Swiften/Network/NATPMPInterface.cpp
+++ b/Swiften/Network/NATPMPInterface.cpp
@@ -69,7 +69,7 @@ boost::optional<NATPortMapping> NATPMPInterface::addPortForward(int localPort, i
mapping.getProtocol() == NATPortMapping::TCP ? NATPMP_PROTOCOL_TCP : NATPMP_PROTOCOL_UDP,
boost::numeric_cast<uint16_t>(mapping.getLocalPort()),
boost::numeric_cast<uint16_t>(mapping.getPublicPort()),
- mapping.getLeaseInSeconds()) < 0) {
+ boost::numeric_cast<uint32_t>(mapping.getLeaseInSeconds())) < 0) {
SWIFT_LOG(debug) << "Failed to send NAT-PMP port forwarding request!" << std::endl;
return boost::optional<NATPortMapping>();
}
@@ -87,7 +87,7 @@ boost::optional<NATPortMapping> NATPMPInterface::addPortForward(int localPort, i
} while(r == NATPMP_TRYAGAIN);
if (r == 0) {
- NATPortMapping result(response.pnu.newportmapping.privateport, response.pnu.newportmapping.mappedpublicport, NATPortMapping::TCP, response.pnu.newportmapping.lifetime);
+ NATPortMapping result(response.pnu.newportmapping.privateport, response.pnu.newportmapping.mappedpublicport, NATPortMapping::TCP, boost::numeric_cast<int>(response.pnu.newportmapping.lifetime));
return result;
}
else {
@@ -97,7 +97,7 @@ boost::optional<NATPortMapping> NATPMPInterface::addPortForward(int localPort, i
}
bool NATPMPInterface::removePortForward(const NATPortMapping& mapping) {
- if (sendnewportmappingrequest(&p->natpmp, mapping.getProtocol() == NATPortMapping::TCP ? NATPMP_PROTOCOL_TCP : NATPMP_PROTOCOL_UDP, 0, 0, mapping.getLocalPort()) < 0) {
+ if (sendnewportmappingrequest(&p->natpmp, mapping.getProtocol() == NATPortMapping::TCP ? NATPMP_PROTOCOL_TCP : NATPMP_PROTOCOL_UDP, 0, 0, boost::numeric_cast<uint32_t>(mapping.getLocalPort())) < 0) {
SWIFT_LOG(debug) << "Failed to send NAT-PMP remove forwarding request!" << std::endl;
return false;
}