From 6cedffb9368eeb05e199f7df80c4735f63735a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Mon, 31 Dec 2012 16:29:38 +0100 Subject: Fix more warnings. Change-Id: I0fc27a08adb6aecd5c5775a52b7fe48570ed526a diff --git a/3rdParty/Lua/SConscript b/3rdParty/Lua/SConscript index 68f4e36..0c1d075 100644 --- a/3rdParty/Lua/SConscript +++ b/3rdParty/Lua/SConscript @@ -36,7 +36,10 @@ if env.get("LUA_BUNDLED", False) : myenv.Append(CFLAGS = ["-x", "c++"]) # Remove warn flags - myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]]) + myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if not flag.startswith("-W")]) + if "clang" in env["CC"] : + myenv.Append(CCFLAGS = ["-Wno-unknown-warning-option", "-Wno-empty-body"]) + myenv.MergeFlags(myenv["LUA_FLAGS"]) myenv.StaticLibrary("Swiften_Lua", [ "src/lapi.c", diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot index 2ca5281..e6e1661 100644 --- a/BuildTools/SCons/SConscript.boot +++ b/BuildTools/SCons/SConscript.boot @@ -226,6 +226,7 @@ else : if "clang" in env["CXX"] : env.Append(CXXFLAGS = [ "-Weverything", + "-Wno-unknown-warning-option", # To stay compatible between CLang versions "-Wno-sign-conversion", # We have this a lot. Not sure if we should allow this or not. "-Wno-weak-vtables", # Virtually none of our elements have outlined methods "-Wno-shadow", # Also warns for shadowing on constructor arguments, which we do a lot diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp index deeb852..8b81489 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot2.cpp @@ -12,7 +12,7 @@ using namespace Swift; using namespace boost; -Client* client; +static Client* client; void handleConnected(); void handleMessageReceived(Message::ref message); diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp index d799d16..51ba48d 100644 --- a/Sluift/sluift.cpp +++ b/Sluift/sluift.cpp @@ -36,8 +36,8 @@ static int globalTimeout = 30000; * Helper classes ******************************************************************************/ -SimpleEventLoop eventLoop; -BoostNetworkFactories networkFactories(&eventLoop); +static SimpleEventLoop eventLoop; +static BoostNetworkFactories networkFactories(&eventLoop); class SluiftClient { diff --git a/SwifTools/UnitTest/LastLineTrackerTest.cpp b/SwifTools/UnitTest/LastLineTrackerTest.cpp index a7046ed..97790e5 100644 --- a/SwifTools/UnitTest/LastLineTrackerTest.cpp +++ b/SwifTools/UnitTest/LastLineTrackerTest.cpp @@ -21,7 +21,7 @@ class LastLineTrackerTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); public: LastLineTrackerTest () { - }; + } void testFocusNormal() { LastLineTracker testling; testling.setHasFocus(true); diff --git a/SwifTools/UnitTest/TabCompleteTest.cpp b/SwifTools/UnitTest/TabCompleteTest.cpp index 0466484..cdb0296 100644 --- a/SwifTools/UnitTest/TabCompleteTest.cpp +++ b/SwifTools/UnitTest/TabCompleteTest.cpp @@ -24,7 +24,7 @@ class TabCompleteTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); public: - TabCompleteTest() {}; + TabCompleteTest() {} void setUp() { completer_ = TabComplete(); diff --git a/Swift/Controllers/Chat/ChatControllerBase.h b/Swift/Controllers/Chat/ChatControllerBase.h index b26af02..02cf9f6 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.h +++ b/Swift/Controllers/Chat/ChatControllerBase.h @@ -51,7 +51,7 @@ namespace Swift { void replaceMessage(const std::string& message, const std::string& id, const boost::posix_time::ptime& time); virtual void setOnline(bool online); virtual void setEnabled(bool enabled); - virtual void setToJID(const JID& jid) {toJID_ = jid;}; + virtual void setToJID(const JID& jid) {toJID_ = jid;} /** Used for determining when something is recent.*/ boost::signal onActivity; boost::signal onUnreadCountChanged; @@ -65,15 +65,15 @@ namespace Swift { /** * Pass the Message appended, and the stanza used to send it. */ - virtual void postSendMessage(const std::string&, boost::shared_ptr) {}; + virtual void postSendMessage(const std::string&, boost::shared_ptr) {} virtual std::string senderDisplayNameFromMessage(const JID& from) = 0; virtual bool isIncomingMessageFromMe(boost::shared_ptr) = 0; - virtual void preHandleIncomingMessage(boost::shared_ptr) {}; - virtual void postHandleIncomingMessage(boost::shared_ptr) {}; - virtual void preSendMessageRequest(boost::shared_ptr) {}; + virtual void preHandleIncomingMessage(boost::shared_ptr) {} + virtual void postHandleIncomingMessage(boost::shared_ptr) {} + virtual void preSendMessageRequest(boost::shared_ptr) {} virtual bool isFromContact(const JID& from); virtual boost::optional getMessageTimestamp(boost::shared_ptr) const = 0; - virtual void dayTicked() {}; + virtual void dayTicked() {} virtual void handleBareJIDCapsChanged(const JID& jid) = 0; std::string getErrorMessage(boost::shared_ptr); virtual void setContactIsReceivingPresence(bool /* isReceivingPresence */) {} diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h index 63893d0..7e81f3d 100644 --- a/Swift/Controllers/Chat/MUCController.h +++ b/Swift/Controllers/Chat/MUCController.h @@ -37,7 +37,7 @@ namespace Swift { enum JoinPart {Join, Part, JoinThenPart, PartThenJoin}; struct NickJoinPart { - NickJoinPart(const std::string& nick, JoinPart type) : nick(nick), type(type) {}; + NickJoinPart(const std::string& nick, JoinPart type) : nick(nick), type(type) {} std::string nick; JoinPart type; }; diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp index 482b19c..aab582c 100644 --- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp @@ -111,7 +111,7 @@ public: manager_ = new ChatsManager(jid_, stanzaChannel_, iqRouter_, eventController_, chatWindowFactory_, joinMUCWindowFactory_, nickResolver_, presenceOracle_, directedPresenceSender_, uiEventStream_, chatListWindowFactory_, true, NULL, mucRegistry_, entityCapsManager_, mucManager_, mucSearchWindowFactory_, profileSettings_, ftOverview_, xmppRoster_, false, settings_, NULL, wbManager_); manager_->setAvatarManager(avatarManager_); - }; + } void tearDown() { //delete chatListWindowFactory diff --git a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp index 4f37229..ab83bc2 100644 --- a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp @@ -65,7 +65,7 @@ public: muc_ = boost::make_shared(stanzaChannel_, iqRouter_, directedPresenceSender_, mucJID_, mucRegistry_); mocks_->ExpectCall(chatWindowFactory_, ChatWindowFactory::createChatWindow).With(muc_->getJID(), uiEventStream_).Return(window_); controller_ = new MUCController (self_, muc_, boost::optional(), nick_, stanzaChannel_, iqRouter_, chatWindowFactory_, presenceOracle_, avatarManager_, uiEventStream_, false, timerFactory, eventController_, entityCapsProvider_, NULL, NULL, mucRegistry_); - }; + } void tearDown() { delete entityCapsProvider_; diff --git a/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h b/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h index 5bbd490..5fa264d 100644 --- a/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h +++ b/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h @@ -12,12 +12,12 @@ namespace Swift { class MockChatListWindow : public ChatListWindow { public: - MockChatListWindow() {}; - virtual ~MockChatListWindow() {}; + MockChatListWindow() {} + virtual ~MockChatListWindow() {} void addMUCBookmark(const MUCBookmark& /*bookmark*/) {} void removeMUCBookmark(const MUCBookmark& /*bookmark*/) {} - void addWhiteboardSession(const ChatListWindow::Chat& /*chat*/) {}; - void removeWhiteboardSession(const JID& /*jid*/) {}; + void addWhiteboardSession(const ChatListWindow::Chat& /*chat*/) {} + void removeWhiteboardSession(const JID& /*jid*/) {} void setBookmarksEnabled(bool /*enabled*/) {} void setRecents(const std::list& /*recents*/) {} void setUnreadCount(int /*unread*/) {} diff --git a/Swift/Controllers/DummySoundPlayer.h b/Swift/Controllers/DummySoundPlayer.h index 36dcb28..b91192c 100644 --- a/Swift/Controllers/DummySoundPlayer.h +++ b/Swift/Controllers/DummySoundPlayer.h @@ -11,6 +11,6 @@ namespace Swift { class DummySoundPlayer : public SoundPlayer { public: - void playSound(SoundEffect sound) {}; + void playSound(SoundEffect sound) {} }; } diff --git a/Swift/Controllers/DummySystemTray.h b/Swift/Controllers/DummySystemTray.h index 41da4cd..451588e 100644 --- a/Swift/Controllers/DummySystemTray.h +++ b/Swift/Controllers/DummySystemTray.h @@ -11,8 +11,8 @@ namespace Swift { class DummySystemTray : public SystemTray { public: - void setUnreadMessages(bool some) {}; - void setStatusType(StatusShow::Type type) {}; + void setUnreadMessages(bool some) {} + void setStatusType(StatusShow::Type type) {} void setConnecting() {} }; } diff --git a/Swift/Controllers/Roster/Roster.h b/Swift/Controllers/Roster/Roster.h index 2fcfba5..74547d6 100644 --- a/Swift/Controllers/Roster/Roster.h +++ b/Swift/Controllers/Roster/Roster.h @@ -36,10 +36,10 @@ class Roster { void applyOnItems(const RosterItemOperation& operation); void applyOnAllItems(const RosterItemOperation& operation); void applyOnItem(const RosterItemOperation& operation, const JID& jid); - void addFilter(RosterFilter *filter) {filters_.push_back(filter);filterAll();}; + void addFilter(RosterFilter *filter) {filters_.push_back(filter);filterAll();} void removeFilter(RosterFilter *filter); GroupRosterItem* getRoot(); - std::vector getFilters() {return filters_;}; + std::vector getFilters() {return filters_;} boost::signal onChildrenChanged; boost::signal onGroupAdded; boost::signal onDataChanged; diff --git a/Swift/Controllers/Roster/RosterController.h b/Swift/Controllers/Roster/RosterController.h index 5e40124..ec07574 100644 --- a/Swift/Controllers/Roster/RosterController.h +++ b/Swift/Controllers/Roster/RosterController.h @@ -45,7 +45,7 @@ namespace Swift { RosterController(const JID& jid, XMPPRoster* xmppRoster, AvatarManager* avatarManager, MainWindowFactory* mainWindowFactory, NickManager* nickManager, NickResolver* nickResolver, PresenceOracle* presenceOracle, SubscriptionManager* subscriptionManager, EventController* eventController, UIEventStream* uiEventStream, IQRouter* iqRouter_, SettingsProvider* settings, EntityCapsProvider* entityCapsProvider, FileTransferOverview* fileTransferOverview); ~RosterController(); void showRosterWindow(); - MainWindow* getWindow() {return mainWindow_;}; + MainWindow* getWindow() {return mainWindow_;} boost::signal onChangeStatusRequest; boost::signal onSignOutRequest; void handleAvatarChanged(const JID& jid); diff --git a/Swift/Controllers/Roster/RosterItemOperation.h b/Swift/Controllers/Roster/RosterItemOperation.h index 691c8ef..f1dff8d 100644 --- a/Swift/Controllers/Roster/RosterItemOperation.h +++ b/Swift/Controllers/Roster/RosterItemOperation.h @@ -12,10 +12,10 @@ namespace Swift { class RosterItemOperation { public: - RosterItemOperation(bool requiresLookup = false, const JID& lookupJID = JID()) : requiresLookup_(requiresLookup), lookupJID_(lookupJID) {}; - virtual ~RosterItemOperation() {}; - bool requiresLookup() const {return requiresLookup_;}; - const JID& lookupJID() const {return lookupJID_;}; + RosterItemOperation(bool requiresLookup = false, const JID& lookupJID = JID()) : requiresLookup_(requiresLookup), lookupJID_(lookupJID) {} + virtual ~RosterItemOperation() {} + bool requiresLookup() const {return requiresLookup_;} + const JID& lookupJID() const {return lookupJID_;} /** * This is called when iterating over possible subjects, so must check it's * applying to the right items - even if requiresLookup() is true an item diff --git a/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp b/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp index fbee894..e439c78 100644 --- a/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp +++ b/Swift/Controllers/Roster/UnitTest/RosterControllerTest.cpp @@ -84,7 +84,7 @@ class RosterControllerTest : public CppUnit::TestFixture { ftOverview_ = new FileTransferOverview(ftManager_); rosterController_ = new RosterController(jid_, xmppRoster_, avatarManager_, mainWindowFactory_, nickManager_, nickResolver_, presenceOracle_, subscriptionManager_, eventController_, uiEventStream_, router_, settings_, entityCapsManager_, ftOverview_); mainWindow_ = mainWindowFactory_->last; - }; + } void tearDown() { delete rosterController_; @@ -105,7 +105,7 @@ class RosterControllerTest : public CppUnit::TestFixture { delete uiEventStream_; delete settings_; delete xmppRoster_; - }; + } GroupRosterItem* groupChild(size_t i) { return dynamic_cast(CHILDREN[i]); @@ -133,7 +133,7 @@ class RosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(item2); CPPUNIT_ASSERT_EQUAL(presence->getStatus(), item2->getStatusText()); - }; + } void testHighestPresence() { std::vector groups; @@ -153,7 +153,7 @@ class RosterControllerTest : public CppUnit::TestFixture { ContactRosterItem* item = dynamic_cast(dynamic_cast(CHILDREN[0])->getChildren()[0]); CPPUNIT_ASSERT(item); CPPUNIT_ASSERT_EQUAL(highPresence->getStatus(), item->getStatusText()); - }; + } void testNotHighestPresence() { std::vector groups; @@ -173,7 +173,7 @@ class RosterControllerTest : public CppUnit::TestFixture { ContactRosterItem* item = dynamic_cast(dynamic_cast(CHILDREN[0])->getChildren()[0]); CPPUNIT_ASSERT(item); CPPUNIT_ASSERT_EQUAL(highPresence->getStatus(), item->getStatusText()); - }; + } void testUnavailablePresence() { std::vector groups; @@ -215,7 +215,7 @@ class RosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(lowPresenceOffline->getStatus(), high->getStatus()); CPPUNIT_ASSERT_EQUAL(StatusShow::None, item->getStatusShow()); CPPUNIT_ASSERT_EQUAL(lowPresenceOffline->getStatus(), item->getStatusText()); - }; + } void testAdd() { std::vector groups; @@ -225,7 +225,7 @@ class RosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(2, static_cast(CHILDREN.size())); //CPPUNIT_ASSERT_EQUAL(std::string("Bob"), xmppRoster_->getNameForJID(JID("foo@bar.com"))); - }; + } void testAddSubscription() { std::vector groups; @@ -242,7 +242,7 @@ class RosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(CHILDREN.size())); CPPUNIT_ASSERT_EQUAL(1, static_cast(groupChild(0)->getChildren().size())); - }; + } void testReceiveRename() { std::vector groups; @@ -256,7 +256,7 @@ class RosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(CHILDREN.size())); CPPUNIT_ASSERT_EQUAL(1, static_cast(groupChild(0)->getChildren().size())); CPPUNIT_ASSERT_EQUAL(std::string("NewName"), groupChild(0)->getChildren()[0]->getDisplayName()); - }; + } void testReceiveRegroup() { std::vector oldGroups; @@ -282,7 +282,7 @@ class RosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(1, static_cast(groupChild(0)->getChildren().size())); CPPUNIT_ASSERT_EQUAL(std::string("new name"), groupChild(0)->getChildren()[0]->getDisplayName()); CPPUNIT_ASSERT_EQUAL(std::string("Best Group"), groupChild(0)->getDisplayName()); - }; + } void testSendRename() { JID jid("testling@wonderland.lit"); diff --git a/Swift/Controllers/Settings/DummySettingsProvider.h b/Swift/Controllers/Settings/DummySettingsProvider.h index 1d6059f..0183dd3 100644 --- a/Swift/Controllers/Settings/DummySettingsProvider.h +++ b/Swift/Controllers/Settings/DummySettingsProvider.h @@ -17,25 +17,25 @@ class DummySettingsProvider : public SettingsProvider { virtual ~DummySettingsProvider() {} virtual std::string getSetting(const Setting& setting) { return stringValues.find(setting.getKey()) != stringValues.end() ? stringValues[setting.getKey()] : setting.getDefaultValue(); - }; + } virtual void storeSetting(const Setting& setting, const std::string& value) { stringValues[setting.getKey()] = value; onSettingChanged(setting.getKey()); - }; + } virtual bool getSetting(const Setting& setting) { return boolValues.find(setting.getKey()) != boolValues.end() ? boolValues[setting.getKey()] : setting.getDefaultValue(); - }; + } virtual void storeSetting(const Setting& setting, const bool& value) { boolValues[setting.getKey()] = value; onSettingChanged(setting.getKey()); - }; + } virtual int getSetting(const Setting& setting) { return intValues.find(setting.getKey()) != intValues.end() ? intValues[setting.getKey()] : setting.getDefaultValue(); - }; + } virtual void storeSetting(const Setting& setting, const int& value) { intValues[setting.getKey()] = value; onSettingChanged(setting.getKey()); - }; + } virtual std::vector getAvailableProfiles() {return std::vector();} virtual void createProfile(const std::string& ) {} virtual void removeProfile(const std::string& ) {} diff --git a/Swift/Controllers/Settings/UnitTest/SettingsProviderHierachyTest.cpp b/Swift/Controllers/Settings/UnitTest/SettingsProviderHierachyTest.cpp index aa4d14f..2b637a0 100644 --- a/Swift/Controllers/Settings/UnitTest/SettingsProviderHierachyTest.cpp +++ b/Swift/Controllers/Settings/UnitTest/SettingsProviderHierachyTest.cpp @@ -26,7 +26,7 @@ class SettingsProviderHierachyTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); public: - SettingsProviderHierachyTest() : setting1("somekey", 42) {}; + SettingsProviderHierachyTest() : setting1("somekey", 42) {} void setUp() { bottom = new DummySettingsProvider(); diff --git a/Swift/Controllers/SoundEventController.h b/Swift/Controllers/SoundEventController.h index c6dec6f..842125d 100644 --- a/Swift/Controllers/SoundEventController.h +++ b/Swift/Controllers/SoundEventController.h @@ -18,7 +18,7 @@ namespace Swift { public: SoundEventController(EventController* eventController, SoundPlayer* soundPlayer, SettingsProvider* settings); void setPlaySounds(bool playSounds); - bool getSoundEnabled() {return playSounds_;}; + bool getSoundEnabled() {return playSounds_;} private: void handleSettingChanged(const std::string& settingPath); void handleEventQueueEventAdded(boost::shared_ptr event); diff --git a/Swift/Controllers/SoundPlayer.h b/Swift/Controllers/SoundPlayer.h index b71d759..19bf8b6 100644 --- a/Swift/Controllers/SoundPlayer.h +++ b/Swift/Controllers/SoundPlayer.h @@ -9,7 +9,7 @@ namespace Swift { class SoundPlayer { public: - virtual ~SoundPlayer() {}; + virtual ~SoundPlayer() {} enum SoundEffect{MessageReceived}; virtual void playSound(SoundEffect sound) = 0; }; diff --git a/Swift/Controllers/SystemTray.h b/Swift/Controllers/SystemTray.h index 736b1fa..b71a783 100644 --- a/Swift/Controllers/SystemTray.h +++ b/Swift/Controllers/SystemTray.h @@ -11,7 +11,7 @@ namespace Swift { class SystemTray { public: - virtual ~SystemTray(){}; + virtual ~SystemTray(){} virtual void setUnreadMessages(bool some) = 0; virtual void setStatusType(StatusShow::Type type) = 0; virtual void setConnecting() = 0; diff --git a/Swift/Controllers/Translator.cpp b/Swift/Controllers/Translator.cpp index 82fc46e..b7766ca 100644 --- a/Swift/Controllers/Translator.cpp +++ b/Swift/Controllers/Translator.cpp @@ -10,7 +10,7 @@ namespace Swift { -struct DefaultTranslator : public Translator { +static struct DefaultTranslator : public Translator { virtual std::string translate(const std::string& text, const std::string&) { return text; } diff --git a/Swift/Controllers/UIEvents/AddContactUIEvent.h b/Swift/Controllers/UIEvents/AddContactUIEvent.h index d92d3af..6b70b76 100644 --- a/Swift/Controllers/UIEvents/AddContactUIEvent.h +++ b/Swift/Controllers/UIEvents/AddContactUIEvent.h @@ -14,15 +14,15 @@ namespace Swift { class AddContactUIEvent : public UIEvent { public: - AddContactUIEvent(const JID& jid, const std::string& name, const std::set& groups) : jid_(jid), name_(name), groups_(groups) {}; + AddContactUIEvent(const JID& jid, const std::string& name, const std::set& groups) : jid_(jid), name_(name), groups_(groups) {} const std::string& getName() const { return name_; - }; + } const JID& getJID() const { return jid_; - }; + } const std::set& getGroups() const { return groups_; diff --git a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h index 210da3e..df01d6c 100644 --- a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h @@ -14,7 +14,7 @@ namespace Swift { class AddMUCBookmarkUIEvent : public UIEvent { public: - AddMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {}; + AddMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {} const MUCBookmark& getBookmark() { return bookmark; } private: diff --git a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h index 2b10f09..7723d89 100644 --- a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h @@ -14,10 +14,10 @@ namespace Swift { class EditMUCBookmarkUIEvent : public UIEvent { public: - EditMUCBookmarkUIEvent(const MUCBookmark& oldBookmark, const MUCBookmark& newBookmark) : oldBookmark(oldBookmark) , newBookmark(newBookmark) {}; + EditMUCBookmarkUIEvent(const MUCBookmark& oldBookmark, const MUCBookmark& newBookmark) : oldBookmark(oldBookmark) , newBookmark(newBookmark) {} - const MUCBookmark& getOldBookmark() {return oldBookmark;}; - const MUCBookmark& getNewBookmark() {return newBookmark;}; + const MUCBookmark& getOldBookmark() {return oldBookmark;} + const MUCBookmark& getNewBookmark() {return newBookmark;} private: MUCBookmark oldBookmark; diff --git a/Swift/Controllers/UIEvents/JoinMUCUIEvent.h b/Swift/Controllers/UIEvents/JoinMUCUIEvent.h index b3ff8c7..c1e6de7 100644 --- a/Swift/Controllers/UIEvents/JoinMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/JoinMUCUIEvent.h @@ -18,7 +18,7 @@ namespace Swift { class JoinMUCUIEvent : public UIEvent { public: typedef boost::shared_ptr ref; - JoinMUCUIEvent(const JID& jid, const boost::optional& password = boost::optional(), const boost::optional& nick = boost::optional(), bool joinAutomaticallyInFuture = false, bool createAsReservedRoomIfNew = false) : jid_(jid), nick_(nick), joinAutomatically_(joinAutomaticallyInFuture), createAsReservedRoomIfNew_(createAsReservedRoomIfNew), password_(password) {}; + JoinMUCUIEvent(const JID& jid, const boost::optional& password = boost::optional(), const boost::optional& nick = boost::optional(), bool joinAutomaticallyInFuture = false, bool createAsReservedRoomIfNew = false) : jid_(jid), nick_(nick), joinAutomatically_(joinAutomaticallyInFuture), createAsReservedRoomIfNew_(createAsReservedRoomIfNew), password_(password) {} const boost::optional& getNick() const {return nick_;} const JID& getJID() const {return jid_;} bool getShouldJoinAutomatically() const {return joinAutomatically_;} diff --git a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h index ea2e609..0df40f9 100644 --- a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h @@ -14,7 +14,7 @@ namespace Swift { class RemoveMUCBookmarkUIEvent : public UIEvent { public: - RemoveMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {}; + RemoveMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {} const MUCBookmark& getBookmark() { return bookmark; } private: diff --git a/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h b/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h index 7e5236a..617daf3 100644 --- a/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h +++ b/Swift/Controllers/UIEvents/RemoveRosterItemUIEvent.h @@ -13,9 +13,9 @@ namespace Swift { class RemoveRosterItemUIEvent : public UIEvent { public: - RemoveRosterItemUIEvent(const JID& jid) : jid_(jid) {}; - virtual ~RemoveRosterItemUIEvent() {}; - JID getJID() {return jid_;}; + RemoveRosterItemUIEvent(const JID& jid) : jid_(jid) {} + virtual ~RemoveRosterItemUIEvent() {} + JID getJID() {return jid_;} private: JID jid_; diff --git a/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h b/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h index c3b4b49..a0b51f2 100644 --- a/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestAdHocUIEvent.h @@ -13,7 +13,7 @@ namespace Swift { class RequestAdHocUIEvent : public UIEvent { public: - RequestAdHocUIEvent(const DiscoItems::Item& command) : command_(command) {}; + RequestAdHocUIEvent(const DiscoItems::Item& command) : command_(command) {} const DiscoItems::Item& getCommand() const {return command_;} private: DiscoItems::Item command_; diff --git a/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h b/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h index 5a071cf..7fe1926 100644 --- a/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestAddUserDialogUIEvent.h @@ -15,11 +15,11 @@ namespace Swift { class RequestAddUserDialogUIEvent : public UIEvent { public: - RequestAddUserDialogUIEvent(const JID& predefinedJID, const std::string& predefinedName) : preJID_(predefinedJID), preName_(predefinedName) {}; - RequestAddUserDialogUIEvent() : preJID_(), preName_() {}; + RequestAddUserDialogUIEvent(const JID& predefinedJID, const std::string& predefinedName) : preJID_(predefinedJID), preName_(predefinedName) {} + RequestAddUserDialogUIEvent() : preJID_(), preName_() {} - const JID& getPredefinedJID() const { return preJID_; }; - const std::string& getPredefinedName() const { return preName_; }; + const JID& getPredefinedJID() const { return preJID_; } + const std::string& getPredefinedName() const { return preName_; } private: JID preJID_; diff --git a/Swift/Controllers/UIEvents/RequestChatUIEvent.h b/Swift/Controllers/UIEvents/RequestChatUIEvent.h index b1e86ed..4ef954f 100644 --- a/Swift/Controllers/UIEvents/RequestChatUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestChatUIEvent.h @@ -13,7 +13,7 @@ namespace Swift { class RequestChatUIEvent : public UIEvent { public: - RequestChatUIEvent(const JID& contact) : contact_(contact) {}; + RequestChatUIEvent(const JID& contact) : contact_(contact) {} JID getContact() {return contact_;} private: JID contact_; diff --git a/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h b/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h index f5b995b..5c44da7 100644 --- a/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h @@ -13,7 +13,7 @@ namespace Swift { class RequestWhiteboardUIEvent : public UIEvent { public: - RequestWhiteboardUIEvent(const JID& contact) : contact_(contact) {}; + RequestWhiteboardUIEvent(const JID& contact) : contact_(contact) {} const JID& getContact() const {return contact_;} private: JID contact_; diff --git a/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h b/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h index 265bf7d..bb72d9b 100644 --- a/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h +++ b/Swift/Controllers/UIEvents/ShowWhiteboardUIEvent.h @@ -13,7 +13,7 @@ namespace Swift { class ShowWhiteboardUIEvent : public UIEvent { public: - ShowWhiteboardUIEvent(const JID& contact) : contact_(contact) {}; + ShowWhiteboardUIEvent(const JID& contact) : contact_(contact) {} const JID& getContact() const {return contact_;} private: JID contact_; diff --git a/Swift/Controllers/UIEvents/UIEventStream.h b/Swift/Controllers/UIEvents/UIEventStream.h index e174029..b1337a2 100644 --- a/Swift/Controllers/UIEvents/UIEventStream.h +++ b/Swift/Controllers/UIEvents/UIEventStream.h @@ -18,6 +18,6 @@ namespace Swift { void send(boost::shared_ptr event) { onUIEvent(event); - }; + } }; } diff --git a/Swift/Controllers/UIInterfaces/AdHocCommandWindow.h b/Swift/Controllers/UIInterfaces/AdHocCommandWindow.h index f7a5d39..835defe 100644 --- a/Swift/Controllers/UIInterfaces/AdHocCommandWindow.h +++ b/Swift/Controllers/UIInterfaces/AdHocCommandWindow.h @@ -9,6 +9,6 @@ namespace Swift { class AdHocCommandWindow { public: - virtual ~AdHocCommandWindow() {}; + virtual ~AdHocCommandWindow() {} }; } diff --git a/Swift/Controllers/UIInterfaces/ChatListWindow.h b/Swift/Controllers/UIInterfaces/ChatListWindow.h index cb55bb3..6eb932f 100644 --- a/Swift/Controllers/UIInterfaces/ChatListWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatListWindow.h @@ -25,7 +25,7 @@ namespace Swift { bool operator==(const Chat& other) const { return jid.toBare() == other.jid.toBare() && isMUC == other.isMUC; - }; + } void setUnreadCount(int unread) { unreadCount = unread; } diff --git a/Swift/Controllers/UIInterfaces/ChatWindow.h b/Swift/Controllers/UIInterfaces/ChatWindow.h index 5db1a54..ad0ed15 100644 --- a/Swift/Controllers/UIInterfaces/ChatWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatWindow.h @@ -39,7 +39,7 @@ namespace Swift { enum FileTransferState {WaitingForAccept, Negotiating, Transferring, Canceled, Finished, FTFailed}; enum WhiteboardSessionState {WhiteboardAccepted, WhiteboardTerminated, WhiteboardRejected}; ChatWindow() {} - virtual ~ChatWindow() {}; + virtual ~ChatWindow() {} /** Add message to window. * @return id of added message (for acks). diff --git a/Swift/Controllers/UIInterfaces/ChatWindowFactory.h b/Swift/Controllers/UIInterfaces/ChatWindowFactory.h index b7b4479..62e6621 100644 --- a/Swift/Controllers/UIInterfaces/ChatWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/ChatWindowFactory.h @@ -14,7 +14,7 @@ namespace Swift { class UIEventStream; class ChatWindowFactory { public: - virtual ~ChatWindowFactory() {}; + virtual ~ChatWindowFactory() {} /** * Transfers ownership of result. */ diff --git a/Swift/Controllers/UIInterfaces/ContactEditWindowFactory.h b/Swift/Controllers/UIInterfaces/ContactEditWindowFactory.h index 8ad56c0..9d47aef 100644 --- a/Swift/Controllers/UIInterfaces/ContactEditWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/ContactEditWindowFactory.h @@ -11,7 +11,7 @@ namespace Swift { class ContactEditWindowFactory { public: - virtual ~ContactEditWindowFactory() {}; + virtual ~ContactEditWindowFactory() {} virtual ContactEditWindow* createContactEditWindow() = 0; }; diff --git a/Swift/Controllers/UIInterfaces/EventWindow.h b/Swift/Controllers/UIInterfaces/EventWindow.h index 3ca2c82..b3af3d3 100644 --- a/Swift/Controllers/UIInterfaces/EventWindow.h +++ b/Swift/Controllers/UIInterfaces/EventWindow.h @@ -19,7 +19,7 @@ namespace Swift { return canDelete_; } - virtual ~EventWindow() {}; + virtual ~EventWindow() {} virtual void addEvent(boost::shared_ptr event, bool active) = 0; virtual void removeEvent(boost::shared_ptr event) = 0; diff --git a/Swift/Controllers/UIInterfaces/EventWindowFactory.h b/Swift/Controllers/UIInterfaces/EventWindowFactory.h index 1ff3ada..0b9c28e 100644 --- a/Swift/Controllers/UIInterfaces/EventWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/EventWindowFactory.h @@ -11,7 +11,7 @@ namespace Swift { class EventWindowFactory { public: - virtual ~EventWindowFactory() {}; + virtual ~EventWindowFactory() {} /** * Transfers ownership of result. */ diff --git a/Swift/Controllers/UIInterfaces/HistoryWindow.h b/Swift/Controllers/UIInterfaces/HistoryWindow.h index ffb0ad5..6d50f4b 100644 --- a/Swift/Controllers/UIInterfaces/HistoryWindow.h +++ b/Swift/Controllers/UIInterfaces/HistoryWindow.h @@ -11,7 +11,7 @@ namespace Swift { class HistoryWindow { public: - virtual ~HistoryWindow() {}; + virtual ~HistoryWindow() {} virtual void activate() = 0; virtual void setRosterModel(Roster*) = 0; diff --git a/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h b/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h index e91bc37..807fec5 100644 --- a/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/HistoryWindowFactory.h @@ -12,7 +12,7 @@ namespace Swift { class UIEventStream; class HistoryWindowFactory { public: - virtual ~HistoryWindowFactory() {}; + virtual ~HistoryWindowFactory() {} virtual HistoryWindow* createHistoryWindow(UIEventStream* eventStream) = 0; }; } diff --git a/Swift/Controllers/UIInterfaces/InviteToChatWindow.h b/Swift/Controllers/UIInterfaces/InviteToChatWindow.h index 4070e01..db128c1 100644 --- a/Swift/Controllers/UIInterfaces/InviteToChatWindow.h +++ b/Swift/Controllers/UIInterfaces/InviteToChatWindow.h @@ -15,7 +15,7 @@ namespace Swift { class InviteToChatWindow { public: - virtual ~InviteToChatWindow() {}; + virtual ~InviteToChatWindow() {} virtual void setAutoCompletions(std::vector > completions) = 0; diff --git a/Swift/Controllers/UIInterfaces/JoinMUCWindow.h b/Swift/Controllers/UIInterfaces/JoinMUCWindow.h index 4873c9b..56a9587 100644 --- a/Swift/Controllers/UIInterfaces/JoinMUCWindow.h +++ b/Swift/Controllers/UIInterfaces/JoinMUCWindow.h @@ -15,7 +15,7 @@ namespace Swift { class JoinMUCWindow { public: - virtual ~JoinMUCWindow() {}; + virtual ~JoinMUCWindow() {} virtual void setNick(const std::string& nick) = 0; virtual void setMUC(const std::string& nick) = 0; diff --git a/Swift/Controllers/UIInterfaces/JoinMUCWindowFactory.h b/Swift/Controllers/UIInterfaces/JoinMUCWindowFactory.h index cd8021b..494b418 100644 --- a/Swift/Controllers/UIInterfaces/JoinMUCWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/JoinMUCWindowFactory.h @@ -12,7 +12,7 @@ namespace Swift { class UIEventStream; class JoinMUCWindowFactory { public: - virtual ~JoinMUCWindowFactory() {}; + virtual ~JoinMUCWindowFactory() {} virtual JoinMUCWindow* createJoinMUCWindow(UIEventStream* uiEventStream) = 0; }; diff --git a/Swift/Controllers/UIInterfaces/LoginWindow.h b/Swift/Controllers/UIInterfaces/LoginWindow.h index dbc77c4..e27c385 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindow.h +++ b/Swift/Controllers/UIInterfaces/LoginWindow.h @@ -18,7 +18,7 @@ namespace Swift { class MainWindow; class LoginWindow { public: - virtual ~LoginWindow() {}; + virtual ~LoginWindow() {} virtual void selectUser(const std::string&) = 0; virtual void morphInto(MainWindow *mainWindow) = 0; virtual void loggedOut() = 0; diff --git a/Swift/Controllers/UIInterfaces/LoginWindowFactory.h b/Swift/Controllers/UIInterfaces/LoginWindowFactory.h index 1cead2a..7b8b7ec 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/LoginWindowFactory.h @@ -16,7 +16,7 @@ namespace Swift { class LoginWindowFactory { public: - virtual ~LoginWindowFactory() {}; + virtual ~LoginWindowFactory() {} /** * Transfers ownership of result. diff --git a/Swift/Controllers/UIInterfaces/MUCSearchWindow.h b/Swift/Controllers/UIInterfaces/MUCSearchWindow.h index 5814b06..43a61a1 100644 --- a/Swift/Controllers/UIInterfaces/MUCSearchWindow.h +++ b/Swift/Controllers/UIInterfaces/MUCSearchWindow.h @@ -19,7 +19,7 @@ namespace Swift { class MUCSearchWindow { public: - virtual ~MUCSearchWindow() {}; + virtual ~MUCSearchWindow() {} virtual void clearList() = 0; virtual void addService(const MUCService& service) = 0; diff --git a/Swift/Controllers/UIInterfaces/MUCSearchWindowFactory.h b/Swift/Controllers/UIInterfaces/MUCSearchWindowFactory.h index d334dff..46488eb 100644 --- a/Swift/Controllers/UIInterfaces/MUCSearchWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/MUCSearchWindowFactory.h @@ -12,7 +12,7 @@ namespace Swift { class UIEventStream; class MUCSearchWindowFactory { public: - virtual ~MUCSearchWindowFactory() {}; + virtual ~MUCSearchWindowFactory() {} virtual MUCSearchWindow* createMUCSearchWindow() = 0; }; diff --git a/Swift/Controllers/UIInterfaces/MainWindow.h b/Swift/Controllers/UIInterfaces/MainWindow.h index 23328b4..2df2c10 100644 --- a/Swift/Controllers/UIInterfaces/MainWindow.h +++ b/Swift/Controllers/UIInterfaces/MainWindow.h @@ -20,7 +20,7 @@ namespace Swift { class MainWindow { public: MainWindow(bool candelete = true) : canDelete_(candelete) {} - virtual ~MainWindow() {}; + virtual ~MainWindow() {} bool canDelete() const { return canDelete_; diff --git a/Swift/Controllers/UIInterfaces/MainWindowFactory.h b/Swift/Controllers/UIInterfaces/MainWindowFactory.h index c5cdfef..6bd34b4 100644 --- a/Swift/Controllers/UIInterfaces/MainWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/MainWindowFactory.h @@ -15,7 +15,7 @@ namespace Swift { class MainWindowFactory { public: - virtual ~MainWindowFactory() {}; + virtual ~MainWindowFactory() {} /** * Transfers ownership of result. */ diff --git a/Swift/Controllers/UIInterfaces/ProfileWindow.h b/Swift/Controllers/UIInterfaces/ProfileWindow.h index 5d5c754..2ed1bc1 100644 --- a/Swift/Controllers/UIInterfaces/ProfileWindow.h +++ b/Swift/Controllers/UIInterfaces/ProfileWindow.h @@ -14,7 +14,7 @@ namespace Swift { class ProfileWindow { public: - virtual ~ProfileWindow() {}; + virtual ~ProfileWindow() {} virtual void setVCard(VCard::ref vcard) = 0; diff --git a/Swift/Controllers/UIInterfaces/ProfileWindowFactory.h b/Swift/Controllers/UIInterfaces/ProfileWindowFactory.h index 022c3eb..45a340a 100644 --- a/Swift/Controllers/UIInterfaces/ProfileWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/ProfileWindowFactory.h @@ -11,7 +11,7 @@ namespace Swift { class ProfileWindowFactory { public: - virtual ~ProfileWindowFactory() {}; + virtual ~ProfileWindowFactory() {} virtual ProfileWindow* createProfileWindow() = 0; }; diff --git a/Swift/Controllers/UIInterfaces/UserSearchWindowFactory.h b/Swift/Controllers/UIInterfaces/UserSearchWindowFactory.h index 2a15806..331d6dd 100644 --- a/Swift/Controllers/UIInterfaces/UserSearchWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/UserSearchWindowFactory.h @@ -14,7 +14,7 @@ namespace Swift { class UIEventStream; class UserSearchWindowFactory { public: - virtual ~UserSearchWindowFactory() {}; + virtual ~UserSearchWindowFactory() {} virtual UserSearchWindow* createUserSearchWindow(UserSearchWindow::Type type, UIEventStream* eventStream, const std::set& groups) = 0; }; diff --git a/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h b/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h index c2d2f6c..2be0f9c 100644 --- a/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h +++ b/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h @@ -12,7 +12,7 @@ namespace Swift { class WhiteboardWindowFactory { public : - virtual ~WhiteboardWindowFactory() {}; + virtual ~WhiteboardWindowFactory() {} virtual WhiteboardWindow* createWhiteboardWindow(boost::shared_ptr whiteboardSession) = 0; }; diff --git a/Swift/Controllers/UIInterfaces/XMLConsoleWidgetFactory.h b/Swift/Controllers/UIInterfaces/XMLConsoleWidgetFactory.h index e27fe2e..3cba597 100644 --- a/Swift/Controllers/UIInterfaces/XMLConsoleWidgetFactory.h +++ b/Swift/Controllers/UIInterfaces/XMLConsoleWidgetFactory.h @@ -12,7 +12,7 @@ namespace Swift { class UIEventStream; class XMLConsoleWidgetFactory { public: - virtual ~XMLConsoleWidgetFactory() {}; + virtual ~XMLConsoleWidgetFactory() {} virtual XMLConsoleWidget* createXMLConsoleWidget() = 0; }; diff --git a/Swift/Controllers/UnitTest/ChatMessageSummarizerTest.cpp b/Swift/Controllers/UnitTest/ChatMessageSummarizerTest.cpp index ee0ee9f..985352a 100644 --- a/Swift/Controllers/UnitTest/ChatMessageSummarizerTest.cpp +++ b/Swift/Controllers/UnitTest/ChatMessageSummarizerTest.cpp @@ -26,7 +26,7 @@ class ChatMessageSummarizerTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); public: - ChatMessageSummarizerTest() {}; + ChatMessageSummarizerTest() {} void setUp() { diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h index 998a4eb..ac3f21b 100644 --- a/Swift/Controllers/UnitTest/MockChatWindow.h +++ b/Swift/Controllers/UnitTest/MockChatWindow.h @@ -11,53 +11,53 @@ namespace Swift { class MockChatWindow : public ChatWindow { public: - MockChatWindow() : labelsEnabled_(false) {}; + MockChatWindow() : labelsEnabled_(false) {} virtual ~MockChatWindow(); - virtual std::string addMessage(const std::string& message, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime&) {lastMessageBody_ = message; return "";}; - virtual std::string addAction(const std::string& message, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime&) {lastMessageBody_ = message; return "";}; - virtual void addSystemMessage(const std::string& /*message*/) {}; - virtual void addErrorMessage(const std::string& /*message*/) {}; - virtual void addPresenceMessage(const std::string& /*message*/) {}; + virtual std::string addMessage(const std::string& message, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime&) {lastMessageBody_ = message; return "";} + virtual std::string addAction(const std::string& message, const std::string& /*senderName*/, bool /*senderIsSelf*/, boost::shared_ptr /*label*/, const std::string& /*avatarPath*/, const boost::posix_time::ptime&) {lastMessageBody_ = message; return "";} + virtual void addSystemMessage(const std::string& /*message*/) {} + virtual void addErrorMessage(const std::string& /*message*/) {} + virtual void addPresenceMessage(const std::string& /*message*/) {} // File transfer related stuff - virtual std::string addFileTransfer(const std::string& /*senderName*/, bool /*senderIsSelf*/,const std::string& /*filename*/, const boost::uintmax_t /*sizeInBytes*/) { return 0; }; - virtual void setFileTransferProgress(std::string /*id*/, const int /*alreadyTransferedBytes*/) { }; - virtual void setFileTransferStatus(std::string /*id*/, const FileTransferState /*state*/, const std::string& /*msg*/) { }; + virtual std::string addFileTransfer(const std::string& /*senderName*/, bool /*senderIsSelf*/,const std::string& /*filename*/, const boost::uintmax_t /*sizeInBytes*/) { return 0; } + virtual void setFileTransferProgress(std::string /*id*/, const int /*alreadyTransferedBytes*/) { } + virtual void setFileTransferStatus(std::string /*id*/, const FileTransferState /*state*/, const std::string& /*msg*/) { } virtual void setMessageReceiptState(const std::string &/* id */, ReceiptState /* state */) { } - virtual void setContactChatState(ChatState::ChatStateType /*state*/) {}; - virtual void setName(const std::string& name) {name_ = name;}; - virtual void show() {}; - virtual void activate() {}; - virtual void setAvailableSecurityLabels(const std::vector& labels) {labels_ = labels;}; - virtual void setSecurityLabelsEnabled(bool enabled) {labelsEnabled_ = enabled;}; - virtual void setUnreadMessageCount(int /*count*/) {}; - virtual void convertToMUC() {}; - virtual void setSecurityLabelsError() {}; + virtual void setContactChatState(ChatState::ChatStateType /*state*/) {} + virtual void setName(const std::string& name) {name_ = name;} + virtual void show() {} + virtual void activate() {} + virtual void setAvailableSecurityLabels(const std::vector& labels) {labels_ = labels;} + virtual void setSecurityLabelsEnabled(bool enabled) {labelsEnabled_ = enabled;} + virtual void setUnreadMessageCount(int /*count*/) {} + virtual void convertToMUC() {} + virtual void setSecurityLabelsError() {} virtual SecurityLabelsCatalog::Item getSelectedSecurityLabel() {return label_;} - virtual void setInputEnabled(bool /*enabled*/) {}; - virtual void setRosterModel(Roster* /*roster*/) {}; - virtual void setTabComplete(TabComplete*) {}; - virtual void replaceLastMessage(const std::string&) {}; - virtual void replaceMessage(const std::string&, const std::string&, const boost::posix_time::ptime&) {}; - virtual void replaceWithAction(const std::string& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/) {}; - void setAckState(const std::string& /*id*/, AckState /*state*/) {}; - virtual void flash() {}; - virtual void setAlert(const std::string& /*alertText*/, const std::string& /*buttonText*/) {}; - virtual void cancelAlert() {}; + virtual void setInputEnabled(bool /*enabled*/) {} + virtual void setRosterModel(Roster* /*roster*/) {} + virtual void setTabComplete(TabComplete*) {} + virtual void replaceLastMessage(const std::string&) {} + virtual void replaceMessage(const std::string&, const std::string&, const boost::posix_time::ptime&) {} + virtual void replaceWithAction(const std::string& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/) {} + void setAckState(const std::string& /*id*/, AckState /*state*/) {} + virtual void flash() {} + virtual void setAlert(const std::string& /*alertText*/, const std::string& /*buttonText*/) {} + virtual void cancelAlert() {} virtual void setCorrectionEnabled(Tristate /*enabled*/) {} void setAvailableOccupantActions(const std::vector&/* actions*/) {} void setSubject(const std::string& /*subject*/) {} virtual void showRoomConfigurationForm(Form::ref) {} - virtual void addMUCInvitation(const std::string& /*senderName*/, const JID& /*jid*/, const std::string& /*reason*/, const std::string& /*password*/, bool = true) {}; + virtual void addMUCInvitation(const std::string& /*senderName*/, const JID& /*jid*/, const std::string& /*reason*/, const std::string& /*password*/, bool = true) {} - virtual std::string addWhiteboardRequest(bool) {return "";}; - virtual void setWhiteboardSessionStatus(std::string, const ChatWindow::WhiteboardSessionState){}; + virtual std::string addWhiteboardRequest(bool) {return "";} + virtual void setWhiteboardSessionStatus(std::string, const ChatWindow::WhiteboardSessionState){} virtual void setAffiliations(MUCOccupant::Affiliation, const std::vector&) {} - virtual void setAvailableRoomActions(const std::vector &) {}; + virtual void setAvailableRoomActions(const std::vector &) {} virtual InviteToChatWindow* createInviteToChatWindow() {return NULL;} std::string name_; diff --git a/Swift/Controllers/UnitTest/MockMainWindowFactory.h b/Swift/Controllers/UnitTest/MockMainWindowFactory.h index d130b39..279a6dd 100644 --- a/Swift/Controllers/UnitTest/MockMainWindowFactory.h +++ b/Swift/Controllers/UnitTest/MockMainWindowFactory.h @@ -13,14 +13,14 @@ namespace Swift { class MockMainWindowFactory : public MainWindowFactory { public: - MockMainWindowFactory() : last(NULL) {}; + MockMainWindowFactory() : last(NULL) {} - virtual ~MockMainWindowFactory() {}; + virtual ~MockMainWindowFactory() {} /** * Transfers ownership of result. */ - virtual MainWindow* createMainWindow(UIEventStream*) {last = new MockMainWindow();return last;}; + virtual MainWindow* createMainWindow(UIEventStream*) {last = new MockMainWindow();return last;} MockMainWindow* last; }; } diff --git a/Swift/Controllers/XMPPEvents/ErrorEvent.h b/Swift/Controllers/XMPPEvents/ErrorEvent.h index cbfc471..ac09de9 100644 --- a/Swift/Controllers/XMPPEvents/ErrorEvent.h +++ b/Swift/Controllers/XMPPEvents/ErrorEvent.h @@ -18,10 +18,10 @@ namespace Swift { class ErrorEvent : public StanzaEvent { public: - ErrorEvent(const JID& jid, const std::string& text) : jid_(jid), text_(text){}; - virtual ~ErrorEvent(){}; - const JID& getJID() const {return jid_;}; - const std::string& getText() const {return text_;}; + ErrorEvent(const JID& jid, const std::string& text) : jid_(jid), text_(text){} + virtual ~ErrorEvent(){} + const JID& getJID() const {return jid_;} + const std::string& getText() const {return text_;} private: JID jid_; diff --git a/Swift/Controllers/XMPPEvents/MessageEvent.h b/Swift/Controllers/XMPPEvents/MessageEvent.h index 1093470..a9214f5 100644 --- a/Swift/Controllers/XMPPEvents/MessageEvent.h +++ b/Swift/Controllers/XMPPEvents/MessageEvent.h @@ -17,7 +17,7 @@ namespace Swift { public: typedef boost::shared_ptr ref; - MessageEvent(boost::shared_ptr stanza) : stanza_(stanza), targetsMe_(true) {}; + MessageEvent(boost::shared_ptr stanza) : stanza_(stanza), targetsMe_(true) {} boost::shared_ptr getStanza() {return stanza_;} diff --git a/Swift/Controllers/XMPPEvents/StanzaEvent.h b/Swift/Controllers/XMPPEvents/StanzaEvent.h index 321d23d..a15afc1 100644 --- a/Swift/Controllers/XMPPEvents/StanzaEvent.h +++ b/Swift/Controllers/XMPPEvents/StanzaEvent.h @@ -14,13 +14,13 @@ namespace Swift { class StanzaEvent { public: - StanzaEvent() : time_(boost::posix_time::microsec_clock::universal_time()) {concluded_ = false;}; - virtual ~StanzaEvent() {}; - void conclude() {concluded_ = true; onConclusion();}; + StanzaEvent() : time_(boost::posix_time::microsec_clock::universal_time()) {concluded_ = false;} + virtual ~StanzaEvent() {} + void conclude() {concluded_ = true; onConclusion();} /** Do not call this directly from outside the class. * If you connect to this signal, you *must* disconnect from it manually. */ boost::signal onConclusion; - bool getConcluded() {return concluded_;}; + bool getConcluded() {return concluded_;} boost::posix_time::ptime getTime() {return time_;} private: bool concluded_; diff --git a/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h b/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h index 1f7812e..fb7a05e 100644 --- a/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h +++ b/Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h @@ -18,21 +18,21 @@ namespace Swift { class SubscriptionRequestEvent : public StanzaEvent { public: - SubscriptionRequestEvent(const JID& jid, const std::string& reason) : jid_(jid), reason_(reason){}; - virtual ~SubscriptionRequestEvent(){}; - const JID& getJID() const {return jid_;}; - const std::string& getReason() const {return reason_;}; + SubscriptionRequestEvent(const JID& jid, const std::string& reason) : jid_(jid), reason_(reason){} + virtual ~SubscriptionRequestEvent(){} + const JID& getJID() const {return jid_;} + const std::string& getReason() const {return reason_;} boost::signal onAccept; boost::signal onDecline; void accept() { onAccept(); conclude(); - }; + } void decline() { onDecline(); conclude(); - }; + } void defer() { conclude(); diff --git a/Swift/QtUI/ChatList/ChatListGroupItem.h b/Swift/QtUI/ChatList/ChatListGroupItem.h index a1e479f..17defea 100644 --- a/Swift/QtUI/ChatList/ChatListGroupItem.h +++ b/Swift/QtUI/ChatList/ChatListGroupItem.h @@ -13,14 +13,14 @@ namespace Swift { class ChatListGroupItem : public ChatListItem { public: - ChatListGroupItem(const QString& name, ChatListGroupItem* parent, bool sorted = true) : ChatListItem(parent), name_(name), sorted_(sorted) {}; - void addItem(ChatListItem* item) {items_.push_back(item); if (sorted_) {qStableSort(items_.begin(), items_.end(), pointerItemLessThan);}}; - void remove(int index) {items_.removeAt(index);}; - int rowCount() {return items_.size();}; - ChatListItem* item(int i) {return items_[i];}; - int row(ChatListItem* item) {return items_.indexOf(item);}; - QVariant data(int role) const {return (role == Qt::DisplayRole) ? name_ : QVariant();}; - void clear() {items_.clear();}; + ChatListGroupItem(const QString& name, ChatListGroupItem* parent, bool sorted = true) : ChatListItem(parent), name_(name), sorted_(sorted) {} + void addItem(ChatListItem* item) {items_.push_back(item); if (sorted_) {qStableSort(items_.begin(), items_.end(), pointerItemLessThan);}} + void remove(int index) {items_.removeAt(index);} + int rowCount() {return items_.size();} + ChatListItem* item(int i) {return items_[i];} + int row(ChatListItem* item) {return items_.indexOf(item);} + QVariant data(int role) const {return (role == Qt::DisplayRole) ? name_ : QVariant();} + void clear() {items_.clear();} private: static bool pointerItemLessThan(const ChatListItem* first, const ChatListItem* second) { QString myName = first->data(Qt::DisplayRole).toString().toLower(); diff --git a/Swift/QtUI/ChatList/ChatListItem.h b/Swift/QtUI/ChatList/ChatListItem.h index e7be614..28c0f9c 100644 --- a/Swift/QtUI/ChatList/ChatListItem.h +++ b/Swift/QtUI/ChatList/ChatListItem.h @@ -13,10 +13,10 @@ namespace Swift { class ChatListGroupItem; class ChatListItem { public: - ChatListItem(ChatListGroupItem* parent) {parent_ = parent;}; + ChatListItem(ChatListGroupItem* parent) {parent_ = parent;} virtual ~ChatListItem() {} - ChatListGroupItem* parent() {return parent_;}; + ChatListGroupItem* parent() {return parent_;} virtual QVariant data(int role) const = 0; private: diff --git a/Swift/QtUI/EventViewer/QtEvent.h b/Swift/QtUI/EventViewer/QtEvent.h index f5e3dee..11efd60 100644 --- a/Swift/QtUI/EventViewer/QtEvent.h +++ b/Swift/QtUI/EventViewer/QtEvent.h @@ -17,7 +17,7 @@ namespace Swift { public: QtEvent(boost::shared_ptr event, bool active); QVariant data(int role); - boost::shared_ptr getEvent() { return event_; }; + boost::shared_ptr getEvent() { return event_; } enum EventRoles { SenderRole = Qt::UserRole diff --git a/Swift/QtUI/MessageSnippet.h b/Swift/QtUI/MessageSnippet.h index c7425e9..2a0ec6e 100644 --- a/Swift/QtUI/MessageSnippet.h +++ b/Swift/QtUI/MessageSnippet.h @@ -23,7 +23,7 @@ namespace Swift { QString getContinuationElementID() const { return "insert"; - }; + } private: QString content_; diff --git a/Swift/QtUI/QtChatTheme.h b/Swift/QtUI/QtChatTheme.h index c6b02a0..f72a48b 100644 --- a/Swift/QtUI/QtChatTheme.h +++ b/Swift/QtUI/QtChatTheme.h @@ -13,20 +13,20 @@ namespace Swift { class QtChatTheme { public: QtChatTheme(const QString& themePath); - QString getHeader() const {return fileContents_[Header];}; - QString getFooter() const {return fileContents_[Footer];}; - QString getContent() const {return fileContents_[Content];}; - QString getStatus() const {return fileContents_[Status];}; - QString getTopic() const {return fileContents_[Topic];}; - QString getFileTransferRequest() const {return fileContents_[FileTransferRequest];}; - QString getIncomingContent() const {return fileContents_[IncomingContent];}; - QString getIncomingNextContent() const {return fileContents_[IncomingNextContent];}; - QString getIncomingContext() const {return fileContents_[IncomingContext];}; - QString getIncomingNextContext() const {return fileContents_[IncomingNextContext];}; - QString getOutgoingContent() const {return fileContents_[OutgoingContent];}; - QString getOutgoingNextContent() const {return fileContents_[OutgoingNextContent];}; - QString getOutgoingContext() const {return fileContents_[OutgoingContext];}; - QString getOutgoingNextContext() const {return fileContents_[OutgoingNextContext];}; + QString getHeader() const {return fileContents_[Header];} + QString getFooter() const {return fileContents_[Footer];} + QString getContent() const {return fileContents_[Content];} + QString getStatus() const {return fileContents_[Status];} + QString getTopic() const {return fileContents_[Topic];} + QString getFileTransferRequest() const {return fileContents_[FileTransferRequest];} + QString getIncomingContent() const {return fileContents_[IncomingContent];} + QString getIncomingNextContent() const {return fileContents_[IncomingNextContent];} + QString getIncomingContext() const {return fileContents_[IncomingContext];} + QString getIncomingNextContext() const {return fileContents_[IncomingNextContext];} + QString getOutgoingContent() const {return fileContents_[OutgoingContent];} + QString getOutgoingNextContent() const {return fileContents_[OutgoingNextContent];} + QString getOutgoingContext() const {return fileContents_[OutgoingContext];} + QString getOutgoingNextContext() const {return fileContents_[OutgoingNextContext];} QString getTemplate() const {return fileContents_[Template];} QString getMainCSS() const {return fileContents_[MainCSS];} QString getBase() const; diff --git a/Swift/QtUI/QtTabbable.h b/Swift/QtUI/QtTabbable.h index baab15c..0b67b19 100644 --- a/Swift/QtUI/QtTabbable.h +++ b/Swift/QtUI/QtTabbable.h @@ -17,10 +17,10 @@ namespace Swift { enum AlertType {NoActivity, WaitingActivity, ImpendingActivity}; ~QtTabbable(); bool isWidgetSelected(); - virtual AlertType getWidgetAlertState() {return NoActivity;}; + virtual AlertType getWidgetAlertState() {return NoActivity;} virtual int getCount() {return 0;} protected: - QtTabbable() : QWidget() {}; + QtTabbable() : QWidget() {} void keyPressEvent(QKeyEvent* event); protected slots: diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index df7cc87..607a8a6 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -24,7 +24,7 @@ myenv = env.Clone() # Disable warnings that affect Qt myenv["CXXFLAGS"] = filter(lambda x : x != "-Wfloat-equal", myenv["CXXFLAGS"]) if "clang" in env["CC"] : - myenv.Append(CXXFLAGS = ["-Wno-float-equal", "-Wno-shorten-64-to-32", "-Wno-missing-prototypes", "-Wno-unreachable-code", "-Wno-disabled-macro-expansion"]) + myenv.Append(CXXFLAGS = ["-Wno-float-equal", "-Wno-shorten-64-to-32", "-Wno-missing-prototypes", "-Wno-unreachable-code", "-Wno-disabled-macro-expansion", "-Wno-unused-private-field", "-Wno-extra-semi", "-Wno-duplicate-enum", "-Wno-missing-variable-declarations"]) myenv.UseFlags(env["SWIFT_CONTROLLERS_FLAGS"]) myenv.UseFlags(env["SWIFTOOLS_FLAGS"]) 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, boost::shared_ptr 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& getFrom() const {return from_;}; - void setFrom(const JID& from) {from_ = from;}; + const boost::optional& 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 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 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 /*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& 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 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 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 #include #include +#include #include #include +#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(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 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 #include -const unsigned char* address = reinterpret_cast("\x41\x63\xde\x89"); +static const unsigned char* address = reinterpret_cast("\x41\x63\xde\x89"); using namespace Swift; -- cgit v0.10.2-6-g49f6