From fe4eff7bbf665cf356271c19feccb80b99cf877b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 17 Jan 2017 18:21:37 +0300 Subject: Add missing A_DEFAULT_COPY / A_DELETE_COPY into utils. --- src/utils/dtor.h | 2 ++ src/utils/gettexthelper.h | 2 ++ src/utils/mutex.h | 2 ++ src/utils/naclmessages.cpp | 9 +++++++++ src/utils/perfomance.h | 2 ++ src/utils/physfsmemoryobject.h | 2 ++ src/utils/sdlmemoryobject.h | 5 ++++- src/utils/translation/translationmanager.h | 2 ++ 8 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/dtor.h b/src/utils/dtor.h index 87dd3418a..7856fc248 100644 --- a/src/utils/dtor.h +++ b/src/utils/dtor.h @@ -31,6 +31,8 @@ template struct dtor final : public std::unary_function { + A_DEFAULT_COPY(dtor) + void operator()(T &ptr) { delete ptr; } }; diff --git a/src/utils/gettexthelper.h b/src/utils/gettexthelper.h index a83fc44cd..d42266d45 100644 --- a/src/utils/gettexthelper.h +++ b/src/utils/gettexthelper.h @@ -30,6 +30,8 @@ class GettextHelper final { public: + A_DELETE_COPY(GettextHelper) + static void initLang(); private: diff --git a/src/utils/mutex.h b/src/utils/mutex.h index fd295000e..27adc5322 100644 --- a/src/utils/mutex.h +++ b/src/utils/mutex.h @@ -62,6 +62,8 @@ class MutexLocker final { } + A_DEFAULT_COPY(MutexLocker) + ~MutexLocker(); private: diff --git a/src/utils/naclmessages.cpp b/src/utils/naclmessages.cpp index 1c48c0b10..44e6aba1b 100644 --- a/src/utils/naclmessages.cpp +++ b/src/utils/naclmessages.cpp @@ -34,6 +34,15 @@ struct NaclMessageHandle final { + NaclMessageHandle() : + handled(false), + type(), + message(), + condv() + { } + + A_DELETE_COPY(NaclMessageHandle) + bool handled; std::string type; std::string message; diff --git a/src/utils/perfomance.h b/src/utils/perfomance.h index 409b5037d..4d8fc6188 100644 --- a/src/utils/perfomance.h +++ b/src/utils/perfomance.h @@ -59,6 +59,8 @@ namespace Perfomance blockStart(str); } + A_DELETE_COPY(Func) + ~Func() { blockEnd(name); diff --git a/src/utils/physfsmemoryobject.h b/src/utils/physfsmemoryobject.h index fef3ec02c..62668b511 100644 --- a/src/utils/physfsmemoryobject.h +++ b/src/utils/physfsmemoryobject.h @@ -37,6 +37,8 @@ struct PHYSFSMemoryObject final { } + A_DELETE_COPY(PHYSFSMemoryObject) + std::string mName; std::string mAddFile; }; diff --git a/src/utils/sdlmemoryobject.h b/src/utils/sdlmemoryobject.h index 4fec1c5f9..daab75088 100644 --- a/src/utils/sdlmemoryobject.h +++ b/src/utils/sdlmemoryobject.h @@ -33,7 +33,8 @@ struct SDLMemoryObject final { - SDLMemoryObject(const std::string &name, const char *const file, + SDLMemoryObject(const std::string &name, + const char *const file, const unsigned int line) : mName(name), mAddFile(strprintf("%s:%u", file, line)), @@ -42,6 +43,8 @@ struct SDLMemoryObject final { } + A_DELETE_COPY(SDLMemoryObject) + std::string mName; std::string mAddFile; std::string mRemoveFile; diff --git a/src/utils/translation/translationmanager.h b/src/utils/translation/translationmanager.h index 413edffb0..7230649e9 100644 --- a/src/utils/translation/translationmanager.h +++ b/src/utils/translation/translationmanager.h @@ -31,6 +31,8 @@ class PoDict; class TranslationManager final { public: + A_DELETE_COPY(TranslationManager) + static PoDict *loadLang(const LangVect &lang, const std::string &subName, PoDict *const dict = nullptr); -- cgit v1.2.3-60-g2f50