From cdce9f7147e01b0ef675cc5f115666bf09feeaec Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Fri, 6 Jan 2023 16:19:57 -0700 Subject: [PATCH] Use nested namespaces --- .clang-tidy | 1 + include/SFML/Window/WindowStyle.hpp | 8 ++------ src/SFML/Audio/ALCheck.cpp | 8 ++------ src/SFML/Audio/ALCheck.hpp | 8 ++------ src/SFML/Audio/AudioDevice.cpp | 8 ++------ src/SFML/Audio/AudioDevice.hpp | 8 ++------ src/SFML/Audio/SoundFileReaderFlac.cpp | 8 ++------ src/SFML/Audio/SoundFileReaderFlac.hpp | 8 ++------ src/SFML/Audio/SoundFileReaderMp3.cpp | 8 ++------ src/SFML/Audio/SoundFileReaderMp3.hpp | 8 ++------ src/SFML/Audio/SoundFileReaderOgg.cpp | 8 ++------ src/SFML/Audio/SoundFileReaderOgg.hpp | 8 ++------ src/SFML/Audio/SoundFileReaderWav.cpp | 8 ++------ src/SFML/Audio/SoundFileReaderWav.hpp | 8 ++------ src/SFML/Audio/SoundFileWriterFlac.cpp | 8 ++------ src/SFML/Audio/SoundFileWriterFlac.hpp | 8 ++------ src/SFML/Audio/SoundFileWriterOgg.cpp | 8 ++------ src/SFML/Audio/SoundFileWriterOgg.hpp | 8 ++------ src/SFML/Audio/SoundFileWriterWav.cpp | 8 ++------ src/SFML/Audio/SoundFileWriterWav.hpp | 8 ++------ src/SFML/Graphics/GLCheck.cpp | 8 ++------ src/SFML/Graphics/GLCheck.hpp | 8 ++------ src/SFML/Graphics/GLExtensions.cpp | 8 ++------ src/SFML/Graphics/GLExtensions.hpp | 8 ++------ src/SFML/Graphics/Glsl.cpp | 7 ++----- src/SFML/Graphics/ImageLoader.cpp | 8 ++------ src/SFML/Graphics/RenderTextureImplDefault.cpp | 8 ++------ src/SFML/Graphics/RenderTextureImplFBO.cpp | 8 ++------ src/SFML/Graphics/TextureSaver.cpp | 8 ++------ src/SFML/Graphics/TextureSaver.hpp | 8 ++------ src/SFML/Main/MainAndroid.cpp | 7 ++----- src/SFML/Network/Unix/SocketImpl.cpp | 8 ++------ src/SFML/Network/Unix/SocketImpl.hpp | 8 ++------ src/SFML/Network/Win32/SocketImpl.cpp | 8 ++------ src/SFML/Network/Win32/SocketImpl.hpp | 8 ++------ src/SFML/System/Android/Activity.cpp | 7 ++----- src/SFML/System/Android/Activity.hpp | 7 ++----- src/SFML/System/Android/ResourceStream.cpp | 7 ++----- src/SFML/System/Android/ResourceStream.hpp | 8 ++------ src/SFML/Window/Android/ClipboardImpl.cpp | 8 ++------ src/SFML/Window/Android/CursorImpl.cpp | 8 ++------ src/SFML/Window/Android/CursorImpl.hpp | 9 ++------- src/SFML/Window/Android/InputImpl.cpp | 8 ++------ src/SFML/Window/Android/InputImpl.hpp | 8 ++------ src/SFML/Window/Android/JoystickImpl.cpp | 8 ++------ src/SFML/Window/Android/JoystickImpl.hpp | 8 ++------ src/SFML/Window/Android/SensorImpl.cpp | 8 ++------ src/SFML/Window/Android/SensorImpl.hpp | 8 ++------ src/SFML/Window/Android/VideoModeImpl.cpp | 8 ++------ src/SFML/Window/Android/WindowImplAndroid.cpp | 7 ++----- src/SFML/Window/Android/WindowImplAndroid.hpp | 8 ++------ src/SFML/Window/DRM/ClipboardImpl.cpp | 8 ++------ src/SFML/Window/DRM/ClipboardImpl.hpp | 8 ++------ src/SFML/Window/DRM/CursorImpl.cpp | 8 ++------ src/SFML/Window/DRM/CursorImpl.hpp | 8 ++------ src/SFML/Window/DRM/DRMContext.cpp | 8 ++------ src/SFML/Window/DRM/DRMContext.hpp | 8 ++------ src/SFML/Window/DRM/InputImplUDev.cpp | 8 ++------ src/SFML/Window/DRM/InputImplUDev.hpp | 8 ++------ src/SFML/Window/DRM/VideoModeImpl.cpp | 8 ++------ src/SFML/Window/DRM/WindowImplDRM.cpp | 8 ++------ src/SFML/Window/DRM/WindowImplDRM.hpp | 8 ++------ src/SFML/Window/EGLCheck.cpp | 7 ++----- src/SFML/Window/EGLCheck.hpp | 7 ++----- src/SFML/Window/EglContext.cpp | 8 ++------ src/SFML/Window/EglContext.hpp | 8 ++------ src/SFML/Window/FreeBSD/JoystickImpl.cpp | 8 ++------ src/SFML/Window/FreeBSD/JoystickImpl.hpp | 8 ++------ src/SFML/Window/GlContext.cpp | 8 ++------ src/SFML/Window/GlContext.hpp | 8 ++------ src/SFML/Window/JoystickImpl.hpp | 8 ++------ src/SFML/Window/JoystickManager.cpp | 8 ++------ src/SFML/Window/JoystickManager.hpp | 8 ++------ src/SFML/Window/NetBSD/JoystickImpl.cpp | 8 ++------ src/SFML/Window/NetBSD/JoystickImpl.hpp | 8 ++------ src/SFML/Window/OSX/ClipboardImpl.mm | 8 ++------ src/SFML/Window/OSX/CursorImpl.hpp | 9 ++------- src/SFML/Window/OSX/CursorImpl.mm | 8 ++------ src/SFML/Window/OSX/HIDInputManager.hpp | 8 ++------ src/SFML/Window/OSX/HIDInputManager.mm | 8 ++------ src/SFML/Window/OSX/HIDJoystickManager.cpp | 8 ++------ src/SFML/Window/OSX/HIDJoystickManager.hpp | 8 ++------ src/SFML/Window/OSX/InputImpl.hpp | 8 ++------ src/SFML/Window/OSX/InputImpl.mm | 8 ++------ src/SFML/Window/OSX/JoystickImpl.cpp | 8 ++------ src/SFML/Window/OSX/JoystickImpl.hpp | 8 ++------ src/SFML/Window/OSX/SFContext.hpp | 8 ++------ src/SFML/Window/OSX/SFContext.mm | 9 ++------- src/SFML/Window/OSX/SFKeyboardModifiersHelper.h | 5 +---- src/SFML/Window/OSX/SFOpenGLView.h | 5 +---- src/SFML/Window/OSX/SFWindowController.h | 5 +---- src/SFML/Window/OSX/Scaling.h | 7 ++----- src/SFML/Window/OSX/SensorImpl.cpp | 8 ++------ src/SFML/Window/OSX/SensorImpl.hpp | 8 ++------ src/SFML/Window/OSX/VideoModeImpl.cpp | 7 ++----- src/SFML/Window/OSX/WindowImplCocoa.mm | 8 ++------ src/SFML/Window/OSX/WindowImplDelegateProtocol.h | 5 +---- src/SFML/Window/OSX/cg_sf_conversion.hpp | 7 ++----- src/SFML/Window/OSX/cg_sf_conversion.mm | 7 ++----- src/SFML/Window/OpenBSD/JoystickImpl.cpp | 8 ++------ src/SFML/Window/OpenBSD/JoystickImpl.hpp | 8 ++------ src/SFML/Window/SensorManager.cpp | 8 ++------ src/SFML/Window/SensorManager.hpp | 8 ++------ src/SFML/Window/Unix/ClipboardImpl.cpp | 8 ++------ src/SFML/Window/Unix/ClipboardImpl.hpp | 8 ++------ src/SFML/Window/Unix/CursorImpl.cpp | 8 ++------ src/SFML/Window/Unix/CursorImpl.hpp | 9 ++------- src/SFML/Window/Unix/Display.cpp | 8 ++------ src/SFML/Window/Unix/Display.hpp | 8 ++------ src/SFML/Window/Unix/GlxContext.cpp | 8 ++------ src/SFML/Window/Unix/GlxContext.hpp | 8 ++------ src/SFML/Window/Unix/InputImpl.cpp | 8 ++------ src/SFML/Window/Unix/InputImpl.hpp | 8 ++------ src/SFML/Window/Unix/JoystickImpl.cpp | 8 ++------ src/SFML/Window/Unix/JoystickImpl.hpp | 8 ++------ src/SFML/Window/Unix/SensorImpl.cpp | 8 ++------ src/SFML/Window/Unix/SensorImpl.hpp | 8 ++------ src/SFML/Window/Unix/VideoModeImpl.cpp | 8 ++------ src/SFML/Window/Unix/VulkanImplX11.cpp | 8 ++------ src/SFML/Window/Unix/VulkanImplX11.hpp | 8 ++------ src/SFML/Window/Unix/WindowImplX11.cpp | 8 ++------ src/SFML/Window/Unix/WindowImplX11.hpp | 8 ++------ src/SFML/Window/VideoModeImpl.hpp | 8 ++------ src/SFML/Window/Win32/ClipboardImpl.cpp | 8 ++------ src/SFML/Window/Win32/CursorImpl.cpp | 8 ++------ src/SFML/Window/Win32/CursorImpl.hpp | 9 ++------- src/SFML/Window/Win32/InputImpl.cpp | 8 ++------ src/SFML/Window/Win32/InputImpl.hpp | 8 ++------ src/SFML/Window/Win32/JoystickImpl.cpp | 8 ++------ src/SFML/Window/Win32/JoystickImpl.hpp | 8 ++------ src/SFML/Window/Win32/SensorImpl.cpp | 8 ++------ src/SFML/Window/Win32/SensorImpl.hpp | 8 ++------ src/SFML/Window/Win32/VideoModeImpl.cpp | 8 ++------ src/SFML/Window/Win32/VulkanImplWin32.cpp | 8 ++------ src/SFML/Window/Win32/VulkanImplWin32.hpp | 8 ++------ src/SFML/Window/Win32/WglContext.cpp | 8 ++------ src/SFML/Window/Win32/WglContext.hpp | 8 ++------ src/SFML/Window/Win32/WindowImplWin32.cpp | 8 ++------ src/SFML/Window/WindowImpl.cpp | 8 ++------ src/SFML/Window/iOS/ClipboardImpl.mm | 8 ++------ src/SFML/Window/iOS/CursorImpl.cpp | 8 ++------ src/SFML/Window/iOS/CursorImpl.hpp | 9 ++------- src/SFML/Window/iOS/EaglContext.hpp | 8 ++------ src/SFML/Window/iOS/EaglContext.mm | 8 ++------ src/SFML/Window/iOS/InputImpl.hpp | 8 ++------ src/SFML/Window/iOS/InputImpl.mm | 8 ++------ src/SFML/Window/iOS/JoystickImpl.hpp | 8 ++------ src/SFML/Window/iOS/JoystickImpl.mm | 8 ++------ src/SFML/Window/iOS/SensorImpl.hpp | 8 ++------ src/SFML/Window/iOS/SensorImpl.mm | 8 ++------ src/SFML/Window/iOS/VideoModeImpl.mm | 8 ++------ src/SFML/Window/iOS/WindowImplUIKit.hpp | 8 ++------ src/SFML/Window/iOS/WindowImplUIKit.mm | 8 ++------ 153 files changed, 301 insertions(+), 898 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index c31544c0..fb9c8088 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,6 +1,7 @@ Checks: > -*, clang-analyzer-*, + modernize-concat-nested-namespaces, readability-identifier-naming, -clang-analyzer-core.NonNullParamChecker, -clang-analyzer-core.NullDereference, diff --git a/include/SFML/Window/WindowStyle.hpp b/include/SFML/Window/WindowStyle.hpp index ff935efc..d4b932e8 100644 --- a/include/SFML/Window/WindowStyle.hpp +++ b/include/SFML/Window/WindowStyle.hpp @@ -25,9 +25,7 @@ #pragma once -namespace sf -{ -namespace Style +namespace sf::Style { //////////////////////////////////////////////////////////// /// \ingroup window @@ -44,6 +42,4 @@ enum Default = Titlebar | Resize | Close //!< Default window style }; -} // namespace Style - -} // namespace sf +} // namespace sf::Style diff --git a/src/SFML/Audio/ALCheck.cpp b/src/SFML/Audio/ALCheck.cpp index 476b3e65..5a5607bc 100644 --- a/src/SFML/Audio/ALCheck.cpp +++ b/src/SFML/Audio/ALCheck.cpp @@ -45,9 +45,7 @@ thread_local ALenum lastError(AL_NO_ERROR); } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void alCheckError(const std::filesystem::path& file, unsigned int line, const char* expression) @@ -115,6 +113,4 @@ ALenum alGetLastErrorImpl() return std::exchange(AlCheckImpl::lastError, AL_NO_ERROR); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/ALCheck.hpp b/src/SFML/Audio/ALCheck.hpp index 5e0f5d0b..9309d64b 100644 --- a/src/SFML/Audio/ALCheck.hpp +++ b/src/SFML/Audio/ALCheck.hpp @@ -39,9 +39,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// Let's define a macro to quickly check every OpenAL API call @@ -86,9 +84,7 @@ void alCheckError(const std::filesystem::path& file, unsigned int line, const ch //////////////////////////////////////////////////////////// ALenum alGetLastErrorImpl(); -} // namespace priv - -} // namespace sf +} // namespace sf::priv #if defined(__APPLE__) diff --git a/src/SFML/Audio/AudioDevice.cpp b/src/SFML/Audio/AudioDevice.cpp index 71da541f..153123d0 100644 --- a/src/SFML/Audio/AudioDevice.cpp +++ b/src/SFML/Audio/AudioDevice.cpp @@ -48,9 +48,7 @@ sf::Vector3f listenerDirection(0.f, 0.f, -1.f); sf::Vector3f listenerUpVector(0.f, 1.f, 0.f); } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// AudioDevice::AudioDevice() @@ -233,6 +231,4 @@ Vector3f AudioDevice::getUpVector() return listenerUpVector; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/AudioDevice.hpp b/src/SFML/Audio/AudioDevice.hpp index df9d3d3d..8a57d8f2 100644 --- a/src/SFML/Audio/AudioDevice.hpp +++ b/src/SFML/Audio/AudioDevice.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief High-level wrapper around the audio API, it manages @@ -182,6 +180,4 @@ public: static Vector3f getUpVector(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderFlac.cpp b/src/SFML/Audio/SoundFileReaderFlac.cpp index 4a137171..2da05a86 100644 --- a/src/SFML/Audio/SoundFileReaderFlac.cpp +++ b/src/SFML/Audio/SoundFileReaderFlac.cpp @@ -180,9 +180,7 @@ void streamError(const FLAC__StreamDecoder*, FLAC__StreamDecoderErrorStatus, voi } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileReaderFlac::check(InputStream& stream) @@ -358,6 +356,4 @@ void SoundFileReaderFlac::close() } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderFlac.hpp b/src/SFML/Audio/SoundFileReaderFlac.hpp index f3bbf7dd..76cb32d3 100644 --- a/src/SFML/Audio/SoundFileReaderFlac.hpp +++ b/src/SFML/Audio/SoundFileReaderFlac.hpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file reader that handles FLAC files @@ -131,6 +129,4 @@ private: ClientData m_clientData; //!< Structure passed to the decoder callbacks }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderMp3.cpp b/src/SFML/Audio/SoundFileReaderMp3.cpp index ef8ce157..f67e2b75 100644 --- a/src/SFML/Audio/SoundFileReaderMp3.cpp +++ b/src/SFML/Audio/SoundFileReaderMp3.cpp @@ -74,9 +74,7 @@ bool hasValidId3Tag(const std::uint8_t* header) } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileReaderMp3::check(InputStream& stream) @@ -150,6 +148,4 @@ std::uint64_t SoundFileReaderMp3::read(std::int16_t* samples, std::uint64_t maxC return toRead; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderMp3.hpp b/src/SFML/Audio/SoundFileReaderMp3.hpp index 8f475e9a..3d19a36b 100644 --- a/src/SFML/Audio/SoundFileReaderMp3.hpp +++ b/src/SFML/Audio/SoundFileReaderMp3.hpp @@ -51,9 +51,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file reader that handles MP3 files @@ -132,6 +130,4 @@ private: std::uint64_t m_position{}; // Position in decompressed audio buffer }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderOgg.cpp b/src/SFML/Audio/SoundFileReaderOgg.cpp index cc775393..08f45a8f 100644 --- a/src/SFML/Audio/SoundFileReaderOgg.cpp +++ b/src/SFML/Audio/SoundFileReaderOgg.cpp @@ -67,9 +67,7 @@ long tell(void* data) static ov_callbacks callbacks = {&read, &seek, nullptr, &tell}; } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileReaderOgg::check(InputStream& stream) @@ -173,6 +171,4 @@ void SoundFileReaderOgg::close() } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderOgg.hpp b/src/SFML/Audio/SoundFileReaderOgg.hpp index a14e068d..e382c62a 100644 --- a/src/SFML/Audio/SoundFileReaderOgg.hpp +++ b/src/SFML/Audio/SoundFileReaderOgg.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file reader that handles OGG/Vorbis files @@ -117,6 +115,4 @@ private: unsigned int m_channelCount{}; // number of channels of the open sound file }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderWav.cpp b/src/SFML/Audio/SoundFileReaderWav.cpp index c44fbd63..7c20fec6 100644 --- a/src/SFML/Audio/SoundFileReaderWav.cpp +++ b/src/SFML/Audio/SoundFileReaderWav.cpp @@ -101,9 +101,7 @@ const char* waveSubformatPcm = "\x80\x00\x00\xAA\x00\x38\x9B\x71"; } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileReaderWav::check(InputStream& stream) @@ -355,6 +353,4 @@ bool SoundFileReaderWav::parseHeader(Info& info) return true; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileReaderWav.hpp b/src/SFML/Audio/SoundFileReaderWav.hpp index bc82af2b..50714297 100644 --- a/src/SFML/Audio/SoundFileReaderWav.hpp +++ b/src/SFML/Audio/SoundFileReaderWav.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file reader that handles wav files @@ -113,6 +111,4 @@ private: std::uint64_t m_dataEnd{}; //!< Position one byte past the end of the audio data in the open file }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileWriterFlac.cpp b/src/SFML/Audio/SoundFileWriterFlac.cpp index fc035875..f404576b 100644 --- a/src/SFML/Audio/SoundFileWriterFlac.cpp +++ b/src/SFML/Audio/SoundFileWriterFlac.cpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileWriterFlac::check(const std::filesystem::path& filename) @@ -125,6 +123,4 @@ void SoundFileWriterFlac::close() } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileWriterFlac.hpp b/src/SFML/Audio/SoundFileWriterFlac.hpp index f726e1b6..2bc080d2 100644 --- a/src/SFML/Audio/SoundFileWriterFlac.hpp +++ b/src/SFML/Audio/SoundFileWriterFlac.hpp @@ -34,9 +34,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file writer that handles FLAC files @@ -104,6 +102,4 @@ private: std::vector m_samples32; //!< Conversion buffer }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileWriterOgg.cpp b/src/SFML/Audio/SoundFileWriterOgg.cpp index 4a51895e..5e3aabd3 100644 --- a/src/SFML/Audio/SoundFileWriterOgg.cpp +++ b/src/SFML/Audio/SoundFileWriterOgg.cpp @@ -36,9 +36,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileWriterOgg::check(const std::filesystem::path& filename) @@ -206,6 +204,4 @@ void SoundFileWriterOgg::close() vorbis_info_clear(&m_vorbis); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileWriterOgg.hpp b/src/SFML/Audio/SoundFileWriterOgg.hpp index 4ac50242..d7933456 100644 --- a/src/SFML/Audio/SoundFileWriterOgg.hpp +++ b/src/SFML/Audio/SoundFileWriterOgg.hpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file writer that handles OGG/Vorbis files @@ -113,6 +111,4 @@ private: vorbis_dsp_state m_state{}; // current encoding state }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileWriterWav.cpp b/src/SFML/Audio/SoundFileWriterWav.cpp index 223ce13f..8fcac163 100644 --- a/src/SFML/Audio/SoundFileWriterWav.cpp +++ b/src/SFML/Audio/SoundFileWriterWav.cpp @@ -62,9 +62,7 @@ void encode(std::ostream& stream, std::uint32_t value) } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool SoundFileWriterWav::check(const std::filesystem::path& filename) @@ -179,6 +177,4 @@ void SoundFileWriterWav::close() } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Audio/SoundFileWriterWav.hpp b/src/SFML/Audio/SoundFileWriterWav.hpp index 3989d8c5..4ccef823 100644 --- a/src/SFML/Audio/SoundFileWriterWav.hpp +++ b/src/SFML/Audio/SoundFileWriterWav.hpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Implementation of sound file writer that handles wav files @@ -112,6 +110,4 @@ private: std::ofstream m_file; //!< File stream to write to }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/GLCheck.cpp b/src/SFML/Graphics/GLCheck.cpp index 364f8eb0..0b5d501e 100644 --- a/src/SFML/Graphics/GLCheck.cpp +++ b/src/SFML/Graphics/GLCheck.cpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void glCheckError(const std::filesystem::path& file, unsigned int line, const char* expression) @@ -108,6 +106,4 @@ void glCheckError(const std::filesystem::path& file, unsigned int line, const ch } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/GLCheck.hpp b/src/SFML/Graphics/GLCheck.hpp index 0da7f0f2..00d97707 100644 --- a/src/SFML/Graphics/GLCheck.hpp +++ b/src/SFML/Graphics/GLCheck.hpp @@ -34,9 +34,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// Let's define a macro to quickly check every OpenGL API call @@ -69,6 +67,4 @@ namespace priv //////////////////////////////////////////////////////////// void glCheckError(const std::filesystem::path& file, unsigned int line, const char* expression); -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/GLExtensions.cpp b/src/SFML/Graphics/GLExtensions.cpp index 3ffb6156..eaed9c9d 100644 --- a/src/SFML/Graphics/GLExtensions.cpp +++ b/src/SFML/Graphics/GLExtensions.cpp @@ -48,9 +48,7 @@ #endif -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void ensureExtensionsInit() @@ -100,6 +98,4 @@ void ensureExtensionsInit() } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/GLExtensions.hpp b/src/SFML/Graphics/GLExtensions.hpp index ce5e4ad8..3064454c 100644 --- a/src/SFML/Graphics/GLExtensions.hpp +++ b/src/SFML/Graphics/GLExtensions.hpp @@ -334,9 +334,7 @@ #define GLEXT_GL_VERSION_4_5 SF_GLAD_GL_VERSION_4_5 #define GLEXT_GL_VERSION_4_6 SF_GLAD_GL_VERSION_4_6 -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -345,6 +343,4 @@ namespace priv //////////////////////////////////////////////////////////// void ensureExtensionsInit(); -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/Glsl.cpp b/src/SFML/Graphics/Glsl.cpp index d81e2052..1c272f53 100644 --- a/src/SFML/Graphics/Glsl.cpp +++ b/src/SFML/Graphics/Glsl.cpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -89,5 +87,4 @@ void copyVector(const Color& source, Vector4& dest) dest.w = static_cast(source.a); } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/ImageLoader.cpp b/src/SFML/Graphics/ImageLoader.cpp index a29eec8e..b2324bab 100644 --- a/src/SFML/Graphics/ImageLoader.cpp +++ b/src/SFML/Graphics/ImageLoader.cpp @@ -71,9 +71,7 @@ void bufferFromCallback(void* context, void* data, int size) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// ImageLoader& ImageLoader::getInstance() @@ -320,6 +318,4 @@ bool ImageLoader::saveImageToMemory(const std::string& format, return false; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/RenderTextureImplDefault.cpp b/src/SFML/Graphics/RenderTextureImplDefault.cpp index bccba213..1d40a8f2 100644 --- a/src/SFML/Graphics/RenderTextureImplDefault.cpp +++ b/src/SFML/Graphics/RenderTextureImplDefault.cpp @@ -34,9 +34,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// RenderTextureImplDefault::RenderTextureImplDefault() = default; @@ -95,6 +93,4 @@ void RenderTextureImplDefault::updateTexture(unsigned int textureId) glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, static_cast(m_size.x), static_cast(m_size.y))); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp index 3bdc756f..ace801eb 100644 --- a/src/SFML/Graphics/RenderTextureImplFBO.cpp +++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp @@ -112,9 +112,7 @@ void contextDestroyCallback(void* /*arg*/) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// RenderTextureImplFBO::RenderTextureImplFBO() @@ -652,6 +650,4 @@ void RenderTextureImplFBO::updateTexture(unsigned int) #endif // SFML_OPENGL_ES } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/TextureSaver.cpp b/src/SFML/Graphics/TextureSaver.cpp index 0c8a59cc..d2e287d5 100644 --- a/src/SFML/Graphics/TextureSaver.cpp +++ b/src/SFML/Graphics/TextureSaver.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// TextureSaver::TextureSaver() @@ -45,6 +43,4 @@ TextureSaver::~TextureSaver() glCheck(glBindTexture(GL_TEXTURE_2D, static_cast(m_textureBinding))); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Graphics/TextureSaver.hpp b/src/SFML/Graphics/TextureSaver.hpp index 55b61a50..4ba4e26a 100644 --- a/src/SFML/Graphics/TextureSaver.hpp +++ b/src/SFML/Graphics/TextureSaver.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Automatic wrapper for saving and restoring the current texture binding @@ -64,6 +62,4 @@ private: GLint m_textureBinding; //!< Texture binding to restore }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Main/MainAndroid.cpp b/src/SFML/Main/MainAndroid.cpp index 8afb3264..89edae23 100644 --- a/src/SFML/Main/MainAndroid.cpp +++ b/src/SFML/Main/MainAndroid.cpp @@ -57,9 +57,7 @@ extern int main(int argc, char* argv[]); -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -149,8 +147,7 @@ void* main(ActivityStates* states) return nullptr; } -} // namespace priv -} // namespace sf +} // namespace sf::priv //////////////////////////////////////////////////////////// diff --git a/src/SFML/Network/Unix/SocketImpl.cpp b/src/SFML/Network/Unix/SocketImpl.cpp index 5f66ef6a..e017a7db 100644 --- a/src/SFML/Network/Unix/SocketImpl.cpp +++ b/src/SFML/Network/Unix/SocketImpl.cpp @@ -34,9 +34,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// sockaddr_in SocketImpl::createAddress(std::uint32_t address, unsigned short port) @@ -109,6 +107,4 @@ Socket::Status SocketImpl::getErrorStatus() // clang-format on } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Network/Unix/SocketImpl.hpp b/src/SFML/Network/Unix/SocketImpl.hpp index 3e33292b..87857c83 100644 --- a/src/SFML/Network/Unix/SocketImpl.hpp +++ b/src/SFML/Network/Unix/SocketImpl.hpp @@ -39,9 +39,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Helper class implementing all the non-portable @@ -102,6 +100,4 @@ public: static Socket::Status getErrorStatus(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Network/Win32/SocketImpl.cpp b/src/SFML/Network/Win32/SocketImpl.cpp index 815d0172..958e29b6 100644 --- a/src/SFML/Network/Win32/SocketImpl.cpp +++ b/src/SFML/Network/Win32/SocketImpl.cpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// sockaddr_in SocketImpl::createAddress(std::uint32_t address, unsigned short port) @@ -109,6 +107,4 @@ struct SocketInitializer SocketInitializer globalInitializer; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Network/Win32/SocketImpl.hpp b/src/SFML/Network/Win32/SocketImpl.hpp index 3efec397..62ce5ee5 100644 --- a/src/SFML/Network/Win32/SocketImpl.hpp +++ b/src/SFML/Network/Win32/SocketImpl.hpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Helper class implementing all the non-portable @@ -98,6 +96,4 @@ public: static Socket::Status getErrorStatus(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/System/Android/Activity.cpp b/src/SFML/System/Android/Activity.cpp index eb890643..f7c61df6 100644 --- a/src/SFML/System/Android/Activity.cpp +++ b/src/SFML/System/Android/Activity.cpp @@ -54,9 +54,7 @@ std::streambuf::int_type LogcatStream::overflow(std::streambuf::int_type c) return traits_type::not_eof(c); } -namespace sf -{ -namespace priv +namespace sf::priv { ActivityStates*& getActivityStatesPtr() @@ -77,5 +75,4 @@ ActivityStates& getActivity() return *states; } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/System/Android/Activity.hpp b/src/SFML/System/Android/Activity.hpp index 596d2d30..a8038c77 100644 --- a/src/SFML/System/Android/Activity.hpp +++ b/src/SFML/System/Android/Activity.hpp @@ -50,9 +50,7 @@ private: std::string m_message; }; -namespace sf -{ -namespace priv +namespace sf::priv { struct ActivityStates { @@ -98,5 +96,4 @@ SFML_SYSTEM_API void resetActivity(ActivityStates* initializedStates); SFML_SYSTEM_API ActivityStates& getActivity(); -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/System/Android/ResourceStream.cpp b/src/SFML/System/Android/ResourceStream.cpp index b686837e..90008473 100644 --- a/src/SFML/System/Android/ResourceStream.cpp +++ b/src/SFML/System/Android/ResourceStream.cpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -112,5 +110,4 @@ std::int64_t ResourceStream::getSize() } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/System/Android/ResourceStream.hpp b/src/SFML/System/Android/ResourceStream.hpp index d6afdc15..d94e3199 100644 --- a/src/SFML/System/Android/ResourceStream.hpp +++ b/src/SFML/System/Android/ResourceStream.hpp @@ -37,9 +37,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Read from Android asset files @@ -106,6 +104,4 @@ private: AAsset* m_file; ///< The asset file to read }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/ClipboardImpl.cpp b/src/SFML/Window/Android/ClipboardImpl.cpp index 4cddf149..ffcc4ee0 100644 --- a/src/SFML/Window/Android/ClipboardImpl.cpp +++ b/src/SFML/Window/Android/ClipboardImpl.cpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// String ClipboardImpl::getString() @@ -50,6 +48,4 @@ void ClipboardImpl::setString(const String& /* text */) sf::err() << "Clipboard API not implemented for Android.\n"; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/CursorImpl.cpp b/src/SFML/Window/Android/CursorImpl.cpp index 5834b664..9a507f0e 100644 --- a/src/SFML/Window/Android/CursorImpl.cpp +++ b/src/SFML/Window/Android/CursorImpl.cpp @@ -27,9 +27,7 @@ //////////////////////////////////////////////////////////// #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool CursorImpl::loadFromPixels(const std::uint8_t* /* pixels */, Vector2u /* size */, Vector2u /* hotspot */) @@ -47,6 +45,4 @@ bool CursorImpl::loadFromSystem(Cursor::Type /* type */) } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/CursorImpl.hpp b/src/SFML/Window/Android/CursorImpl.hpp index 97a67836..e3a16c77 100644 --- a/src/SFML/Window/Android/CursorImpl.hpp +++ b/src/SFML/Window/Android/CursorImpl.hpp @@ -31,10 +31,7 @@ #include -namespace sf -{ - -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Android implementation of Cursor @@ -82,6 +79,4 @@ public: bool loadFromSystem(Cursor::Type type); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/InputImpl.cpp b/src/SFML/Window/Android/InputImpl.cpp index 3b560bf8..34108c87 100644 --- a/src/SFML/Window/Android/InputImpl.cpp +++ b/src/SFML/Window/Android/InputImpl.cpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool InputImpl::isKeyPressed(Keyboard::Key /* key */) @@ -205,6 +203,4 @@ Vector2i InputImpl::getTouchPosition(unsigned int finger, const WindowBase& /* r return getTouchPosition(finger); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/InputImpl.hpp b/src/SFML/Window/Android/InputImpl.hpp index 252e6906..b3795861 100644 --- a/src/SFML/Window/Android/InputImpl.hpp +++ b/src/SFML/Window/Android/InputImpl.hpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief iOS implementation of inputs (keyboard + mouse) @@ -158,6 +156,4 @@ public: static Vector2i getTouchPosition(unsigned int finger, const WindowBase& relativeTo); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index 847fd5e2..97a2f2c3 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -91,6 +89,4 @@ JoystickState JoystickImpl::update() return JoystickState(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/JoystickImpl.hpp b/src/SFML/Window/Android/JoystickImpl.hpp index 37e8247b..30fb8edb 100644 --- a/src/SFML/Window/Android/JoystickImpl.hpp +++ b/src/SFML/Window/Android/JoystickImpl.hpp @@ -25,9 +25,7 @@ #pragma once -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Android implementation of joysticks @@ -105,6 +103,4 @@ private: Joystick::Identification m_identification; ///< Joystick identification }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/SensorImpl.cpp b/src/SFML/Window/Android/SensorImpl.cpp index bbfb4e47..db03c4b1 100644 --- a/src/SFML/Window/Android/SensorImpl.cpp +++ b/src/SFML/Window/Android/SensorImpl.cpp @@ -48,9 +48,7 @@ sf::Vector3f sensorData[sf::Sensor::Count]; } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void SensorImpl::initialize() @@ -220,6 +218,4 @@ int SensorImpl::processSensorEvents(int /* fd */, int /* events */, void* /* sen return 1; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/SensorImpl.hpp b/src/SFML/Window/Android/SensorImpl.hpp index f5d2b660..2dd065eb 100644 --- a/src/SFML/Window/Android/SensorImpl.hpp +++ b/src/SFML/Window/Android/SensorImpl.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Android implementation of sensors @@ -127,6 +125,4 @@ private: unsigned int m_index; ///< Index of the sensor }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/VideoModeImpl.cpp b/src/SFML/Window/Android/VideoModeImpl.cpp index 6dd78cfb..342d8924 100644 --- a/src/SFML/Window/Android/VideoModeImpl.cpp +++ b/src/SFML/Window/Android/VideoModeImpl.cpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() @@ -59,6 +57,4 @@ VideoMode VideoModeImpl::getDesktopMode() return VideoMode(Vector2u(states.screenSize)); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index d64ba7ea..7f16d3f9 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -45,9 +45,7 @@ //////////////////////////////////////////////////////////// // Private data //////////////////////////////////////////////////////////// -namespace sf -{ -namespace priv +namespace sf::priv { WindowImplAndroid* WindowImplAndroid::singleInstance = nullptr; @@ -755,5 +753,4 @@ int WindowImplAndroid::getUnicode(AInputEvent* event) return unicode; } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Android/WindowImplAndroid.hpp b/src/SFML/Window/Android/WindowImplAndroid.hpp index 1c3506db..4f9866c0 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.hpp +++ b/src/SFML/Window/Android/WindowImplAndroid.hpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Android implementation of WindowImpl @@ -237,6 +235,4 @@ private: bool m_hasFocus{}; }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/ClipboardImpl.cpp b/src/SFML/Window/DRM/ClipboardImpl.cpp index cd312844..834c53ae 100644 --- a/src/SFML/Window/DRM/ClipboardImpl.cpp +++ b/src/SFML/Window/DRM/ClipboardImpl.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// String ClipboardImpl::getString() @@ -44,6 +42,4 @@ void ClipboardImpl::setString(const String& /*text*/) { } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/ClipboardImpl.hpp b/src/SFML/Window/DRM/ClipboardImpl.hpp index 5b74d3a5..58af61fb 100644 --- a/src/SFML/Window/DRM/ClipboardImpl.hpp +++ b/src/SFML/Window/DRM/ClipboardImpl.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Give access to the system clipboard @@ -66,6 +64,4 @@ public: static void setString(const String& text); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/CursorImpl.cpp b/src/SFML/Window/DRM/CursorImpl.cpp index 2baeb82a..b4ba98d3 100644 --- a/src/SFML/Window/DRM/CursorImpl.cpp +++ b/src/SFML/Window/DRM/CursorImpl.cpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool CursorImpl::loadFromPixels(const std::uint8_t* /*pixels*/, Vector2u /*size*/, Vector2u /*hotspot*/) @@ -74,6 +72,4 @@ void CursorImpl::release() { } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/CursorImpl.hpp b/src/SFML/Window/DRM/CursorImpl.hpp index 41f3fa05..c9bb726e 100644 --- a/src/SFML/Window/DRM/CursorImpl.hpp +++ b/src/SFML/Window/DRM/CursorImpl.hpp @@ -32,9 +32,7 @@ #include // Prevent conflict with macro None from Xlib -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Unix implementation of Cursor @@ -111,6 +109,4 @@ private: void release(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/DRMContext.cpp b/src/SFML/Window/DRM/DRMContext.cpp index ac85ad8a..c3200624 100644 --- a/src/SFML/Window/DRM/DRMContext.cpp +++ b/src/SFML/Window/DRM/DRMContext.cpp @@ -506,9 +506,7 @@ EGLDisplay getInitializedDisplay() } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// DRMContext::DRMContext(DRMContext* shared) @@ -828,6 +826,4 @@ Drm& DRMContext::getDRM() return drmNode; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/DRMContext.hpp b/src/SFML/Window/DRM/DRMContext.hpp index 37e5dfda..e63d1ae9 100644 --- a/src/SFML/Window/DRM/DRMContext.hpp +++ b/src/SFML/Window/DRM/DRMContext.hpp @@ -39,9 +39,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { struct Drm { @@ -211,6 +209,4 @@ private: bool m_scanOut{}; }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/InputImplUDev.cpp b/src/SFML/Window/DRM/InputImplUDev.cpp index a4e5facd..e9cedc8f 100644 --- a/src/SFML/Window/DRM/InputImplUDev.cpp +++ b/src/SFML/Window/DRM/InputImplUDev.cpp @@ -560,9 +560,7 @@ void update() } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool InputImpl::isKeyPressed(Keyboard::Key key) @@ -719,6 +717,4 @@ void InputImpl::restoreTerminalConfig() tcflush(STDIN_FILENO, TCIFLUSH); // flush the buffer } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/InputImplUDev.hpp b/src/SFML/Window/DRM/InputImplUDev.hpp index c4adedd3..062fb04a 100644 --- a/src/SFML/Window/DRM/InputImplUDev.hpp +++ b/src/SFML/Window/DRM/InputImplUDev.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Linux (DRM) implementation of inputs (keyboard + mouse) @@ -182,6 +180,4 @@ private: static void restoreTerminalConfig(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/VideoModeImpl.cpp b/src/SFML/Window/DRM/VideoModeImpl.cpp index c889da1f..8380273b 100644 --- a/src/SFML/Window/DRM/VideoModeImpl.cpp +++ b/src/SFML/Window/DRM/VideoModeImpl.cpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() @@ -65,6 +63,4 @@ VideoMode VideoModeImpl::getDesktopMode() return VideoMode({0, 0}); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/WindowImplDRM.cpp b/src/SFML/Window/DRM/WindowImplDRM.cpp index 7deac97a..a0c2945f 100644 --- a/src/SFML/Window/DRM/WindowImplDRM.cpp +++ b/src/SFML/Window/DRM/WindowImplDRM.cpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// WindowImplDRM::WindowImplDRM(WindowHandle /*handle*/) @@ -154,6 +152,4 @@ void WindowImplDRM::processEvents() pushEvent(ev); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/DRM/WindowImplDRM.hpp b/src/SFML/Window/DRM/WindowImplDRM.hpp index 3f6f3184..4fc48adf 100644 --- a/src/SFML/Window/DRM/WindowImplDRM.hpp +++ b/src/SFML/Window/DRM/WindowImplDRM.hpp @@ -30,9 +30,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief DRM implementation of WindowImpl @@ -192,6 +190,4 @@ private: Vector2u m_size; ///< Window size }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/EGLCheck.cpp b/src/SFML/Window/EGLCheck.cpp index 8dd991bc..6d0273ab 100644 --- a/src/SFML/Window/EGLCheck.cpp +++ b/src/SFML/Window/EGLCheck.cpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void eglCheckError(const std::filesystem::path& file, unsigned int line, const char* expression) @@ -170,5 +168,4 @@ void eglCheckError(const std::filesystem::path& file, unsigned int line, const c } } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/EGLCheck.hpp b/src/SFML/Window/EGLCheck.hpp index 39c5def1..308eb010 100644 --- a/src/SFML/Window/EGLCheck.hpp +++ b/src/SFML/Window/EGLCheck.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// Let's define a macro to quickly check every EGL API call @@ -67,5 +65,4 @@ namespace priv //////////////////////////////////////////////////////////// void eglCheckError(const std::filesystem::path& file, unsigned int line, const char* expression); -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index ea1e6a49..1ac315a2 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -97,9 +97,7 @@ void ensureInit() } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// EglContext::EglContext(EglContext* shared) @@ -403,6 +401,4 @@ XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsP } #endif -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/EglContext.hpp b/src/SFML/Window/EglContext.hpp index 6a4e2797..dbc0607d 100644 --- a/src/SFML/Window/EglContext.hpp +++ b/src/SFML/Window/EglContext.hpp @@ -39,9 +39,7 @@ #include #endif -namespace sf -{ -namespace priv +namespace sf::priv { class EglContext : public GlContext { @@ -193,6 +191,4 @@ private: EGLConfig m_config{}; //!< The internal EGL config }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.cpp b/src/SFML/Window/FreeBSD/JoystickImpl.cpp index 59a4fed5..cb24a754 100644 --- a/src/SFML/Window/FreeBSD/JoystickImpl.cpp +++ b/src/SFML/Window/FreeBSD/JoystickImpl.cpp @@ -163,9 +163,7 @@ void hatValueToSfml(int value, sf::priv::JoystickState& state) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -348,6 +346,4 @@ JoystickState JoystickImpl::JoystickImpl::update() return m_state; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.hpp b/src/SFML/Window/FreeBSD/JoystickImpl.hpp index 34e01e1c..21fe5a55 100644 --- a/src/SFML/Window/FreeBSD/JoystickImpl.hpp +++ b/src/SFML/Window/FreeBSD/JoystickImpl.hpp @@ -31,9 +31,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief FreeBSD implementation of joysticks @@ -118,6 +116,4 @@ private: JoystickState m_state; ///< Current state of the joystick }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp index 40d02a9e..ee1a82d2 100644 --- a/src/SFML/Window/GlContext.cpp +++ b/src/SFML/Window/GlContext.cpp @@ -325,9 +325,7 @@ bool parseVersionString(const char* version, const char* prefix, unsigned int& m } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void GlContext::initResource() @@ -965,6 +963,4 @@ void GlContext::checkSettings(const ContextSettings& requestedSettings) } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/GlContext.hpp b/src/SFML/Window/GlContext.hpp index 8978b758..bb460e29 100644 --- a/src/SFML/Window/GlContext.hpp +++ b/src/SFML/Window/GlContext.hpp @@ -37,9 +37,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { class WindowImpl; @@ -322,6 +320,4 @@ private: const std::uint64_t m_id; //!< Unique number that identifies the context }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/JoystickImpl.hpp b/src/SFML/Window/JoystickImpl.hpp index 743fa14c..a7b8a544 100644 --- a/src/SFML/Window/JoystickImpl.hpp +++ b/src/SFML/Window/JoystickImpl.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Structure holding a joystick's information @@ -58,9 +56,7 @@ struct JoystickState bool buttons[Joystick::ButtonCount]{}; //!< Status of each button (true = pressed) }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv #if defined(SFML_SYSTEM_WINDOWS) diff --git a/src/SFML/Window/JoystickManager.cpp b/src/SFML/Window/JoystickManager.cpp index b665c015..8d4d4323 100644 --- a/src/SFML/Window/JoystickManager.cpp +++ b/src/SFML/Window/JoystickManager.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// JoystickManager& JoystickManager::getInstance() @@ -118,6 +116,4 @@ JoystickManager::~JoystickManager() JoystickImpl::cleanup(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/JoystickManager.hpp b/src/SFML/Window/JoystickManager.hpp index da7dbe6f..af77e5fd 100644 --- a/src/SFML/Window/JoystickManager.hpp +++ b/src/SFML/Window/JoystickManager.hpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Global joystick manager @@ -129,6 +127,4 @@ private: Item m_joysticks[Joystick::Count]; //!< Joysticks information and state }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/NetBSD/JoystickImpl.cpp b/src/SFML/Window/NetBSD/JoystickImpl.cpp index 53dd5c6e..4650eb7e 100644 --- a/src/SFML/Window/NetBSD/JoystickImpl.cpp +++ b/src/SFML/Window/NetBSD/JoystickImpl.cpp @@ -164,9 +164,7 @@ void hatValueToSfml(int value, sf::priv::JoystickState& state) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -353,6 +351,4 @@ JoystickState JoystickImpl::JoystickImpl::update() return m_state; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/NetBSD/JoystickImpl.hpp b/src/SFML/Window/NetBSD/JoystickImpl.hpp index 19779b03..a267fb8b 100644 --- a/src/SFML/Window/NetBSD/JoystickImpl.hpp +++ b/src/SFML/Window/NetBSD/JoystickImpl.hpp @@ -32,9 +32,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief FreeBSD implementation of joysticks @@ -119,6 +117,4 @@ private: JoystickState m_state; ///< Current state of the joystick }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/ClipboardImpl.mm b/src/SFML/Window/OSX/ClipboardImpl.mm index 9a2dc52f..52329787 100644 --- a/src/SFML/Window/OSX/ClipboardImpl.mm +++ b/src/SFML/Window/OSX/ClipboardImpl.mm @@ -31,9 +31,7 @@ #import -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -64,6 +62,4 @@ void ClipboardImpl::setString(const String& text) [data release]; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/CursorImpl.hpp b/src/SFML/Window/OSX/CursorImpl.hpp index e11f85f1..9fd8f82c 100644 --- a/src/SFML/Window/OSX/CursorImpl.hpp +++ b/src/SFML/Window/OSX/CursorImpl.hpp @@ -45,10 +45,7 @@ using NSCursorRef = void*; #endif -namespace sf -{ - -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Mac OS X implementation of Cursor @@ -110,6 +107,4 @@ private: NSCursorRef m_cursor; ///< System cursor handle }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/CursorImpl.mm b/src/SFML/Window/OSX/CursorImpl.mm index 194cd811..83df00ab 100644 --- a/src/SFML/Window/OSX/CursorImpl.mm +++ b/src/SFML/Window/OSX/CursorImpl.mm @@ -47,9 +47,7 @@ NSCursor* loadFromSelector(SEL selector) } -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -141,6 +139,4 @@ bool CursorImpl::loadFromSystem(Cursor::Type type) } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/HIDInputManager.hpp b/src/SFML/Window/OSX/HIDInputManager.hpp index d4697fa0..5e2b449d 100644 --- a/src/SFML/Window/OSX/HIDInputManager.hpp +++ b/src/SFML/Window/OSX/HIDInputManager.hpp @@ -36,9 +36,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { using IOHIDElements = std::vector; @@ -236,6 +234,4 @@ private: //////////////////////////////////////////////////////////// }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/HIDInputManager.mm b/src/SFML/Window/OSX/HIDInputManager.mm index 4539d6fe..1bc4108e 100644 --- a/src/SFML/Window/OSX/HIDInputManager.mm +++ b/src/SFML/Window/OSX/HIDInputManager.mm @@ -32,9 +32,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// HIDInputManager& HIDInputManager::getInstance() @@ -866,6 +864,4 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode) } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/HIDJoystickManager.cpp b/src/SFML/Window/OSX/HIDJoystickManager.cpp index 8d83c352..ae913154 100644 --- a/src/SFML/Window/OSX/HIDJoystickManager.cpp +++ b/src/SFML/Window/OSX/HIDJoystickManager.cpp @@ -40,9 +40,7 @@ const CFStringRef runLoopMode = CFSTR("SFML_RUN_LOOP_MODE"); } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// HIDJoystickManager& HIDJoystickManager::getInstance() @@ -138,6 +136,4 @@ void HIDJoystickManager::pluggedOut(void* context, IOReturn, void*, IOHIDDeviceR } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/HIDJoystickManager.hpp b/src/SFML/Window/OSX/HIDJoystickManager.hpp index d9cf7af5..233c41a3 100644 --- a/src/SFML/Window/OSX/HIDJoystickManager.hpp +++ b/src/SFML/Window/OSX/HIDJoystickManager.hpp @@ -31,9 +31,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief sf::priv::InputImpl helper @@ -127,6 +125,4 @@ private: }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/InputImpl.hpp b/src/SFML/Window/OSX/InputImpl.hpp index 306f788c..80c81e35 100644 --- a/src/SFML/Window/OSX/InputImpl.hpp +++ b/src/SFML/Window/OSX/InputImpl.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Mac OS X implementation of inputs (keyboard + mouse) @@ -159,6 +157,4 @@ public: static Vector2i getTouchPosition(unsigned int finger, const WindowBase& relativeTo); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/InputImpl.mm b/src/SFML/Window/OSX/InputImpl.mm index f1fa437b..e3d07b00 100644 --- a/src/SFML/Window/OSX/InputImpl.mm +++ b/src/SFML/Window/OSX/InputImpl.mm @@ -46,9 +46,7 @@ /// //////////////////////////////////////////////////////////// -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Extract the dedicated SFOpenGLView from the SFML window @@ -236,6 +234,4 @@ Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/, const WindowBase& return Vector2i(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/JoystickImpl.cpp b/src/SFML/Window/OSX/JoystickImpl.cpp index 3f5f7559..183a91de 100644 --- a/src/SFML/Window/OSX/JoystickImpl.cpp +++ b/src/SFML/Window/OSX/JoystickImpl.cpp @@ -86,9 +86,7 @@ unsigned int getDeviceUint(IOHIDDeviceRef ref, CFStringRef prop, unsigned int in } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// JoystickImpl::Location JoystickImpl::m_locationIDs[sf::Joystick::Count] = {0}; @@ -550,6 +548,4 @@ JoystickState JoystickImpl::update() return state; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/JoystickImpl.hpp b/src/SFML/Window/OSX/JoystickImpl.hpp index 94945532..0fee79f2 100644 --- a/src/SFML/Window/OSX/JoystickImpl.hpp +++ b/src/SFML/Window/OSX/JoystickImpl.hpp @@ -36,9 +36,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Mac OS X implementation of joysticks @@ -129,6 +127,4 @@ private: /// location or 0 if there isn't currently a connected joystick device }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/SFContext.hpp b/src/SFML/Window/OSX/SFContext.hpp index 627f8301..a122bace 100644 --- a/src/SFML/Window/OSX/SFContext.hpp +++ b/src/SFML/Window/OSX/SFContext.hpp @@ -53,9 +53,7 @@ using NSWindowRef = void*; #endif -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief OSX (Cocoa) implementation of OpenGL contexts @@ -160,6 +158,4 @@ private: NSWindowRef m_window{}; ///< Only for offscreen context. }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/SFContext.mm b/src/SFML/Window/OSX/SFContext.mm index 0529b7f9..ebe03a48 100644 --- a/src/SFML/Window/OSX/SFContext.mm +++ b/src/SFML/Window/OSX/SFContext.mm @@ -37,11 +37,8 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -namespace sf +namespace sf::priv { -namespace priv -{ - //////////////////////////////////////////////////////////// SFContext::SFContext(SFContext* shared) @@ -293,6 +290,4 @@ void SFContext::createContext(SFContext* shared, unsigned int bitsPerPixel, cons [pixFmt release]; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h index a34b00eb..8c993660 100644 --- a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h +++ b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.h @@ -30,13 +30,10 @@ #import -namespace sf -{ -namespace priv +namespace sf::priv { class WindowImplCocoa; } -} //////////////////////////////////////////////////////////// /// Keyboard Modifiers Helper diff --git a/src/SFML/Window/OSX/SFOpenGLView.h b/src/SFML/Window/OSX/SFOpenGLView.h index 7ee09429..d2f9fad3 100644 --- a/src/SFML/Window/OSX/SFOpenGLView.h +++ b/src/SFML/Window/OSX/SFOpenGLView.h @@ -31,13 +31,10 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -namespace sf -{ -namespace priv +namespace sf::priv { class WindowImplCocoa; } -} @class SFSilentResponder; diff --git a/src/SFML/Window/OSX/SFWindowController.h b/src/SFML/Window/OSX/SFWindowController.h index abe85b25..85053fab 100644 --- a/src/SFML/Window/OSX/SFWindowController.h +++ b/src/SFML/Window/OSX/SFWindowController.h @@ -32,13 +32,10 @@ //////////////////////////////////////////////////////////// /// Predefine some classes //////////////////////////////////////////////////////////// -namespace sf -{ -namespace priv +namespace sf::priv { class WindowImplCocoa; } -} @class SFOpenGLView; diff --git a/src/SFML/Window/OSX/Scaling.h b/src/SFML/Window/OSX/Scaling.h index 6961c800..f5f62bc3 100644 --- a/src/SFML/Window/OSX/Scaling.h +++ b/src/SFML/Window/OSX/Scaling.h @@ -30,9 +30,7 @@ #import -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -98,5 +96,4 @@ void scaleOutXY(T& out, id delegate) scaleOut(out.y, delegate); } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/SensorImpl.cpp b/src/SFML/Window/OSX/SensorImpl.cpp index bdd1c332..114eeaa4 100644 --- a/src/SFML/Window/OSX/SensorImpl.cpp +++ b/src/SFML/Window/OSX/SensorImpl.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void SensorImpl::initialize() @@ -83,6 +81,4 @@ void SensorImpl::setEnabled(bool /*enabled*/) // To be implemented } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/SensorImpl.hpp b/src/SFML/Window/OSX/SensorImpl.hpp index 083f0f7b..aa207f81 100644 --- a/src/SFML/Window/OSX/SensorImpl.hpp +++ b/src/SFML/Window/OSX/SensorImpl.hpp @@ -25,9 +25,7 @@ #pragma once -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Mac OS X implementation of sensors @@ -91,6 +89,4 @@ public: void setEnabled(bool enabled); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/VideoModeImpl.cpp b/src/SFML/Window/OSX/VideoModeImpl.cpp index 660f74af..d35efdfa 100644 --- a/src/SFML/Window/OSX/VideoModeImpl.cpp +++ b/src/SFML/Window/OSX/VideoModeImpl.cpp @@ -33,9 +33,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -96,5 +94,4 @@ VideoMode VideoModeImpl::getDesktopMode() return mode; } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm index 1080a1ae..2e36a91a 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.mm +++ b/src/SFML/Window/OSX/WindowImplCocoa.mm @@ -40,9 +40,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -525,6 +523,4 @@ bool WindowImplCocoa::hasFocus() const } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/WindowImplDelegateProtocol.h b/src/SFML/Window/OSX/WindowImplDelegateProtocol.h index fe93f56c..2f68bcfc 100644 --- a/src/SFML/Window/OSX/WindowImplDelegateProtocol.h +++ b/src/SFML/Window/OSX/WindowImplDelegateProtocol.h @@ -36,13 +36,10 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -namespace sf -{ -namespace priv +namespace sf::priv { class WindowImplCocoa; } -} //////////////////////////////////////////////////////////// /// \brief Interface of the delegate of the window implementation diff --git a/src/SFML/Window/OSX/cg_sf_conversion.hpp b/src/SFML/Window/OSX/cg_sf_conversion.hpp index 406de990..ccca9d49 100644 --- a/src/SFML/Window/OSX/cg_sf_conversion.hpp +++ b/src/SFML/Window/OSX/cg_sf_conversion.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Get bpp of a video mode for OS 10.6 or later @@ -66,5 +64,4 @@ VideoMode convertCGModeToSFMode(CGDisplayModeRef cgmode); //////////////////////////////////////////////////////////// CGDisplayModeRef convertSFModeToCGMode(VideoMode sfmode); -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OSX/cg_sf_conversion.mm b/src/SFML/Window/OSX/cg_sf_conversion.mm index 4800bb77..d41f38ff 100644 --- a/src/SFML/Window/OSX/cg_sf_conversion.mm +++ b/src/SFML/Window/OSX/cg_sf_conversion.mm @@ -32,9 +32,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -95,5 +93,4 @@ VideoMode convertCGModeToSFMode(CGDisplayModeRef cgmode) return mode; } -} // namespace priv -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OpenBSD/JoystickImpl.cpp b/src/SFML/Window/OpenBSD/JoystickImpl.cpp index 30f6b500..ec8d4596 100644 --- a/src/SFML/Window/OpenBSD/JoystickImpl.cpp +++ b/src/SFML/Window/OpenBSD/JoystickImpl.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -91,6 +89,4 @@ JoystickState JoystickImpl::update() return JoystickState(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/OpenBSD/JoystickImpl.hpp b/src/SFML/Window/OpenBSD/JoystickImpl.hpp index 48084335..e25543aa 100644 --- a/src/SFML/Window/OpenBSD/JoystickImpl.hpp +++ b/src/SFML/Window/OpenBSD/JoystickImpl.hpp @@ -25,9 +25,7 @@ #pragma once -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief OpenBSD implementation of joysticks @@ -106,6 +104,4 @@ private: Joystick::Identification m_identification; ///< Joystick identification }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/SensorManager.cpp b/src/SFML/Window/SensorManager.cpp index 401b6480..caf9f489 100644 --- a/src/SFML/Window/SensorManager.cpp +++ b/src/SFML/Window/SensorManager.cpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// SensorManager& SensorManager::getInstance() @@ -134,6 +132,4 @@ SensorManager::~SensorManager() SensorImpl::cleanup(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/SensorManager.hpp b/src/SFML/Window/SensorManager.hpp index de135e68..31fe6e36 100644 --- a/src/SFML/Window/SensorManager.hpp +++ b/src/SFML/Window/SensorManager.hpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Global sensor manager @@ -138,6 +136,4 @@ private: Item m_sensors[Sensor::Count]; //!< Sensors information and state }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/ClipboardImpl.cpp b/src/SFML/Window/Unix/ClipboardImpl.cpp index a6eac3bf..60bc5902 100644 --- a/src/SFML/Window/Unix/ClipboardImpl.cpp +++ b/src/SFML/Window/Unix/ClipboardImpl.cpp @@ -47,9 +47,7 @@ Bool checkEvent(::Display*, XEvent* event, XPointer userData) } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -380,6 +378,4 @@ void ClipboardImpl::processEvent(XEvent& windowEvent) } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/ClipboardImpl.hpp b/src/SFML/Window/Unix/ClipboardImpl.hpp index c3945f06..537c9f46 100644 --- a/src/SFML/Window/Unix/ClipboardImpl.hpp +++ b/src/SFML/Window/Unix/ClipboardImpl.hpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -147,6 +145,4 @@ private: bool m_requestResponded{}; ///< Holds whether our selection request has been responded to or not }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/CursorImpl.cpp b/src/SFML/Window/Unix/CursorImpl.cpp index d0b46e0b..ec47ef6f 100644 --- a/src/SFML/Window/Unix/CursorImpl.cpp +++ b/src/SFML/Window/Unix/CursorImpl.cpp @@ -36,9 +36,7 @@ #include #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -216,6 +214,4 @@ void CursorImpl::release() } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/CursorImpl.hpp b/src/SFML/Window/Unix/CursorImpl.hpp index a5bee9e6..7ebb1015 100644 --- a/src/SFML/Window/Unix/CursorImpl.hpp +++ b/src/SFML/Window/Unix/CursorImpl.hpp @@ -33,10 +33,7 @@ #include -namespace sf -{ - -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Unix implementation of Cursor @@ -127,6 +124,4 @@ private: ::Cursor m_cursor{None}; }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/Display.cpp b/src/SFML/Window/Unix/Display.cpp index 09a98da9..eddb8713 100644 --- a/src/SFML/Window/Unix/Display.cpp +++ b/src/SFML/Window/Unix/Display.cpp @@ -50,9 +50,7 @@ using AtomMap = std::unordered_map; AtomMap atoms; } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// Display* openDisplay() @@ -157,6 +155,4 @@ Atom getAtom(const std::string& name, bool onlyIfExists) return atom; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/Display.hpp b/src/SFML/Window/Unix/Display.hpp index df616692..5b34772e 100644 --- a/src/SFML/Window/Unix/Display.hpp +++ b/src/SFML/Window/Unix/Display.hpp @@ -34,9 +34,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Get the shared Display @@ -89,6 +87,4 @@ void closeXim(XIM xim); //////////////////////////////////////////////////////////// Atom getAtom(const std::string& name, bool onlyIfExists = false); -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp index 6e31cd56..d59f45a7 100644 --- a/src/SFML/Window/Unix/GlxContext.cpp +++ b/src/SFML/Window/Unix/GlxContext.cpp @@ -101,9 +101,7 @@ private: } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// GlxContext::GlxContext(GlxContext* shared) @@ -784,6 +782,4 @@ void GlxContext::createContext(GlxContext* shared) XFree(visualInfo); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/GlxContext.hpp b/src/SFML/Window/Unix/GlxContext.hpp index 1f545f9b..76a9a0dd 100644 --- a/src/SFML/Window/Unix/GlxContext.hpp +++ b/src/SFML/Window/Unix/GlxContext.hpp @@ -34,9 +34,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Linux (GLX) implementation of OpenGL contexts @@ -182,6 +180,4 @@ private: bool m_ownsWindow{}; ///< Do we own the window associated to the context? }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/InputImpl.cpp b/src/SFML/Window/Unix/InputImpl.cpp index 085c8de4..90b0faee 100644 --- a/src/SFML/Window/Unix/InputImpl.cpp +++ b/src/SFML/Window/Unix/InputImpl.cpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool InputImpl::isKeyPressed(Keyboard::Key key) @@ -332,6 +330,4 @@ Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/, const WindowBase& return Vector2i(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/InputImpl.hpp b/src/SFML/Window/Unix/InputImpl.hpp index 834b9283..182ce296 100644 --- a/src/SFML/Window/Unix/InputImpl.hpp +++ b/src/SFML/Window/Unix/InputImpl.hpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Linux (X11) implementation of inputs (keyboard + mouse) @@ -158,6 +156,4 @@ public: static Vector2i getTouchPosition(unsigned int finger, const WindowBase& relativeTo); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/JoystickImpl.cpp b/src/SFML/Window/Unix/JoystickImpl.cpp index 2c978214..cb1e988d 100644 --- a/src/SFML/Window/Unix/JoystickImpl.cpp +++ b/src/SFML/Window/Unix/JoystickImpl.cpp @@ -430,9 +430,7 @@ std::string getJoystickName(unsigned int index) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -711,6 +709,4 @@ JoystickState JoystickImpl::JoystickImpl::update() return m_state; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/JoystickImpl.hpp b/src/SFML/Window/Unix/JoystickImpl.hpp index 9e4e3e15..8ba20530 100644 --- a/src/SFML/Window/Unix/JoystickImpl.hpp +++ b/src/SFML/Window/Unix/JoystickImpl.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Linux implementation of joysticks @@ -115,6 +113,4 @@ private: sf::Joystick::Identification m_identification; ///< Identification of the joystick }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/SensorImpl.cpp b/src/SFML/Window/Unix/SensorImpl.cpp index bdd1c332..114eeaa4 100644 --- a/src/SFML/Window/Unix/SensorImpl.cpp +++ b/src/SFML/Window/Unix/SensorImpl.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void SensorImpl::initialize() @@ -83,6 +81,4 @@ void SensorImpl::setEnabled(bool /*enabled*/) // To be implemented } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/SensorImpl.hpp b/src/SFML/Window/Unix/SensorImpl.hpp index e7ac7e76..7bfc524f 100644 --- a/src/SFML/Window/Unix/SensorImpl.hpp +++ b/src/SFML/Window/Unix/SensorImpl.hpp @@ -25,9 +25,7 @@ #pragma once -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Unix implementation of sensors @@ -91,6 +89,4 @@ public: void setEnabled(bool enabled); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/VideoModeImpl.cpp b/src/SFML/Window/Unix/VideoModeImpl.cpp index 60542ffb..977e2cb2 100644 --- a/src/SFML/Window/Unix/VideoModeImpl.cpp +++ b/src/SFML/Window/Unix/VideoModeImpl.cpp @@ -36,9 +36,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() @@ -194,6 +192,4 @@ VideoMode VideoModeImpl::getDesktopMode() return desktopMode; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/VulkanImplX11.cpp b/src/SFML/Window/Unix/VulkanImplX11.cpp index 81520b19..820c9138 100644 --- a/src/SFML/Window/Unix/VulkanImplX11.cpp +++ b/src/SFML/Window/Unix/VulkanImplX11.cpp @@ -101,9 +101,7 @@ VulkanLibraryWrapper wrapper; } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool VulkanImplX11::isAvailable(bool requireGraphics) @@ -213,6 +211,4 @@ bool VulkanImplX11::createVulkanSurface(const VkInstance& instance, return result; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/VulkanImplX11.hpp b/src/SFML/Window/Unix/VulkanImplX11.hpp index 24b461dd..ab177687 100644 --- a/src/SFML/Window/Unix/VulkanImplX11.hpp +++ b/src/SFML/Window/Unix/VulkanImplX11.hpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Linux (X11) implementation of Vulkan @@ -97,6 +95,4 @@ public: const VkAllocationCallbacks* allocator); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index 472e16e1..3ab400b8 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -473,9 +473,7 @@ sf::Keyboard::Key keysymToSF(KeySym symbol) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// WindowImplX11::WindowImplX11(WindowHandle handle) : m_isExternal(true) @@ -2257,6 +2255,4 @@ Vector2i WindowImplX11::getPrimaryMonitorPosition() return monitorPosition; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Unix/WindowImplX11.hpp b/src/SFML/Window/Unix/WindowImplX11.hpp index bd2e6534..6001bb85 100644 --- a/src/SFML/Window/Unix/WindowImplX11.hpp +++ b/src/SFML/Window/Unix/WindowImplX11.hpp @@ -37,9 +37,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Linux (X11) implementation of WindowImpl @@ -317,6 +315,4 @@ private: ::Time m_lastInputTime{}; ///< Last time we received user input }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/VideoModeImpl.hpp b/src/SFML/Window/VideoModeImpl.hpp index 42614f35..a66ef070 100644 --- a/src/SFML/Window/VideoModeImpl.hpp +++ b/src/SFML/Window/VideoModeImpl.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief OS-specific implementation of video modes functions @@ -58,6 +56,4 @@ public: static VideoMode getDesktopMode(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/ClipboardImpl.cpp b/src/SFML/Window/Win32/ClipboardImpl.cpp index 5f9e5cab..fe5a8ee3 100644 --- a/src/SFML/Window/Win32/ClipboardImpl.cpp +++ b/src/SFML/Window/Win32/ClipboardImpl.cpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// String ClipboardImpl::getString() @@ -100,6 +98,4 @@ void ClipboardImpl::setString(const String& text) CloseClipboard(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/CursorImpl.cpp b/src/SFML/Window/Win32/CursorImpl.cpp index d268e22b..fe258334 100644 --- a/src/SFML/Window/Win32/CursorImpl.cpp +++ b/src/SFML/Window/Win32/CursorImpl.cpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// CursorImpl::~CursorImpl() @@ -185,6 +183,4 @@ void CursorImpl::release() } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/CursorImpl.hpp b/src/SFML/Window/Win32/CursorImpl.hpp index 57ace64c..2afdd9b3 100644 --- a/src/SFML/Window/Win32/CursorImpl.hpp +++ b/src/SFML/Window/Win32/CursorImpl.hpp @@ -30,10 +30,7 @@ #include #include -namespace sf -{ - -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Win32 implementation of Cursor @@ -102,6 +99,4 @@ private: bool m_systemCursor{}; }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp index bcf2f77d..a403000c 100644 --- a/src/SFML/Window/Win32/InputImpl.cpp +++ b/src/SFML/Window/Win32/InputImpl.cpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool InputImpl::isKeyPressed(Keyboard::Key key) @@ -258,6 +256,4 @@ Vector2i InputImpl::getTouchPosition(unsigned int /*finger*/, const WindowBase& return Vector2i(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/InputImpl.hpp b/src/SFML/Window/Win32/InputImpl.hpp index f515a2c5..5c84955b 100644 --- a/src/SFML/Window/Win32/InputImpl.hpp +++ b/src/SFML/Window/Win32/InputImpl.hpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Windows implementation of inputs (keyboard + mouse) @@ -158,6 +156,4 @@ public: static Vector2i getTouchPosition(unsigned int finger, const WindowBase& relativeTo); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/JoystickImpl.cpp b/src/SFML/Window/Win32/JoystickImpl.cpp index 6af4d117..c52395f7 100644 --- a/src/SFML/Window/Win32/JoystickImpl.cpp +++ b/src/SFML/Window/Win32/JoystickImpl.cpp @@ -217,9 +217,7 @@ sf::String getDeviceName(unsigned int index, JOYCAPS caps) } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -1171,6 +1169,4 @@ BOOL CALLBACK JoystickImpl::deviceObjectEnumerationCallback(const DIDEVICEOBJECT return DIENUM_CONTINUE; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/JoystickImpl.hpp b/src/SFML/Window/Win32/JoystickImpl.hpp index c35d2d1e..7617f9e2 100644 --- a/src/SFML/Window/Win32/JoystickImpl.hpp +++ b/src/SFML/Window/Win32/JoystickImpl.hpp @@ -35,9 +35,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Windows implementation of joysticks @@ -227,6 +225,4 @@ private: bool m_buffered; //!< true if the device uses buffering, false if the device uses polling }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/SensorImpl.cpp b/src/SFML/Window/Win32/SensorImpl.cpp index bdd1c332..114eeaa4 100644 --- a/src/SFML/Window/Win32/SensorImpl.cpp +++ b/src/SFML/Window/Win32/SensorImpl.cpp @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void SensorImpl::initialize() @@ -83,6 +81,4 @@ void SensorImpl::setEnabled(bool /*enabled*/) // To be implemented } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/SensorImpl.hpp b/src/SFML/Window/Win32/SensorImpl.hpp index f7c61dc8..cb22f7dd 100644 --- a/src/SFML/Window/Win32/SensorImpl.hpp +++ b/src/SFML/Window/Win32/SensorImpl.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Windows implementation of sensors @@ -96,6 +94,4 @@ public: void setEnabled(bool enabled); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/VideoModeImpl.cpp b/src/SFML/Window/Win32/VideoModeImpl.cpp index 47c3d6fc..5ecd0517 100644 --- a/src/SFML/Window/Win32/VideoModeImpl.cpp +++ b/src/SFML/Window/Win32/VideoModeImpl.cpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() @@ -69,6 +67,4 @@ VideoMode VideoModeImpl::getDesktopMode() return VideoMode({win32Mode.dmPelsWidth, win32Mode.dmPelsHeight}, win32Mode.dmBitsPerPel); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/VulkanImplWin32.cpp b/src/SFML/Window/Win32/VulkanImplWin32.cpp index 023d1e85..c7ee8c79 100644 --- a/src/SFML/Window/Win32/VulkanImplWin32.cpp +++ b/src/SFML/Window/Win32/VulkanImplWin32.cpp @@ -100,9 +100,7 @@ VulkanLibraryWrapper wrapper; } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool VulkanImplWin32::isAvailable(bool requireGraphics) @@ -206,6 +204,4 @@ bool VulkanImplWin32::createVulkanSurface(const VkInstance& instance, return (vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, allocator, &surface) == VK_SUCCESS); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/VulkanImplWin32.hpp b/src/SFML/Window/Win32/VulkanImplWin32.hpp index e00fa60c..ad07acfa 100644 --- a/src/SFML/Window/Win32/VulkanImplWin32.hpp +++ b/src/SFML/Window/Win32/VulkanImplWin32.hpp @@ -33,9 +33,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Windows implementation of Vulkan @@ -97,6 +95,4 @@ public: const VkAllocationCallbacks* allocator); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp index 1c546b5a..788f1419 100644 --- a/src/SFML/Window/Win32/WglContext.cpp +++ b/src/SFML/Window/Win32/WglContext.cpp @@ -81,9 +81,7 @@ void ensureExtensionsInit(HDC deviceContext) } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// String getErrorString(DWORD errorCode) @@ -779,6 +777,4 @@ void WglContext::createContext(WglContext* shared) } } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/WglContext.hpp b/src/SFML/Window/Win32/WglContext.hpp index db3de98c..5cd9461e 100644 --- a/src/SFML/Window/Win32/WglContext.hpp +++ b/src/SFML/Window/Win32/WglContext.hpp @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief Windows (WGL) implementation of OpenGL contexts @@ -185,6 +183,4 @@ private: bool m_ownsWindow{}; //!< Do we own the target window? }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp index 6e70b07b..87e3f1dc 100644 --- a/src/SFML/Window/Win32/WindowImplWin32.cpp +++ b/src/SFML/Window/Win32/WindowImplWin32.cpp @@ -125,9 +125,7 @@ void setProcessDpiAware() } } // namespace -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// WindowImplWin32::WindowImplWin32(WindowHandle handle) : m_handle(handle) @@ -1157,6 +1155,4 @@ LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARA return DefWindowProcW(handle, message, wParam, lParam); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/WindowImpl.cpp b/src/SFML/Window/WindowImpl.cpp index e621d5a1..dc3aedac 100644 --- a/src/SFML/Window/WindowImpl.cpp +++ b/src/SFML/Window/WindowImpl.cpp @@ -89,9 +89,7 @@ using WindowImplType = sf::priv::WindowImplAndroid; #endif -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -310,6 +308,4 @@ bool WindowImpl::createVulkanSurface([[maybe_unused]] const VkInstance& #endif } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/ClipboardImpl.mm b/src/SFML/Window/iOS/ClipboardImpl.mm index 50aad8cc..e750919e 100644 --- a/src/SFML/Window/iOS/ClipboardImpl.mm +++ b/src/SFML/Window/iOS/ClipboardImpl.mm @@ -30,9 +30,7 @@ #import -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// @@ -65,6 +63,4 @@ void ClipboardImpl::setString(const String& text) pboard.string = data; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/CursorImpl.cpp b/src/SFML/Window/iOS/CursorImpl.cpp index a889d4e2..63821ddc 100644 --- a/src/SFML/Window/iOS/CursorImpl.cpp +++ b/src/SFML/Window/iOS/CursorImpl.cpp @@ -27,9 +27,7 @@ //////////////////////////////////////////////////////////// #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool CursorImpl::loadFromPixels(const std::uint8_t* /* pixels */, Vector2u /* size */, Vector2u /* hotspot */) @@ -47,6 +45,4 @@ bool CursorImpl::loadFromSystem(Cursor::Type /* type */) } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/CursorImpl.hpp b/src/SFML/Window/iOS/CursorImpl.hpp index 27414297..782eb4b5 100644 --- a/src/SFML/Window/iOS/CursorImpl.hpp +++ b/src/SFML/Window/iOS/CursorImpl.hpp @@ -31,10 +31,7 @@ #include -namespace sf -{ - -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief iOS implementation of Cursor @@ -82,6 +79,4 @@ public: bool loadFromSystem(Cursor::Type type); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/EaglContext.hpp b/src/SFML/Window/iOS/EaglContext.hpp index 3c90f629..13c7b028 100644 --- a/src/SFML/Window/iOS/EaglContext.hpp +++ b/src/SFML/Window/iOS/EaglContext.hpp @@ -40,9 +40,7 @@ SFML_DECLARE_OBJC_CLASS(EAGLContext); SFML_DECLARE_OBJC_CLASS(SFView); -namespace sf -{ -namespace priv +namespace sf::priv { class WindowImplUIKit; @@ -166,8 +164,6 @@ private: Clock m_clock; ///< Measures the elapsed time for the fake v-sync implementation }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv #pragma GCC diagnostic pop diff --git a/src/SFML/Window/iOS/EaglContext.mm b/src/SFML/Window/iOS/EaglContext.mm index 7ac51bad..8f6f8093 100644 --- a/src/SFML/Window/iOS/EaglContext.mm +++ b/src/SFML/Window/iOS/EaglContext.mm @@ -88,9 +88,7 @@ void ensureInit() } -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// EaglContext::EaglContext(EaglContext* shared) : m_context(nil) @@ -315,6 +313,4 @@ void EaglContext::createContext(EaglContext* shared, makeCurrent(false); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/InputImpl.hpp b/src/SFML/Window/iOS/InputImpl.hpp index 95ae377a..3d3b42a0 100644 --- a/src/SFML/Window/iOS/InputImpl.hpp +++ b/src/SFML/Window/iOS/InputImpl.hpp @@ -31,9 +31,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief iOS implementation of inputs (keyboard + mouse) @@ -158,6 +156,4 @@ public: static Vector2i getTouchPosition(unsigned int finger, const WindowBase& relativeTo); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/InputImpl.mm b/src/SFML/Window/iOS/InputImpl.mm index 732f4b24..6466bf7e 100644 --- a/src/SFML/Window/iOS/InputImpl.mm +++ b/src/SFML/Window/iOS/InputImpl.mm @@ -32,9 +32,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// bool InputImpl::isKeyPressed(Keyboard::Key /* key */) @@ -107,6 +105,4 @@ Vector2i InputImpl::getTouchPosition(unsigned int finger, const WindowBase& /* r return getTouchPosition(finger); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/JoystickImpl.hpp b/src/SFML/Window/iOS/JoystickImpl.hpp index fcdce0ef..521e96e7 100644 --- a/src/SFML/Window/iOS/JoystickImpl.hpp +++ b/src/SFML/Window/iOS/JoystickImpl.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief iOS implementation of joysticks @@ -104,6 +102,4 @@ public: [[nodiscard]] JoystickState update(); }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/JoystickImpl.mm b/src/SFML/Window/iOS/JoystickImpl.mm index 8176e9ab..285aa8cd 100644 --- a/src/SFML/Window/iOS/JoystickImpl.mm +++ b/src/SFML/Window/iOS/JoystickImpl.mm @@ -28,9 +28,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void JoystickImpl::initialize() @@ -92,6 +90,4 @@ JoystickState JoystickImpl::update() return JoystickState(); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/SensorImpl.hpp b/src/SFML/Window/iOS/SensorImpl.hpp index 5c049821..8a89bb76 100644 --- a/src/SFML/Window/iOS/SensorImpl.hpp +++ b/src/SFML/Window/iOS/SensorImpl.hpp @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief iOS implementation of sensors @@ -103,6 +101,4 @@ private: bool m_enabled; ///< Enable state of the sensor }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/SensorImpl.mm b/src/SFML/Window/iOS/SensorImpl.mm index 3a4e3a6e..6b7c1b4a 100644 --- a/src/SFML/Window/iOS/SensorImpl.mm +++ b/src/SFML/Window/iOS/SensorImpl.mm @@ -41,9 +41,7 @@ float toDegrees(float radians) } -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// void SensorImpl::initialize() @@ -238,6 +236,4 @@ void SensorImpl::setEnabled(bool enabled) m_enabled = enabled; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/VideoModeImpl.mm b/src/SFML/Window/iOS/VideoModeImpl.mm index 51286d25..ec002ff1 100644 --- a/src/SFML/Window/iOS/VideoModeImpl.mm +++ b/src/SFML/Window/iOS/VideoModeImpl.mm @@ -30,9 +30,7 @@ #include -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() @@ -56,6 +54,4 @@ VideoMode VideoModeImpl::getDesktopMode() static_cast(bounds.size.height * backingScale)}); } -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/WindowImplUIKit.hpp b/src/SFML/Window/iOS/WindowImplUIKit.hpp index a73a943e..6c96bbdc 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.hpp +++ b/src/SFML/Window/iOS/WindowImplUIKit.hpp @@ -37,9 +37,7 @@ SFML_DECLARE_OBJC_CLASS(SFView); SFML_DECLARE_OBJC_CLASS(SFViewController); -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// /// \brief iOS (UIKit) implementation of WindowImpl @@ -222,6 +220,4 @@ private: float m_backingScale; ///< Converts from points to pixels and vice versa }; -} // namespace priv - -} // namespace sf +} // namespace sf::priv diff --git a/src/SFML/Window/iOS/WindowImplUIKit.mm b/src/SFML/Window/iOS/WindowImplUIKit.mm index 26b1842a..05b40a64 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.mm +++ b/src/SFML/Window/iOS/WindowImplUIKit.mm @@ -36,9 +36,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -namespace sf -{ -namespace priv +namespace sf::priv { //////////////////////////////////////////////////////////// WindowImplUIKit::WindowImplUIKit(WindowHandle /* handle */) @@ -238,6 +236,4 @@ void WindowImplUIKit::setVirtualKeyboardVisible(bool visible) [m_view resignFirstResponder]; } -} // namespace priv - -} // namespace sf +} // namespace sf::priv