diff options
author | Kevin Smith <git@kismith.co.uk> | 2014-08-21 08:38:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2014-08-21 08:40:10 (GMT) |
commit | 381b22fc365c27b9cd585f4b78f53ebc698d9f54 (patch) | |
tree | 0ffd89a8be13293c75c7ddfea524c74e0bf87b72 /Swiften | |
parent | 8ec22a9c5591584fd1725ed028d714c51b7509d3 (diff) | |
download | swift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.zip swift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.tar.bz2 |
Clean up compilation errors in Swiften due to boost 1.56
Can no longer implicitly convert boost::optional to bool temporaries. Also fixed assorted uses of cerr where logging was appropriate.
Test-Information:
Swiften compiles against boost 1.56 (link fails for me so far)
Change-Id: Iec058af933a82a987da64291435a475f8b40ef96
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Client/ClientSession.cpp | 5 | ||||
-rw-r--r-- | Swiften/FileTransfer/IBBReceiveSession.cpp | 16 | ||||
-rw-r--r-- | Swiften/FileTransfer/IncomingFileTransferManager.cpp | 5 | ||||
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp | 2 | ||||
-rw-r--r-- | Swiften/Jingle/JingleResponder.cpp | 4 | ||||
-rw-r--r-- | Swiften/Network/BOSHConnection.cpp | 2 | ||||
-rw-r--r-- | Swiften/Network/FakeConnection.cpp | 4 | ||||
-rw-r--r-- | Swiften/Network/NATPMPInterface.cpp | 8 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp | 10 | ||||
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp | 9 |
10 files changed, 42 insertions, 23 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp index 441189e..500299a 100644 --- a/Swiften/Client/ClientSession.cpp +++ b/Swiften/Client/ClientSession.cpp @@ -46,3 +46,2 @@ #include <Swiften/TLS/ServerIdentityVerifier.h> -#include <Swiften/Base/Log.h> @@ -173,3 +172,3 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) { else { - std::cerr << "Warning: Got invalid ack from server" << std::endl; + SWIFT_LOG(warning) << "Got invalid ack from server"; } @@ -177,3 +176,3 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) { else { - std::cerr << "Warning: Ignoring ack" << std::endl; + SWIFT_LOG(warning) << "Ignoring ack"; } diff --git a/Swiften/FileTransfer/IBBReceiveSession.cpp b/Swiften/FileTransfer/IBBReceiveSession.cpp index 3aa6fdc..8cfd95d 100644 --- a/Swiften/FileTransfer/IBBReceiveSession.cpp +++ b/Swiften/FileTransfer/IBBReceiveSession.cpp @@ -35,3 +35,3 @@ class IBBReceiveSession::IBBResponder : public SetResponder<IBB> { if (receivedSize > session->size) { - std::cerr << "Warning: Received more data than expected" << std::endl; + SWIFT_LOG(warning) << "Received more data than expected"; } @@ -41,3 +41,3 @@ class IBBReceiveSession::IBBResponder : public SetResponder<IBB> { else { - SWIFT_LOG(warning) << "Received data out of order" << std::endl; + SWIFT_LOG(warning) << "Received data out of order"; sendError(from, id, ErrorPayload::NotAcceptable, ErrorPayload::Cancel); @@ -47,3 +47,3 @@ class IBBReceiveSession::IBBResponder : public SetResponder<IBB> { else if (ibb->getAction() == IBB::Open) { - SWIFT_LOG(debug) << "IBB open received" << std::endl; + SWIFT_LOG(debug) << "IBB open received"; sendResponse(from, id, IBB::ref()); @@ -51,3 +51,3 @@ class IBBReceiveSession::IBBResponder : public SetResponder<IBB> { else if (ibb->getAction() == IBB::Close) { - SWIFT_LOG(debug) << "IBB close received" << std::endl; + SWIFT_LOG(debug) << "IBB close received"; sendResponse(from, id, IBB::ref()); @@ -57,3 +57,3 @@ class IBBReceiveSession::IBBResponder : public SetResponder<IBB> { } - SWIFT_LOG(debug) << "wrong from/sessionID: " << from << " == " << session->from << " / " <<ibb->getStreamID() << " == " << session->id << std::endl; + SWIFT_LOG(debug) << "wrong from/sessionID: " << from << " == " << session->from << " / " <<ibb->getStreamID() << " == " << session->id; return false; @@ -89,3 +89,3 @@ IBBReceiveSession::~IBBReceiveSession() { if (active) { - SWIFT_LOG(warning) << "Session still active" << std::endl; + SWIFT_LOG(warning) << "Session still active"; } @@ -95,3 +95,3 @@ IBBReceiveSession::~IBBReceiveSession() { void IBBReceiveSession::start() { - SWIFT_LOG(debug) << "receive session started" << std::endl; + SWIFT_LOG(debug) << "receive session started"; active = true; @@ -101,3 +101,3 @@ void IBBReceiveSession::start() { void IBBReceiveSession::stop() { - SWIFT_LOG(debug) << "receive session stopped" << std::endl; + SWIFT_LOG(debug) << "receive session stopped"; responder->stop(); diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.cpp b/Swiften/FileTransfer/IncomingFileTransferManager.cpp index d40c5de..d8c4f89 100644 --- a/Swiften/FileTransfer/IncomingFileTransferManager.cpp +++ b/Swiften/FileTransfer/IncomingFileTransferManager.cpp @@ -1,3 +1,3 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. @@ -10,2 +10,3 @@ +#include <Swiften/Base/Log.h> #include <Swiften/Elements/JingleDescription.h> @@ -51,3 +52,3 @@ bool IncomingFileTransferManager::handleIncomingJingleSession( else { - std::cerr << "Received a file-transfer request with no description or more than one file!" << std::endl; + SWIFT_LOG(warning) << "Received a file-transfer request with no description or more than one file."; session->sendTerminate(JinglePayload::Reason::FailedApplication); diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp index f393c8d..cb34c58 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp @@ -96,3 +96,3 @@ void SOCKS5BytestreamServerSession::handleDisconnected(const boost::optional<Con SWIFT_LOG(debug) << (error ? (error == Connection::ReadError ? "Read Error" : "Write Error") : "No Error") << std::endl; - finish(error); + finish(error ? true : false); } diff --git a/Swiften/Jingle/JingleResponder.cpp b/Swiften/Jingle/JingleResponder.cpp index 4c82f51..e963ef6 100644 --- a/Swiften/Jingle/JingleResponder.cpp +++ b/Swiften/Jingle/JingleResponder.cpp @@ -1,3 +1,3 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. @@ -53,3 +53,3 @@ bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std else { - std::cerr << "WARN: Didn't find jingle session!" << std::endl; + SWIFT_LOG(warning) << "Didn't find jingle session!"; // TODO: Add jingle-specific error diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp index bde689e..28e27d5 100644 --- a/Swiften/Network/BOSHConnection.cpp +++ b/Swiften/Network/BOSHConnection.cpp @@ -287,3 +287,3 @@ void BOSHConnection::handleDisconnected(const boost::optional<Connection::Error> cancelConnector(); - onDisconnected(error); + onDisconnected(error ? true : false); sid_ = ""; diff --git a/Swiften/Network/FakeConnection.cpp b/Swiften/Network/FakeConnection.cpp index be5555c..a84c92e 100644 --- a/Swiften/Network/FakeConnection.cpp +++ b/Swiften/Network/FakeConnection.cpp @@ -1,3 +1,3 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. @@ -45,3 +45,3 @@ void FakeConnection::connect(const HostAddressPort& address) { eventLoop->postEvent( - boost::bind(boost::ref(onConnectFinished), error), + boost::bind(boost::ref(onConnectFinished), error ? true : false), shared_from_this()); diff --git a/Swiften/Network/NATPMPInterface.cpp b/Swiften/Network/NATPMPInterface.cpp index c7a41ff..dcae641 100644 --- a/Swiften/Network/NATPMPInterface.cpp +++ b/Swiften/Network/NATPMPInterface.cpp @@ -6,2 +6,8 @@ +/* +* Copyright (c) 2014 Kevin Smith +* Licensed under the GNU General Public License v3. +* See Documentation/Licenses/GPLv3.txt for more information. +*/ + #include <Swiften/Network/NATPMPInterface.h> @@ -34,3 +40,3 @@ NATPMPInterface::~NATPMPInterface() { bool NATPMPInterface::isAvailable() { - return getPublicIP(); + return getPublicIP() ? true : false; } diff --git a/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp b/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp index 14a80e6..7be4c26 100644 --- a/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp @@ -6,2 +6,8 @@ +/* +* Copyright (c) 2014 Kevin Smith +* Licensed under the GNU General Public License v3. +* See Documentation/Licenses/GPLv3.txt for more information. +*/ + #include <boost/lexical_cast.hpp> @@ -27,3 +33,3 @@ namespace Swift { } else { - std::cerr << "Unknown S5B mode; falling back to defaul!" << std::endl; + SWIFT_LOG(warning) << "Unknown S5B mode; falling back to defaul!"; getPayloadInternal()->setMode(JingleS5BTransportPayload::TCPMode); @@ -83,3 +89,3 @@ namespace Swift { } else { - std::cerr << "Unknown candidate type; falling back to default!" << std::endl; + SWIFT_LOG(warning) << "Unknown candidate type; falling back to default!"; return JingleS5BTransportPayload::Candidate::DirectType; diff --git a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp index 0e21812..6ba264a 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.cpp @@ -6,2 +6,8 @@ +/* +* Copyright (c) 2014 Kevin Smith +* Licensed under the GNU General Public License v3. +* See Documentation/Licenses/GPLv3.txt for more information. +*/ + #include <Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h> @@ -12,2 +18,3 @@ +#include <Swiften/Base/Log.h> #include <Swiften/Base/foreach.h> @@ -71,3 +78,3 @@ std::string JingleContentPayloadSerializer::creatorToString(JingleContentPayload case JingleContentPayload::UnknownCreator: - std::cerr << "Serializing unknown creator value." << std::endl; + SWIFT_LOG(error) << "Serializing unknown creator value."; return "ERROR ERROR ERROR"; |