From 712a3b635f41ba05be776d953060e1d84c6b3633 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 15 Jun 2021 09:24:27 +0200 Subject: [PATCH] Platform: mark Windowless*Context moves as noexcept. --- src/Magnum/Platform/WindowlessCglApplication.cpp | 4 ++-- src/Magnum/Platform/WindowlessCglApplication.h | 4 ++-- src/Magnum/Platform/WindowlessEglApplication.cpp | 4 ++-- src/Magnum/Platform/WindowlessEglApplication.h | 4 ++-- src/Magnum/Platform/WindowlessGlxApplication.cpp | 4 ++-- src/Magnum/Platform/WindowlessGlxApplication.h | 4 ++-- src/Magnum/Platform/WindowlessIosApplication.h | 4 ++-- src/Magnum/Platform/WindowlessIosApplication.mm | 4 ++-- src/Magnum/Platform/WindowlessWglApplication.cpp | 4 ++-- src/Magnum/Platform/WindowlessWglApplication.h | 4 ++-- src/Magnum/Platform/WindowlessWindowsEglApplication.cpp | 4 ++-- src/Magnum/Platform/WindowlessWindowsEglApplication.h | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Magnum/Platform/WindowlessCglApplication.cpp b/src/Magnum/Platform/WindowlessCglApplication.cpp index ed8efa5d4..c92f9cfc4 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.cpp +++ b/src/Magnum/Platform/WindowlessCglApplication.cpp @@ -72,7 +72,7 @@ WindowlessCglContext::WindowlessCglContext(const Configuration& configuration, G Error() << "Platform::WindowlessCglContext: cannot create context"; } -WindowlessCglContext::WindowlessCglContext(WindowlessCglContext&& other): _pixelFormat{other._pixelFormat}, _context{other._context} { +WindowlessCglContext::WindowlessCglContext(WindowlessCglContext&& other) noexcept: _pixelFormat{other._pixelFormat}, _context{other._context} { other._pixelFormat = {}; other._context = {}; } @@ -82,7 +82,7 @@ WindowlessCglContext::~WindowlessCglContext() { if(_pixelFormat) CGLDestroyPixelFormat(_pixelFormat); } -WindowlessCglContext& WindowlessCglContext::operator=(WindowlessCglContext&& other) { +WindowlessCglContext& WindowlessCglContext::operator=(WindowlessCglContext&& other) noexcept { using std::swap; swap(other._pixelFormat, _pixelFormat); swap(other._context, _context); diff --git a/src/Magnum/Platform/WindowlessCglApplication.h b/src/Magnum/Platform/WindowlessCglApplication.h index 0d76c5841..ec2ad98e6 100644 --- a/src/Magnum/Platform/WindowlessCglApplication.h +++ b/src/Magnum/Platform/WindowlessCglApplication.h @@ -98,13 +98,13 @@ class WindowlessCglContext { WindowlessCglContext(const WindowlessCglContext&) = delete; /** @brief Move constructor */ - WindowlessCglContext(WindowlessCglContext&& other); + WindowlessCglContext(WindowlessCglContext&& other) noexcept; /** @brief Copying is not allowed */ WindowlessCglContext& operator=(const WindowlessCglContext&) = delete; /** @brief Move assignment */ - WindowlessCglContext& operator=(WindowlessCglContext&& other); + WindowlessCglContext& operator=(WindowlessCglContext&& other) noexcept; /** * @brief Destructor diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp index 89fa13406..081004e83 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -499,7 +499,7 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G #endif } -WindowlessEglContext::WindowlessEglContext(WindowlessEglContext&& other): +WindowlessEglContext::WindowlessEglContext(WindowlessEglContext&& other) noexcept: #ifndef MAGNUM_TARGET_WEBGL _sharedContext{other._sharedContext}, #endif @@ -541,7 +541,7 @@ WindowlessEglContext::~WindowlessEglContext() { _display) eglTerminate(_display); } -WindowlessEglContext& WindowlessEglContext::operator=(WindowlessEglContext&& other) { +WindowlessEglContext& WindowlessEglContext::operator=(WindowlessEglContext&& other) noexcept { using std::swap; #ifndef MAGNUM_TARGET_WEBGL swap(other._sharedContext, _sharedContext); diff --git a/src/Magnum/Platform/WindowlessEglApplication.h b/src/Magnum/Platform/WindowlessEglApplication.h index 1eaf0fbe5..2ccc1478f 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.h +++ b/src/Magnum/Platform/WindowlessEglApplication.h @@ -108,13 +108,13 @@ class WindowlessEglContext { WindowlessEglContext(const WindowlessEglContext&) = delete; /** @brief Move constructor */ - WindowlessEglContext(WindowlessEglContext&& other); + WindowlessEglContext(WindowlessEglContext&& other) noexcept; /** @brief Copying is not allowed */ WindowlessEglContext& operator=(const WindowlessEglContext&) = delete; /** @brief Move assignment */ - WindowlessEglContext& operator=(WindowlessEglContext&& other); + WindowlessEglContext& operator=(WindowlessEglContext&& other) noexcept; /** * @brief Destructor diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index ed0d2d80e..d2b5791e2 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -280,7 +280,7 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura } } -WindowlessGlxContext::WindowlessGlxContext(WindowlessGlxContext&& other): _display{other._display}, _pbuffer{other._pbuffer}, _context{other._context} { +WindowlessGlxContext::WindowlessGlxContext(WindowlessGlxContext&& other) noexcept: _display{other._display}, _pbuffer{other._pbuffer}, _context{other._context} { other._display = {}; other._context = {}; other._pbuffer = {}; @@ -292,7 +292,7 @@ WindowlessGlxContext::~WindowlessGlxContext() { if(_display) XCloseDisplay(_display); } -WindowlessGlxContext& WindowlessGlxContext::operator=(WindowlessGlxContext&& other) { +WindowlessGlxContext& WindowlessGlxContext::operator=(WindowlessGlxContext&& other) noexcept { using std::swap; swap(other._display, _display); swap(other._pbuffer, _pbuffer); diff --git a/src/Magnum/Platform/WindowlessGlxApplication.h b/src/Magnum/Platform/WindowlessGlxApplication.h index f549f7d1f..5b3f39906 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.h +++ b/src/Magnum/Platform/WindowlessGlxApplication.h @@ -119,13 +119,13 @@ class WindowlessGlxContext { WindowlessGlxContext(const WindowlessGlxContext&) = delete; /** @brief Move constructor */ - WindowlessGlxContext(WindowlessGlxContext&& other); + WindowlessGlxContext(WindowlessGlxContext&& other) noexcept; /** @brief Copying is not allowed */ WindowlessGlxContext& operator=(const WindowlessGlxContext&) = delete; /** @brief Move assignment */ - WindowlessGlxContext& operator=(WindowlessGlxContext&& other); + WindowlessGlxContext& operator=(WindowlessGlxContext&& other) noexcept; /** * @brief Destructor diff --git a/src/Magnum/Platform/WindowlessIosApplication.h b/src/Magnum/Platform/WindowlessIosApplication.h index 5932a13b4..40ca1fdd1 100644 --- a/src/Magnum/Platform/WindowlessIosApplication.h +++ b/src/Magnum/Platform/WindowlessIosApplication.h @@ -91,13 +91,13 @@ class WindowlessIosContext { WindowlessIosContext(const WindowlessIosContext&) = delete; /** @brief Move constructor */ - WindowlessIosContext(WindowlessIosContext&& other); + WindowlessIosContext(WindowlessIosContext&& other) noexcept; /** @brief Copying is not allowed */ WindowlessIosContext& operator=(const WindowlessIosContext&) = delete; /** @brief Move assignment */ - WindowlessIosContext& operator=(WindowlessIosContext&& other); + WindowlessIosContext& operator=(WindowlessIosContext&& other) noexcept; /** * @brief Destructor diff --git a/src/Magnum/Platform/WindowlessIosApplication.mm b/src/Magnum/Platform/WindowlessIosApplication.mm index c3778778f..8665f0315 100644 --- a/src/Magnum/Platform/WindowlessIosApplication.mm +++ b/src/Magnum/Platform/WindowlessIosApplication.mm @@ -52,7 +52,7 @@ WindowlessIosContext::WindowlessIosContext(const Configuration&, GLContext*) { } } -WindowlessIosContext::WindowlessIosContext(WindowlessIosContext&& other): _context{other._context} { +WindowlessIosContext::WindowlessIosContext(WindowlessIosContext&& other) noexcept: _context{other._context} { other._context = {}; } @@ -60,7 +60,7 @@ WindowlessIosContext::~WindowlessIosContext() { if(_context) [_context dealloc]; } -WindowlessIosContext& WindowlessIosContext::operator=(WindowlessIosContext&& other) { +WindowlessIosContext& WindowlessIosContext::operator=(WindowlessIosContext&& other) noexcept { using std::swap; swap(other._context, _context); return *this; diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index 760c1dcd6..5a3b33b12 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -266,7 +266,7 @@ WindowlessWglContext::WindowlessWglContext(const Configuration& configuration, G Error() << "Platform::WindowlessWglContext: cannot create context:" << GetLastError(); } -WindowlessWglContext::WindowlessWglContext(WindowlessWglContext&& other): _window{other._window}, _deviceContext{other._deviceContext}, _context{other._context} { +WindowlessWglContext::WindowlessWglContext(WindowlessWglContext&& other) noexcept: _window{other._window}, _deviceContext{other._deviceContext}, _context{other._context} { other._window = {}; other._deviceContext = {}; other._context = {}; @@ -277,7 +277,7 @@ WindowlessWglContext::~WindowlessWglContext() { if(_window) DestroyWindow(_window); } -WindowlessWglContext& WindowlessWglContext::operator=(WindowlessWglContext&& other) { +WindowlessWglContext& WindowlessWglContext::operator=(WindowlessWglContext&& other) noexcept { using std::swap; swap(other._window, _window); swap(other._deviceContext, _deviceContext); diff --git a/src/Magnum/Platform/WindowlessWglApplication.h b/src/Magnum/Platform/WindowlessWglApplication.h index 923b51514..c27cd66c9 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.h +++ b/src/Magnum/Platform/WindowlessWglApplication.h @@ -106,13 +106,13 @@ class WindowlessWglContext { WindowlessWglContext(const WindowlessWglContext&) = delete; /** @brief Move constructor */ - WindowlessWglContext(WindowlessWglContext&& other); + WindowlessWglContext(WindowlessWglContext&& other) noexcept; /** @brief Copying is not allowed */ WindowlessWglContext& operator=(const WindowlessWglContext&) = delete; /** @brief Move assignment */ - WindowlessWglContext& operator=(WindowlessWglContext&& other); + WindowlessWglContext& operator=(WindowlessWglContext&& other) noexcept; /** * @brief Destructor diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp b/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp index c959bdbfc..3c16543db 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.cpp @@ -163,7 +163,7 @@ WindowlessWindowsEglContext::WindowlessWindowsEglContext(const Configuration& co Error() << "Platform::WindowlessWindowsEglContext: cannot create window surface:" << Implementation::eglErrorString(eglGetError()); } -WindowlessWindowsEglContext::WindowlessWindowsEglContext(WindowlessWindowsEglContext&& other): _window{other._window}, _display{other._display}, _surface{other._surface}, _context{other._context} { +WindowlessWindowsEglContext::WindowlessWindowsEglContext(WindowlessWindowsEglContext&& other) noexcept: _window{other._window}, _display{other._display}, _surface{other._surface}, _context{other._context} { other._window = {}; other._display = {}; other._surface = {}; @@ -177,7 +177,7 @@ WindowlessWindowsEglContext::~WindowlessWindowsEglContext() { if(_window) DestroyWindow(_window); } -WindowlessWindowsEglContext& WindowlessWindowsEglContext::operator=(WindowlessWindowsEglContext&& other) { +WindowlessWindowsEglContext& WindowlessWindowsEglContext::operator=(WindowlessWindowsEglContext&& other) noexcept { using std::swap; swap(other._window, _window); swap(other._display, _display); diff --git a/src/Magnum/Platform/WindowlessWindowsEglApplication.h b/src/Magnum/Platform/WindowlessWindowsEglApplication.h index e0a6df5f8..555ef681a 100644 --- a/src/Magnum/Platform/WindowlessWindowsEglApplication.h +++ b/src/Magnum/Platform/WindowlessWindowsEglApplication.h @@ -91,13 +91,13 @@ class WindowlessWindowsEglContext { WindowlessWindowsEglContext(const WindowlessWindowsEglContext&) = delete; /** @brief Move constructor */ - WindowlessWindowsEglContext(WindowlessWindowsEglContext&& other); + WindowlessWindowsEglContext(WindowlessWindowsEglContext&& other) noexcept; /** @brief Copying is not allowed */ WindowlessWindowsEglContext& operator=(const WindowlessWindowsEglContext&) = delete; /** @brief Move assignment */ - WindowlessWindowsEglContext& operator=(WindowlessWindowsEglContext&& other); + WindowlessWindowsEglContext& operator=(WindowlessWindowsEglContext&& other) noexcept; /** * @brief Destructor