From 39714e7df3603e8d8354e6036e1e87fdfd87a62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 19:35:54 +0100 Subject: [PATCH 1/6] Text: I was probably drunk or something. This _is_ supported in GCC 4.6 and there is _nothing_ like MAGNUM_GCC46_COMPATIBILITY since a long time. --- src/Text/Text.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Text/Text.h b/src/Text/Text.h index c1f65b53c..4a0960e60 100644 --- a/src/Text/Text.h +++ b/src/Text/Text.h @@ -40,9 +40,7 @@ class AbstractLayouter; class DistanceFieldGlyphCache; class GlyphCache; -#ifndef MAGNUM_GCC46_COMPATIBILITY enum class Alignment: UnsignedByte; -#endif class AbstractRenderer; template class Renderer; From 2f87fd5fbea918b2722532c7d761f88f505d9da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 19:50:53 +0100 Subject: [PATCH 2/6] Platform: make all constructors implicitly explicit. --- src/Platform/ScreenedApplication.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Platform/ScreenedApplication.h b/src/Platform/ScreenedApplication.h index 3bc129f2d..51e25b0db 100644 --- a/src/Platform/ScreenedApplication.h +++ b/src/Platform/ScreenedApplication.h @@ -94,10 +94,10 @@ template class BasicScreenedApplication: public Application, public: /** @copydoc Sdl2Application::Sdl2Application(const Arguments, const Configuration&) */ - BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration()): Application(arguments, configuration) {} + explicit BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration()): Application(arguments, configuration) {} /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ - BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t): Application(arguments, nullptr) {} + explicit BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t): Application(arguments, nullptr) {} /** * @brief Add screen to application From 5a9ab4eb2c929c125747b76c9c6abce5faa30851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 20:02:17 +0100 Subject: [PATCH 3/6] Platform: this documentation block is superfluous. --- src/Platform/AbstractXApplication.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Platform/AbstractXApplication.h b/src/Platform/AbstractXApplication.h index 4c440be35..ac7058384 100644 --- a/src/Platform/AbstractXApplication.h +++ b/src/Platform/AbstractXApplication.h @@ -83,11 +83,6 @@ class AbstractXApplication { void exit() { flags |= Flag::Exit; } protected: - /** - * @brief Destructor - * - * Deletes context and destroys the window. - */ /* Nobody will need to have (and delete) AbstractXApplication*, thus this is faster than public pure virtual destructor */ ~AbstractXApplication(); From b744943c98ad3d816180f568f44848fea3ed94e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 20:03:20 +0100 Subject: [PATCH 4/6] Platform: deinline also these destructors. Miight reduce some code bloat. --- src/Platform/GlxApplication.cpp | 2 ++ src/Platform/GlxApplication.h | 2 +- src/Platform/XEglApplication.cpp | 2 ++ src/Platform/XEglApplication.h | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Platform/GlxApplication.cpp b/src/Platform/GlxApplication.cpp index e100ff5ef..8aacac191 100644 --- a/src/Platform/GlxApplication.cpp +++ b/src/Platform/GlxApplication.cpp @@ -33,6 +33,8 @@ GlxApplication::GlxApplication(const Arguments& arguments, const Configuration& GlxApplication::GlxApplication(const Arguments& arguments, std::nullptr_t): AbstractXApplication(new Implementation::GlxContextHandler, arguments, nullptr) {} +GlxApplication::~GlxApplication() = default; + template class BasicScreen; template class BasicScreenedApplication; diff --git a/src/Platform/GlxApplication.h b/src/Platform/GlxApplication.h index e06782701..03567f595 100644 --- a/src/Platform/GlxApplication.h +++ b/src/Platform/GlxApplication.h @@ -75,7 +75,7 @@ class GlxApplication: public AbstractXApplication { protected: /* Nobody will need to have (and delete) GlxApplication*, thus this is faster than public pure virtual destructor */ - ~GlxApplication() = default; + ~GlxApplication(); }; /** @hideinitializer diff --git a/src/Platform/XEglApplication.cpp b/src/Platform/XEglApplication.cpp index 39205ebe6..41dd4b1d3 100644 --- a/src/Platform/XEglApplication.cpp +++ b/src/Platform/XEglApplication.cpp @@ -33,6 +33,8 @@ XEglApplication::XEglApplication(const Arguments& arguments, const Configuration XEglApplication::XEglApplication(const Arguments& arguments, std::nullptr_t): AbstractXApplication(new Implementation::EglContextHandler, arguments, nullptr) {} +XEglApplication::~XEglApplication() = default; + template class BasicScreen; template class BasicScreenedApplication; diff --git a/src/Platform/XEglApplication.h b/src/Platform/XEglApplication.h index a70331159..5c436c101 100644 --- a/src/Platform/XEglApplication.h +++ b/src/Platform/XEglApplication.h @@ -76,7 +76,7 @@ class XEglApplication: public AbstractXApplication { protected: /* Nobody will need to have (and delete) XEglApplication*, thus this is faster than public pure virtual destructor */ - ~XEglApplication() = default; + ~XEglApplication(); }; /** @hideinitializer From bfac19ceef618b958fc689701cfcd57f940a916b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 20:03:59 +0100 Subject: [PATCH 5/6] Platform: I was drunk also when writing this. The comment contradicts the statement. --- src/Platform/Sdl2Application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index 94d43eed8..690ad475f 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -156,7 +156,7 @@ class Sdl2Application { protected: /* Nobody will need to have (and delete) Sdl2Application*, thus this is faster than public pure virtual destructor */ - virtual ~Sdl2Application(); + ~Sdl2Application(); /** @copydoc GlutApplication::createContext() */ void createContext(const Configuration& configuration); From 3bc858777c8ea72714cf80dd3818add970cc269a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2013 20:04:31 +0100 Subject: [PATCH 6/6] Platform: deinline also all ScreenedApplication {con,de}structors. --- src/Platform/ScreenedApplication.h | 8 ++++++-- src/Platform/ScreenedApplication.hpp | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Platform/ScreenedApplication.h b/src/Platform/ScreenedApplication.h index 51e25b0db..dc962bdf9 100644 --- a/src/Platform/ScreenedApplication.h +++ b/src/Platform/ScreenedApplication.h @@ -94,10 +94,10 @@ template class BasicScreenedApplication: public Application, public: /** @copydoc Sdl2Application::Sdl2Application(const Arguments, const Configuration&) */ - explicit BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration()): Application(arguments, configuration) {} + explicit BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration()); /** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */ - explicit BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t): Application(arguments, nullptr) {} + explicit BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t); /** * @brief Add screen to application @@ -157,6 +157,10 @@ template class BasicScreenedApplication: public Application, } protected: + /* Nobody will need to have (and delete) ScreenedApplication*, thus + this is faster than public pure virtual destructor */ + ~BasicScreenedApplication(); + /** * @brief Global viewport event * diff --git a/src/Platform/ScreenedApplication.hpp b/src/Platform/ScreenedApplication.hpp index 6cf03ddb9..2063c51fb 100644 --- a/src/Platform/ScreenedApplication.hpp +++ b/src/Platform/ScreenedApplication.hpp @@ -41,6 +41,12 @@ template void BasicScreen::mousePressEvent(Mouse template void BasicScreen::mouseReleaseEvent(MouseEvent&) {} template void BasicScreen::mouseMoveEvent(MouseMoveEvent&) {} +template BasicScreenedApplication::BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration): Application(arguments, configuration) {} + +template BasicScreenedApplication::BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t): Application(arguments, nullptr) {} + +template BasicScreenedApplication::~BasicScreenedApplication() = default; + template BasicScreenedApplication& BasicScreenedApplication::addScreen(BasicScreen& screen) { Containers::LinkedList>::insert(&screen); if(frontScreen() == &screen) screen.focusEvent();