diff options
-rw-r--r-- | Sluift/Lua/Exception.cpp | 2 | ||||
-rw-r--r-- | Sluift/Lua/Exception.h | 6 | ||||
-rw-r--r-- | Sluift/Response.h | 2 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 2 | ||||
-rw-r--r-- | Swiften/Base/API.h | 19 | ||||
-rw-r--r-- | Swiften/Base/Error.h | 4 | ||||
-rw-r--r-- | Swiften/Base/SafeAllocator.h | 14 | ||||
-rw-r--r-- | Swiften/Client/XMLBeautifier.cpp | 20 | ||||
-rw-r--r-- | Swiften/Elements/Element.h | 4 | ||||
-rw-r--r-- | Swiften/Elements/JinglePayload.h | 4 | ||||
-rw-r--r-- | Swiften/Elements/Payload.h | 6 | ||||
-rw-r--r-- | Swiften/Elements/Presence.h | 4 | ||||
-rw-r--r-- | Swiften/Elements/Stanza.h | 1 | ||||
-rw-r--r-- | Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h | 3 | ||||
-rw-r--r-- | Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h | 3 | ||||
-rw-r--r-- | Swiften/Elements/Whiteboard/WhiteboardOperation.h | 3 | ||||
-rw-r--r-- | Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h | 3 | ||||
-rw-r--r-- | Swiften/FileTransfer/FileTransferOptions.h | 4 |
18 files changed, 70 insertions, 34 deletions
diff --git a/Sluift/Lua/Exception.cpp b/Sluift/Lua/Exception.cpp index d80b9fb..889c931 100644 --- a/Sluift/Lua/Exception.cpp +++ b/Sluift/Lua/Exception.cpp @@ -12,4 +12,4 @@ Exception::Exception(const std::string& what) : std::runtime_error(what) { } -Exception::~Exception() throw() { +Exception::~Exception() SWIFTEN_NOEXCEPT { } diff --git a/Sluift/Lua/Exception.h b/Sluift/Lua/Exception.h index 6d00d01..a68b925 100644 --- a/Sluift/Lua/Exception.h +++ b/Sluift/Lua/Exception.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2013 Remko Tronçon + * Copyright (c) 2013-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -8,4 +8,5 @@ #include <stdexcept> +#include <Swiften/Base/API.h> namespace Swift { @@ -14,5 +15,6 @@ namespace Swift { public: Exception(const std::string& what); - virtual ~Exception() throw(); + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Exception) + virtual ~Exception() SWIFTEN_NOEXCEPT; }; } diff --git a/Sluift/Response.h b/Sluift/Response.h index 1cd059a..b007897 100644 --- a/Sluift/Response.h +++ b/Sluift/Response.h @@ -9,4 +9,5 @@ #include <Swiften/Elements/Payload.h> #include <Swiften/Elements/ErrorPayload.h> +#include <Swiften/Base/API.h> struct lua_State; @@ -16,4 +17,5 @@ namespace Swift { struct Response { Response(boost::shared_ptr<Payload> result, boost::shared_ptr<ErrorPayload> error) : result(result), error(error) {} + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Response) ~Response(); diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index a7e8b73..fef9039 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -314,5 +314,5 @@ void ChatsManager::loadRecents() { ByteArray debase64 = Base64::decode(recentsString); std::vector<ChatListWindow::Chat> recentChats; - std::stringstream deserializeStream(std::string((const char*)debase64.data(), debase64.size())); + std::stringstream deserializeStream(std::string(reinterpret_cast<const char*>(vecptr(debase64)), debase64.size())); try { boost::archive::text_iarchive ia(deserializeStream); diff --git a/Swiften/Base/API.h b/Swiften/Base/API.h index 388ad0a..0913181 100644 --- a/Swiften/Base/API.h +++ b/Swiften/Base/API.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2012-2013 Remko Tronçon + * Copyright (c) 2012-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -8,4 +8,5 @@ #include <Swiften/Base/Platform.h> +#include <boost/config.hpp> #ifdef SWIFTEN_STATIC @@ -24,2 +25,18 @@ # endif #endif + +#ifdef BOOST_NO_DEFAULTED_FUNCTIONS +# define SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(cls) +# define SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(cls) +#else +# define SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(cls) \ + cls(const cls&) = default; +# define SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(cls) \ + cls& operator=(const cls&) = default; +#endif + +#ifdef BOOST_NO_NOEXCEPT +#define SWIFTEN_NOEXCEPT throw() +#else +#define SWIFTEN_NOEXCEPT noexcept +#endif diff --git a/Swiften/Base/Error.h b/Swiften/Base/Error.h index d9f3b91..00287fc 100644 --- a/Swiften/Base/Error.h +++ b/Swiften/Base/Error.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -12,4 +12,6 @@ namespace Swift { class SWIFTEN_API Error { public: + Error() {} + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Error) virtual ~Error(); }; diff --git a/Swiften/Base/SafeAllocator.h b/Swiften/Base/SafeAllocator.h index b01d77d..8a8b25e 100644 --- a/Swiften/Base/SafeAllocator.h +++ b/Swiften/Base/SafeAllocator.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2011-2013 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -10,4 +10,6 @@ #include <algorithm> +#include <Swiften/Base/API.h> + namespace Swift { void secureZeroMemory(char* memory, size_t numberOfBytes); @@ -20,8 +22,8 @@ namespace Swift { }; - SafeAllocator() throw() {} - SafeAllocator(const SafeAllocator&) throw() : std::allocator<T>() {} - template <class U> SafeAllocator(const SafeAllocator<U>&) throw() {} - ~SafeAllocator() throw() {} + SafeAllocator() SWIFTEN_NOEXCEPT {} + SafeAllocator(const SafeAllocator&) SWIFTEN_NOEXCEPT : std::allocator<T>() {} + template <class U> SafeAllocator(const SafeAllocator<U>&) SWIFTEN_NOEXCEPT {} + ~SafeAllocator() SWIFTEN_NOEXCEPT {} void deallocate (T* p, size_t num) { @@ -30,5 +32,5 @@ namespace Swift { } - private: + SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(SafeAllocator) }; } diff --git a/Swiften/Client/XMLBeautifier.cpp b/Swiften/Client/XMLBeautifier.cpp index b70fc48..5d083ff 100644 --- a/Swiften/Client/XMLBeautifier.cpp +++ b/Swiften/Client/XMLBeautifier.cpp @@ -5,4 +5,10 @@ */ +/* + * Copyright (c) 2014 Remko Tronçon + * Licensed under the GNU General Public License. + * See the COPYING file for more information. + */ + #include <sstream> #include <stack> @@ -39,11 +45,11 @@ void XMLBeautifier::indent() { // all bold but reset -const char colorBlue[] = "\x1b[01;34m"; -const char colorCyan[] = "\x1b[01;36m"; -const char colorGreen[] = "\x1b[01;32m"; -const char colorMagenta[] = "\x1b[01;35m"; -const char colorRed[] = "\x1b[01;31m"; -const char colorReset[] = "\x1b[0m"; -const char colorYellow[] = "\x1b[01;33m"; +// static const char colorBlue[] = "\x1b[01;34m"; +static const char colorCyan[] = "\x1b[01;36m"; +static const char colorGreen[] = "\x1b[01;32m"; +// static const char colorMagenta[] = "\x1b[01;35m"; +static const char colorRed[] = "\x1b[01;31m"; +static const char colorReset[] = "\x1b[0m"; +static const char colorYellow[] = "\x1b[01;33m"; diff --git a/Swiften/Elements/Element.h b/Swiften/Elements/Element.h index 638418d..14539c1 100644 --- a/Swiften/Elements/Element.h +++ b/Swiften/Elements/Element.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -12,4 +12,6 @@ namespace Swift { class SWIFTEN_API Element { public: + Element() {} + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Element) virtual ~Element(); }; diff --git a/Swiften/Elements/JinglePayload.h b/Swiften/Elements/JinglePayload.h index 5f12e90..7d7160b 100644 --- a/Swiften/Elements/JinglePayload.h +++ b/Swiften/Elements/JinglePayload.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -12,4 +12,5 @@ #include <string> +#include <Swiften/Base/API.h> #include <Swiften/JID/JID.h> #include <Swiften/Elements/Payload.h> @@ -43,5 +44,4 @@ namespace Swift { Reason() : type(UnknownType), text("") {} Reason(Type type, const std::string& text = "") : type(type), text(text) {} - ~Reason() {} Type type; std::string text; diff --git a/Swiften/Elements/Payload.h b/Swiften/Elements/Payload.h index 15a72d5..1459837 100644 --- a/Swiften/Elements/Payload.h +++ b/Swiften/Elements/Payload.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -16,5 +16,9 @@ namespace Swift { typedef boost::shared_ptr<Payload> ref; public: + Payload() {} + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Payload) virtual ~Payload(); + + SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(Payload) }; } diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h index 2e9e224..d16be2a 100644 --- a/Swiften/Elements/Presence.h +++ b/Swiften/Elements/Presence.h @@ -1,4 +1,4 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. @@ -13,4 +13,5 @@ #include <Swiften/Elements/StatusShow.h> + namespace Swift { class SWIFTEN_API Presence : public Stanza { @@ -22,4 +23,5 @@ namespace Swift { Presence(); Presence(const std::string& status); + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Presence) virtual ~Presence(); diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h index bd0d7e9..f1c9e00 100644 --- a/Swiften/Elements/Stanza.h +++ b/Swiften/Elements/Stanza.h @@ -26,4 +26,5 @@ namespace Swift { Stanza(); virtual ~Stanza(); + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Stanza) template<typename T> diff --git a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h index 091ee30..95015c9 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h @@ -16,7 +16,4 @@ namespace Swift { typedef boost::shared_ptr<WhiteboardDeleteOperation> ref; public: - ~WhiteboardDeleteOperation() { - } - std::string getElementID() const { return elementID_; diff --git a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h index 8c20044..fd52405 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h @@ -16,7 +16,4 @@ namespace Swift { typedef boost::shared_ptr<WhiteboardInsertOperation> ref; public: - ~WhiteboardInsertOperation() { - } - WhiteboardElement::ref getElement() const { return element_; diff --git a/Swiften/Elements/Whiteboard/WhiteboardOperation.h b/Swiften/Elements/Whiteboard/WhiteboardOperation.h index 75f6e6a..497d551 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardOperation.h @@ -7,4 +7,5 @@ #pragma once +#include <Swiften/Base/API.h> #include <boost/smart_ptr/shared_ptr.hpp> #include <string> @@ -15,4 +16,6 @@ namespace Swift { typedef boost::shared_ptr<WhiteboardOperation> ref; public: + WhiteboardOperation() {} + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(WhiteboardOperation) virtual ~WhiteboardOperation(){} diff --git a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h index a52a341..a68cc7d 100644 --- a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h +++ b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h @@ -16,7 +16,4 @@ namespace Swift { typedef boost::shared_ptr<WhiteboardUpdateOperation> ref; public: - ~WhiteboardUpdateOperation() { - } - WhiteboardElement::ref getElement() const { return element_; diff --git a/Swiften/FileTransfer/FileTransferOptions.h b/Swiften/FileTransfer/FileTransferOptions.h index 304ced8..993b14b 100644 --- a/Swiften/FileTransfer/FileTransferOptions.h +++ b/Swiften/FileTransfer/FileTransferOptions.h @@ -15,5 +15,5 @@ namespace Swift { FileTransferOptions() : allowInBand(false) { } - + SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(FileTransferOptions) ~FileTransferOptions(); @@ -27,4 +27,6 @@ namespace Swift { } + SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(FileTransferOptions) + private: bool allowInBand; |