From 2d2f6847869802ebdce45898a2ff15a4a1f717f8 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 23 Mar 2023 14:13:52 -0600 Subject: [PATCH] Fix clang-tidy-16 errors --- .github/workflows/ci.yml | 5 ++++- src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm | 7 +++++-- test/System/FileInputStream.test.cpp | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9d8f5048..f156196f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,9 @@ jobs: - name: Install macOS Tools if: runner.os == 'macOS' - run: brew install gcovr ninja + run: | + brew update + brew install gcovr ninja - name: Install OpenCppCoverage and add to PATH uses: nick-fields/retry@v2 @@ -208,6 +210,7 @@ jobs: - name: Install macOS Dependencies if: runner.os == 'macOS' run: | + brew update brew install llvm echo /usr/local/opt/llvm/bin >> $GITHUB_PATH diff --git a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm index 73682e68c..90dd52041 100644 --- a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm +++ b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm @@ -70,9 +70,12 @@ struct ModifiersState // Global Variables //////////////////////////////////////////////////////////// +namespace +{ /// Share 'modifiers' state with all windows to correctly fire pressed/released events -static ModifiersState state; -static BOOL isStateInitialized = NO; +ModifiersState state; +BOOL isStateInitialized = NO; +} //////////////////////////////////////////////////////////// diff --git a/test/System/FileInputStream.test.cpp b/test/System/FileInputStream.test.cpp index 384d51fad..6b2a7d697 100644 --- a/test/System/FileInputStream.test.cpp +++ b/test/System/FileInputStream.test.cpp @@ -14,7 +14,9 @@ static_assert(!std::is_copy_assignable_v); static_assert(std::is_nothrow_move_constructible_v); static_assert(std::is_nothrow_move_assignable_v); -static std::string getTemporaryFilePath() +namespace +{ +std::string getTemporaryFilePath() { static int counter = 0; @@ -63,6 +65,7 @@ public: return m_path; } }; +} // namespace TEST_CASE("[System] sf::FileInputStream") {