From a05daa62b73360421a42c0e6a6f70c824960351d Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 21 Apr 2024 14:11:33 -0600 Subject: [PATCH] Use more C++17 inline variables --- include/SFML/Graphics/Shader.hpp | 2 +- src/SFML/Graphics/Shader.cpp | 8 -------- src/SFML/Window/macOS/JoystickImpl.cpp | 4 ---- src/SFML/Window/macOS/JoystickImpl.hpp | 2 +- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/include/SFML/Graphics/Shader.hpp b/include/SFML/Graphics/Shader.hpp index 166786bca..4bf47b4f1 100644 --- a/include/SFML/Graphics/Shader.hpp +++ b/include/SFML/Graphics/Shader.hpp @@ -81,7 +81,7 @@ public: /// //////////////////////////////////////////////////////////// // NOLINTNEXTLINE(readability-identifier-naming) - static CurrentTextureType CurrentTexture; + static inline CurrentTextureType CurrentTexture; //////////////////////////////////////////////////////////// /// \brief Default constructor diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index bf2c75996..a509f7908 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -174,10 +174,6 @@ std::vector flatten(const sf::Glsl::Vec4* vectorArray, std::size_t length namespace sf { -//////////////////////////////////////////////////////////// -Shader::CurrentTextureType Shader::CurrentTexture; - - //////////////////////////////////////////////////////////// struct Shader::UniformBinder { @@ -961,10 +957,6 @@ int Shader::getUniformLocation(const std::string& name) namespace sf { -//////////////////////////////////////////////////////////// -Shader::CurrentTextureType Shader::CurrentTexture; - - //////////////////////////////////////////////////////////// Shader::~Shader() = default; diff --git a/src/SFML/Window/macOS/JoystickImpl.cpp b/src/SFML/Window/macOS/JoystickImpl.cpp index 6f8926cc1..d7b257640 100644 --- a/src/SFML/Window/macOS/JoystickImpl.cpp +++ b/src/SFML/Window/macOS/JoystickImpl.cpp @@ -85,10 +85,6 @@ unsigned int getDeviceUint(IOHIDDeviceRef ref, CFStringRef prop, unsigned int in namespace sf::priv { -//////////////////////////////////////////////////////////// -JoystickImpl::Location JoystickImpl::m_locationIDs[sf::Joystick::Count] = {0}; - - //////////////////////////////////////////////////////////// void JoystickImpl::initialize() { diff --git a/src/SFML/Window/macOS/JoystickImpl.hpp b/src/SFML/Window/macOS/JoystickImpl.hpp index 390934728..d5cde0cf7 100644 --- a/src/SFML/Window/macOS/JoystickImpl.hpp +++ b/src/SFML/Window/macOS/JoystickImpl.hpp @@ -121,7 +121,7 @@ private: Joystick::Identification m_identification; ///< Joystick identification // NOLINTNEXTLINE(readability-identifier-naming) - static Location m_locationIDs[sf::Joystick::Count]; ///< Global Joystick register + static inline Location m_locationIDs[sf::Joystick::Count]{}; ///< Global Joystick register /// For a corresponding SFML index, m_locationIDs is either some USB /// location or 0 if there isn't currently a connected joystick device };