diff options
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Client/CoreClient.h | 2 | ||||
-rw-r--r-- | Swiften/Config/SConscript | 2 | ||||
-rw-r--r-- | Swiften/Elements/Command.h | 2 | ||||
-rw-r--r-- | Swiften/Elements/Delay.h | 12 | ||||
-rw-r--r-- | Swiften/Elements/Last.h | 2 | ||||
-rw-r--r-- | Swiften/Elements/Replace.h | 2 | ||||
-rw-r--r-- | Swiften/Elements/Whiteboard/WhiteboardOperation.h | 2 | ||||
-rw-r--r-- | Swiften/Examples/BenchTool/BenchTool.cpp | 8 | ||||
-rw-r--r-- | Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp | 12 | ||||
-rw-r--r-- | Swiften/Examples/NetworkTool/main.cpp | 2 | ||||
-rw-r--r-- | Swiften/Examples/SendFile/ReceiveFile.cpp | 6 | ||||
-rw-r--r-- | Swiften/Examples/SendFile/SendFile.cpp | 6 | ||||
-rw-r--r-- | Swiften/Examples/SendMessage/SendMessage.cpp | 16 | ||||
-rw-r--r-- | Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp | 2 | ||||
-rw-r--r-- | Swiften/History/HistoryStorage.h | 2 | ||||
-rw-r--r-- | Swiften/Network/BOSHConnection.cpp | 6 | ||||
-rw-r--r-- | Swiften/Network/TLSConnection.h | 2 | ||||
-rw-r--r-- | Swiften/Parser/ExpatParser.cpp | 5 | ||||
-rw-r--r-- | Swiften/QA/ClientTest/ClientTest.cpp | 12 | ||||
-rw-r--r-- | Swiften/QA/NetworkTest/BoostConnectionTest.cpp | 2 |
20 files changed, 54 insertions, 51 deletions
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h index c9da0eb..16f7cb1 100644 --- a/Swiften/Client/CoreClient.h +++ b/Swiften/Client/CoreClient.h @@ -204,7 +204,7 @@ namespace Swift { /** * Called before onConnected signal is emmitted. */ - virtual void handleConnected() {}; + virtual void handleConnected() {} private: void handleConnectorFinished(boost::shared_ptr<Connection>, boost::shared_ptr<Error> error); diff --git a/Swiften/Config/SConscript b/Swiften/Config/SConscript index f964993..c7ec32e 100644 --- a/Swiften/Config/SConscript +++ b/Swiften/Config/SConscript @@ -6,7 +6,7 @@ def replaceSwiftenPath(input) : return input.replace(env.Dir("#").abspath, "#") def cStringVariable(env, cVar, sconsVar) : - result = "const char* " + cVar + "[] = {\n" + result = "static const char* " + cVar + "[] = {\n" # FIXME: Probably not very robust for var in sconsVar.split(" ") : result += "\t\"" + env.subst(var).replace("\\", "\\\\") + "\",\n" diff --git a/Swiften/Elements/Command.h b/Swiften/Elements/Command.h index 91ae5a3..5454d8d 100644 --- a/Swiften/Elements/Command.h +++ b/Swiften/Elements/Command.h @@ -26,7 +26,7 @@ namespace Swift { struct Note { enum Type {Info, Warn, Error}; - Note(std::string note, Type type) : note(note), type(type) {}; + Note(std::string note, Type type) : note(note), type(type) {} std::string note; Type type; diff --git a/Swiften/Elements/Delay.h b/Swiften/Elements/Delay.h index f7c4570..f4376dc 100644 --- a/Swiften/Elements/Delay.h +++ b/Swiften/Elements/Delay.h @@ -15,14 +15,14 @@ namespace Swift { class Delay : public Payload { public: - Delay() {}; - Delay(const boost::posix_time::ptime& time, const JID& from = JID()) : time_(time), from_(from) {}; + Delay() {} + Delay(const boost::posix_time::ptime& time, const JID& from = JID()) : time_(time), from_(from) {} - const boost::posix_time::ptime& getStamp() const {return time_;}; - void setStamp(const boost::posix_time::ptime& time) {time_ = time;}; + const boost::posix_time::ptime& getStamp() const {return time_;} + void setStamp(const boost::posix_time::ptime& time) {time_ = time;} - const boost::optional<JID>& getFrom() const {return from_;}; - void setFrom(const JID& from) {from_ = from;}; + const boost::optional<JID>& getFrom() const {return from_;} + void setFrom(const JID& from) {from_ = from;} private: boost::posix_time::ptime time_; diff --git a/Swiften/Elements/Last.h b/Swiften/Elements/Last.h index fe0323a..cb7e0c6 100644 --- a/Swiften/Elements/Last.h +++ b/Swiften/Elements/Last.h @@ -11,7 +11,7 @@ namespace Swift { class Last : public Payload { public: - Last(int seconds = 0) : seconds_(seconds) {}; + Last(int seconds = 0) : seconds_(seconds) {} int getSeconds() const {return seconds_;} void setSeconds(int seconds) {seconds_ = seconds;} diff --git a/Swiften/Elements/Replace.h b/Swiften/Elements/Replace.h index 230bce7..96935f5 100644 --- a/Swiften/Elements/Replace.h +++ b/Swiften/Elements/Replace.h @@ -15,7 +15,7 @@ namespace Swift { class Replace : public Payload { public: typedef boost::shared_ptr<Replace> ref; - Replace(const std::string& id = std::string()) : replaceID_(id) {}; + Replace(const std::string& id = std::string()) : replaceID_(id) {} const std::string& getID() const { return replaceID_; } diff --git a/Swiften/Elements/Whiteboard/WhiteboardOperation.h b/Swiften/Elements/Whiteboard/WhiteboardOperation.h index 02c6438..75f6e6a 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardOperation.h @@ -14,7 +14,7 @@ namespace Swift { public: typedef boost::shared_ptr<WhiteboardOperation> ref; public: - virtual ~WhiteboardOperation(){}; + virtual ~WhiteboardOperation(){} std::string getID() const { return id_; diff --git a/Swiften/Examples/BenchTool/BenchTool.cpp b/Swiften/Examples/BenchTool/BenchTool.cpp index 57edbac..9725b7e 100644 --- a/Swiften/Examples/BenchTool/BenchTool.cpp +++ b/Swiften/Examples/BenchTool/BenchTool.cpp @@ -20,10 +20,10 @@ using namespace Swift; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); -int numberOfConnectedClients = 0; -int numberOfInstances = 100; +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); +static int numberOfConnectedClients = 0; +static int numberOfInstances = 100; static void handleConnected() { diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp index 1f49fea..df2a23d 100644 --- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp +++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp @@ -21,13 +21,13 @@ using namespace Swift; enum ExitCodes {OK = 0, CANNOT_CONNECT, CANNOT_AUTH, NO_RESPONSE, DISCO_ERROR}; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); -Client* client = 0; -JID recipient; -int exitCode = CANNOT_CONNECT; -boost::bsignals::connection errorConnection; +static Client* client = 0; +static JID recipient; +static int exitCode = CANNOT_CONNECT; +static boost::bsignals::connection errorConnection; static void handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> /*info*/, ErrorPayload::ref error) { if (!error) { diff --git a/Swiften/Examples/NetworkTool/main.cpp b/Swiften/Examples/NetworkTool/main.cpp index 698ef4c..4ac7e6a 100644 --- a/Swiften/Examples/NetworkTool/main.cpp +++ b/Swiften/Examples/NetworkTool/main.cpp @@ -16,7 +16,7 @@ using namespace Swift; -SimpleEventLoop eventLoop; +static SimpleEventLoop eventLoop; static void handleGetPublicIPRequestResponse(const boost::optional<HostAddress>& result) { if (result) { diff --git a/Swiften/Examples/SendFile/ReceiveFile.cpp b/Swiften/Examples/SendFile/ReceiveFile.cpp index 39b3cc3..bc40a5b 100644 --- a/Swiften/Examples/SendFile/ReceiveFile.cpp +++ b/Swiften/Examples/SendFile/ReceiveFile.cpp @@ -27,10 +27,10 @@ using namespace Swift; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); -int exitCode = 2; +static int exitCode = 2; static const std::string CLIENT_NAME = "Swiften FT Test"; static const std::string CLIENT_NODE = "http://swift.im"; diff --git a/Swiften/Examples/SendFile/SendFile.cpp b/Swiften/Examples/SendFile/SendFile.cpp index a926170..17489de 100644 --- a/Swiften/Examples/SendFile/SendFile.cpp +++ b/Swiften/Examples/SendFile/SendFile.cpp @@ -35,10 +35,10 @@ using namespace Swift; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); -int exitCode = 2; +static int exitCode = 2; class FileSender { public: diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp index 7f7a00d..2a3170f 100644 --- a/Swiften/Examples/SendMessage/SendMessage.cpp +++ b/Swiften/Examples/SendMessage/SendMessage.cpp @@ -18,14 +18,14 @@ using namespace Swift; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); - -Client* client = 0; -JID recipient; -std::string messageBody; -int exitCode = 2; -boost::bsignals::connection errorConnection; +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); + +static Client* client = 0; +static JID recipient; +static std::string messageBody; +static int exitCode = 2; +static boost::bsignals::connection errorConnection; static void handleConnected() { diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp index fce76bc..6781de8 100644 --- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp @@ -33,7 +33,7 @@ using namespace Swift; -boost::mt19937 randomGen; +static boost::mt19937 randomGen; class SOCKS5BytestreamClientSessionTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(SOCKS5BytestreamClientSessionTest); diff --git a/Swiften/History/HistoryStorage.h b/Swiften/History/HistoryStorage.h index fcf28b5..6d24d15 100644 --- a/Swiften/History/HistoryStorage.h +++ b/Swiften/History/HistoryStorage.h @@ -21,7 +21,7 @@ namespace Swift { * Messages are stored using localtime timestamps. */ public: - virtual ~HistoryStorage() {}; + virtual ~HistoryStorage() {} virtual void addMessage(const HistoryMessage& message) = 0; virtual std::vector<HistoryMessage> getMessagesFromDate(const JID& selfJID, const JID& contactJID, HistoryMessage::Type type, const boost::gregorian::date& date) const = 0; diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp index be4360e..23772eb 100644 --- a/Swiften/Network/BOSHConnection.cpp +++ b/Swiften/Network/BOSHConnection.cpp @@ -110,7 +110,7 @@ std::pair<SafeByteArray, size_t> BOSHConnection::createHTTPRequest(const SafeByt header << ":" << *boshURL.getPort(); } header << "\r\n" - /*<< "Accept-Encoding: deflate\r\n"*/ + // << "Accept-Encoding: deflate\r\n" << "Content-Type: text/xml; charset=utf-8\r\n" << "Content-Length: " << size << "\r\n\r\n"; @@ -156,7 +156,7 @@ void BOSHConnection::startStream(const std::string& to, unsigned long long rid) << " rid='" << rid << "'" << " ver='1.6'" << " wait='60'" /* FIXME: we probably want this configurable*/ - /*<< " ack='0'" FIXME: support acks */ + // << " ack='0'" FIXME: support acks << " xml:lang='en'" << " xmlns:xmpp='urn:xmpp:bosh'" << " xmpp:version='1.0'" @@ -170,7 +170,7 @@ void BOSHConnection::startStream(const std::string& to, unsigned long long rid) header << ":" << *boshURL_.getPort(); } header << "\r\n" - /*<< "Accept-Encoding: deflate\r\n"*/ + // << "Accept-Encoding: deflate\r\n" << "Content-Type: text/xml; charset=utf-8\r\n" << "Content-Length: " << contentString.size() << "\r\n\r\n" << contentString; diff --git a/Swiften/Network/TLSConnection.h b/Swiften/Network/TLSConnection.h index a798393..60f73ea 100644 --- a/Swiften/Network/TLSConnection.h +++ b/Swiften/Network/TLSConnection.h @@ -24,7 +24,7 @@ namespace Swift { TLSConnection(Connection::ref connection, TLSContextFactory* tlsFactory); virtual ~TLSConnection(); - virtual void listen() {assert(false);}; + virtual void listen() {assert(false);} virtual void connect(const HostAddressPort& address); virtual void disconnect(); virtual void write(const SafeByteArray& data); diff --git a/Swiften/Parser/ExpatParser.cpp b/Swiften/Parser/ExpatParser.cpp index 8222ae0..2483920 100644 --- a/Swiften/Parser/ExpatParser.cpp +++ b/Swiften/Parser/ExpatParser.cpp @@ -9,10 +9,13 @@ #include <iostream> #include <string> #include <expat.h> +#include <boost/numeric/conversion/cast.hpp> #include <Swiften/Base/String.h> #include <Swiften/Parser/XMLParserClient.h> +#pragma clang diagnostic ignored "-Wdisabled-macro-expansion" + namespace Swift { static const char NAMESPACE_SEPARATOR = '\x01'; @@ -77,7 +80,7 @@ ExpatParser::~ExpatParser() { } bool ExpatParser::parse(const std::string& data) { - bool success = XML_Parse(p->parser_, data.c_str(), data.size(), false) == XML_STATUS_OK; + bool success = XML_Parse(p->parser_, data.c_str(), boost::numeric_cast<int>(data.size()), false) == XML_STATUS_OK; /*if (!success) { std::cout << "ERROR: " << XML_ErrorString(XML_GetErrorCode(p->parser_)) << " while parsing " << data << std::endl; }*/ diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp index dd7e7ed..e88e5ac 100644 --- a/Swiften/QA/ClientTest/ClientTest.cpp +++ b/Swiften/QA/ClientTest/ClientTest.cpp @@ -18,17 +18,17 @@ using namespace Swift; -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); -Client* client = 0; -bool rosterReceived = false; +static Client* client = 0; +static bool rosterReceived = false; enum TestStage { FirstConnect, Reconnect }; -TestStage stage; -ClientOptions options; +static TestStage stage; +static ClientOptions options; static void handleDisconnected(boost::optional<ClientError> e) { std::cout << "Disconnected: " << e << std::endl; diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp index 335f2d2..2accd9c 100644 --- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp +++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp @@ -18,7 +18,7 @@ #include <Swiften/Network/BoostIOServiceThread.h> #include <Swiften/EventLoop/DummyEventLoop.h> -const unsigned char* address = reinterpret_cast<const unsigned char*>("\x41\x63\xde\x89"); +static const unsigned char* address = reinterpret_cast<const unsigned char*>("\x41\x63\xde\x89"); using namespace Swift; |