Upgrade to clang-format-17

This commit is contained in:
Chris Thrasher 2024-10-13 16:59:21 -06:00
parent 7a8d75b7ac
commit c38b98c653
32 changed files with 80 additions and 80 deletions

View File

@ -269,17 +269,17 @@ jobs:
format:
name: Formatting
runs-on: ubuntu-22.04
strategy:
fail-fast: false
runs-on: ubuntu-24.04
steps:
- name: Install Clang Format
run: sudo apt-get install clang-format-17
- name: Checkout Code
uses: actions/checkout@v4
- name: Format Code
run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-14 -P cmake/Format.cmake
run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-17 -P cmake/Format.cmake
- name: Check Formatting
run: git diff --exit-code

View File

@ -529,7 +529,7 @@ if(SFML_BUILD_TEST_SUITE)
endif()
endif()
sfml_set_option(CLANG_FORMAT_EXECUTABLE clang-format STRING "Override clang-format executable, requires version 14")
sfml_set_option(CLANG_FORMAT_EXECUTABLE clang-format STRING "Override clang-format executable, requires version 17")
add_custom_target(format
COMMAND ${CMAKE_COMMAND} -DCLANG_FORMAT_EXECUTABLE=${CLANG_FORMAT_EXECUTABLE} -P ./cmake/Format.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)

View File

@ -13,8 +13,8 @@ endif()
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} --version OUTPUT_VARIABLE CLANG_FORMAT_VERSION)
string(REGEX MATCH "clang-format version ([0-9]+)" CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION})
unset(CLANG_FORMAT_VERSION)
if(NOT CMAKE_MATCH_1 EQUAL 14)
message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 14")
if(NOT CMAKE_MATCH_1 EQUAL 17)
message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 17")
endif()
# Run

View File

@ -86,7 +86,7 @@ void ensureInit()
sf::priv::EaglContext::getFunction("glRenderbufferStorageOES"));
}
}
}
} // namespace
namespace sf::priv

View File

@ -138,4 +138,4 @@ Vector2i getTouchPosition(unsigned int finger, const WindowBase& /* relativeTo *
return getTouchPosition(finger);
}
} // namespace sf::priv
} // namespace sf::priv::InputImpl

View File

@ -38,7 +38,7 @@ SFAppDelegate* delegateInstance = nullptr;
// Current touches positions
std::vector<sf::Vector2i> touchPositions;
}
} // namespace
@interface SFAppDelegate ()

View File

@ -45,7 +45,7 @@ NSCursor* loadFromSelector(SEL selector)
return nil;
}
}
} // namespace
namespace sf::priv
{

View File

@ -37,7 +37,7 @@ namespace
{
const std::uint8_t unknownVirtualCode = 0xff;
const bool isIsoKeyboard = (KBGetLayoutType(LMGetKbdType()) == kKeyboardISO);
}
} // namespace
namespace sf::priv
{

View File

@ -115,7 +115,7 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const sf::WindowBase& window)
return view;
}
}
} // namespace
namespace sf::priv::InputImpl
{
@ -263,4 +263,4 @@ Vector2i getTouchPosition(unsigned int /*finger*/, const WindowBase& /*relativeT
return {};
}
} // namespace sf::priv
} // namespace sf::priv::InputImpl

View File

@ -131,7 +131,7 @@ void processLeftRightModifiers(
processOneModifier(modifiers, leftMask, leftWasDown, leftKey, leftCode, requester);
processOneModifier(modifiers, rightMask, rightWasDown, rightKey, rightCode, requester);
}
}
} // namespace
////////////////////////////////////////////////////////

View File

@ -93,7 +93,7 @@ void showMouseCursor()
isCursorHidden = false;
}
}
}
} // namespace
#pragma mark
#pragma mark WindowImplCocoa's ctor/dtor