mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Upgrade to clang-format-17
This commit is contained in:
parent
7a8d75b7ac
commit
c38b98c653
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -269,17 +269,17 @@ jobs:
|
|||||||
|
|
||||||
format:
|
format:
|
||||||
name: Formatting
|
name: Formatting
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Install Clang Format
|
||||||
|
run: sudo apt-get install clang-format-17
|
||||||
|
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Format Code
|
- 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
|
- name: Check Formatting
|
||||||
run: git diff --exit-code
|
run: git diff --exit-code
|
||||||
|
@ -529,7 +529,7 @@ if(SFML_BUILD_TEST_SUITE)
|
|||||||
endif()
|
endif()
|
||||||
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
|
add_custom_target(format
|
||||||
COMMAND ${CMAKE_COMMAND} -DCLANG_FORMAT_EXECUTABLE=${CLANG_FORMAT_EXECUTABLE} -P ./cmake/Format.cmake
|
COMMAND ${CMAKE_COMMAND} -DCLANG_FORMAT_EXECUTABLE=${CLANG_FORMAT_EXECUTABLE} -P ./cmake/Format.cmake
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
|
||||||
|
@ -13,8 +13,8 @@ endif()
|
|||||||
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} --version OUTPUT_VARIABLE CLANG_FORMAT_VERSION)
|
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})
|
string(REGEX MATCH "clang-format version ([0-9]+)" CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION})
|
||||||
unset(CLANG_FORMAT_VERSION)
|
unset(CLANG_FORMAT_VERSION)
|
||||||
if(NOT CMAKE_MATCH_1 EQUAL 14)
|
if(NOT CMAKE_MATCH_1 EQUAL 17)
|
||||||
message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 14")
|
message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 17")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
|
@ -86,7 +86,7 @@ void ensureInit()
|
|||||||
sf::priv::EaglContext::getFunction("glRenderbufferStorageOES"));
|
sf::priv::EaglContext::getFunction("glRenderbufferStorageOES"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
namespace sf::priv
|
namespace sf::priv
|
||||||
|
@ -138,4 +138,4 @@ Vector2i getTouchPosition(unsigned int finger, const WindowBase& /* relativeTo *
|
|||||||
return getTouchPosition(finger);
|
return getTouchPosition(finger);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sf::priv
|
} // namespace sf::priv::InputImpl
|
||||||
|
@ -38,7 +38,7 @@ SFAppDelegate* delegateInstance = nullptr;
|
|||||||
|
|
||||||
// Current touches positions
|
// Current touches positions
|
||||||
std::vector<sf::Vector2i> touchPositions;
|
std::vector<sf::Vector2i> touchPositions;
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@interface SFAppDelegate ()
|
@interface SFAppDelegate ()
|
||||||
|
@ -45,7 +45,7 @@ NSCursor* loadFromSelector(SEL selector)
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
namespace sf::priv
|
namespace sf::priv
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ namespace
|
|||||||
{
|
{
|
||||||
const std::uint8_t unknownVirtualCode = 0xff;
|
const std::uint8_t unknownVirtualCode = 0xff;
|
||||||
const bool isIsoKeyboard = (KBGetLayoutType(LMGetKbdType()) == kKeyboardISO);
|
const bool isIsoKeyboard = (KBGetLayoutType(LMGetKbdType()) == kKeyboardISO);
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
namespace sf::priv
|
namespace sf::priv
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const sf::WindowBase& window)
|
|||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
namespace sf::priv::InputImpl
|
namespace sf::priv::InputImpl
|
||||||
{
|
{
|
||||||
@ -263,4 +263,4 @@ Vector2i getTouchPosition(unsigned int /*finger*/, const WindowBase& /*relativeT
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sf::priv
|
} // namespace sf::priv::InputImpl
|
||||||
|
@ -131,7 +131,7 @@ void processLeftRightModifiers(
|
|||||||
processOneModifier(modifiers, leftMask, leftWasDown, leftKey, leftCode, requester);
|
processOneModifier(modifiers, leftMask, leftWasDown, leftKey, leftCode, requester);
|
||||||
processOneModifier(modifiers, rightMask, rightWasDown, rightKey, rightCode, requester);
|
processOneModifier(modifiers, rightMask, rightWasDown, rightKey, rightCode, requester);
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
@ -93,7 +93,7 @@ void showMouseCursor()
|
|||||||
isCursorHidden = false;
|
isCursorHidden = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
#pragma mark
|
#pragma mark
|
||||||
#pragma mark WindowImplCocoa's ctor/dtor
|
#pragma mark WindowImplCocoa's ctor/dtor
|
||||||
|
Loading…
Reference in New Issue
Block a user