Skip to content

Commit c38b98c

Browse files
committed
Upgrade to clang-format-17
1 parent 7a8d75b commit c38b98c

32 files changed

Lines changed: 80 additions & 80 deletions

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,17 @@ jobs:
269269

270270
format:
271271
name: Formatting
272-
runs-on: ubuntu-22.04
273-
274-
strategy:
275-
fail-fast: false
272+
runs-on: ubuntu-24.04
276273

277274
steps:
275+
- name: Install Clang Format
276+
run: sudo apt-get install clang-format-17
277+
278278
- name: Checkout Code
279279
uses: actions/checkout@v4
280280

281281
- name: Format Code
282-
run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-14 -P cmake/Format.cmake
282+
run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-17 -P cmake/Format.cmake
283283

284284
- name: Check Formatting
285285
run: git diff --exit-code

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ if(SFML_BUILD_TEST_SUITE)
529529
endif()
530530
endif()
531531

532-
sfml_set_option(CLANG_FORMAT_EXECUTABLE clang-format STRING "Override clang-format executable, requires version 14")
532+
sfml_set_option(CLANG_FORMAT_EXECUTABLE clang-format STRING "Override clang-format executable, requires version 17")
533533
add_custom_target(format
534534
COMMAND ${CMAKE_COMMAND} -DCLANG_FORMAT_EXECUTABLE=${CLANG_FORMAT_EXECUTABLE} -P ./cmake/Format.cmake
535535
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)

cmake/Format.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ endif()
1313
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} --version OUTPUT_VARIABLE CLANG_FORMAT_VERSION)
1414
string(REGEX MATCH "clang-format version ([0-9]+)" CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION})
1515
unset(CLANG_FORMAT_VERSION)
16-
if(NOT CMAKE_MATCH_1 EQUAL 14)
17-
message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 14")
16+
if(NOT CMAKE_MATCH_1 EQUAL 17)
17+
message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 17")
1818
endif()
1919

2020
# Run

examples/event_handling/EventHandling.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ class Application
316316
// Member data
317317
////////////////////////////////////////////////////////////
318318
sf::RenderWindow m_window{sf::VideoMode({800u, 600u}), "SFML Event Handling", sf::Style::Titlebar | sf::Style::Close};
319-
const sf::Font m_font{"resources/tuffy.ttf"};
320-
sf::Text m_logText{m_font, "", 20};
321-
sf::Text m_handlerText{m_font, "Current Handler: Classic", 24};
322-
sf::Text m_instructions{m_font, "Press Enter to change handler type", 24};
319+
const sf::Font m_font{"resources/tuffy.ttf"};
320+
sf::Text m_logText{m_font, "", 20};
321+
sf::Text m_handlerText{m_font, "Current Handler: Classic", 24};
322+
sf::Text m_instructions{m_font, "Press Enter to change handler type", 24};
323323
std::vector<std::string> m_log;
324324
HandlerType m_handlerType{HandlerType::Classic};
325325
};

include/SFML/Audio/InputSoundFile.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ class SFML_AUDIO_API InputSoundFile
285285
////////////////////////////////////////////////////////////
286286
// Member data
287287
////////////////////////////////////////////////////////////
288-
std::unique_ptr<SoundFileReader> m_reader; //!< Reader that handles I/O on the file's format
288+
std::unique_ptr<SoundFileReader> m_reader; //!< Reader that handles I/O on the file's format
289289
std::unique_ptr<InputStream, StreamDeleter> m_stream{nullptr, false}; //!< Input stream used to access the file's data
290-
std::uint64_t m_sampleOffset{}; //!< Sample Read Position
291-
std::uint64_t m_sampleCount{}; //!< Total number of samples in the file
292-
unsigned int m_sampleRate{}; //!< Number of samples per second
293-
std::vector<SoundChannel> m_channelMap; //!< The map of position in sample frame to sound channel
290+
std::uint64_t m_sampleOffset{}; //!< Sample Read Position
291+
std::uint64_t m_sampleCount{}; //!< Total number of samples in the file
292+
unsigned int m_sampleRate{}; //!< Number of samples per second
293+
std::vector<SoundChannel> m_channelMap; //!< The map of position in sample frame to sound channel
294294
};
295295

296296
} // namespace sf

include/SFML/Audio/SoundBuffer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ class SFML_AUDIO_API SoundBuffer
365365
std::vector<std::int16_t> m_samples; //!< Samples buffer
366366
unsigned int m_sampleRate{44100}; //!< Number of samples per second
367367
std::vector<SoundChannel> m_channelMap{SoundChannel::Mono}; //!< The map of position in sample frame to sound channel
368-
Time m_duration; //!< Sound duration
369-
mutable SoundList m_sounds; //!< List of sounds that are using this buffer
368+
Time m_duration; //!< Sound duration
369+
mutable SoundList m_sounds; //!< List of sounds that are using this buffer
370370
};
371371

372372
} // namespace sf

include/SFML/Graphics/StencilMode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct SFML_GRAPHICS_API StencilMode
110110
StencilUpdateOperation::Keep}; //!< The update operation to perform if the stencil test passes
111111
StencilValue stencilReference{0}; //!< The reference value we're performing the stencil test with
112112
StencilValue stencilMask{~0u}; //!< The mask to apply to both the reference value and the value in the stencil buffer
113-
bool stencilOnly{}; //!< Whether we should update the color buffer in addition to the stencil buffer
113+
bool stencilOnly{}; //!< Whether we should update the color buffer in addition to the stencil buffer
114114
};
115115

116116
////////////////////////////////////////////////////////////

include/SFML/Network/Http.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ class SFML_NETWORK_API Http
214214
NotModified = 304, //!< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
215215

216216
// 4xx: client error
217-
BadRequest = 400, //!< The server couldn't understand the request (syntax error)
218-
Unauthorized = 401, //!< The requested page needs an authentication to be accessed
219-
Forbidden = 403, //!< The requested page cannot be accessed at all, even with authentication
220-
NotFound = 404, //!< The requested page doesn't exist
217+
BadRequest = 400, //!< The server couldn't understand the request (syntax error)
218+
Unauthorized = 401, //!< The requested page needs an authentication to be accessed
219+
Forbidden = 403, //!< The requested page cannot be accessed at all, even with authentication
220+
NotFound = 404, //!< The requested page doesn't exist
221221
RangeNotSatisfiable = 407, //!< The server can't satisfy the partial GET request (with a "Range" header field)
222222

223223
// 5xx: server error

include/SFML/Window/Event.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ class Event
123123
struct MouseWheelScrolled
124124
{
125125
Mouse::Wheel wheel{}; //!< Which wheel (for mice with multiple ones)
126-
float delta{}; //!< Wheel offset (positive is up/left, negative is down/right). High-precision mice may use non-integral offsets.
127-
Vector2i position; //!< Position of the mouse pointer, relative to the top left of the owner window
126+
float delta{}; //!< Wheel offset (positive is up/left, negative is down/right). High-precision mice may use non-integral offsets.
127+
Vector2i position; //!< Position of the mouse pointer, relative to the top left of the owner window
128128
};
129129

130130
////////////////////////////////////////////////////////////

src/SFML/Audio/MiniaudioUtils.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ struct SoundBase
9292
};
9393

9494
ma_data_source_base dataSourceBase{}; //!< The struct that makes this object a miniaudio data source (must be first member)
95-
ma_node_vtable effectNodeVTable{}; //!< Vtable of the effect node
96-
EffectNode effectNode; //!< The engine node that performs effect processing
95+
ma_node_vtable effectNodeVTable{}; //!< Vtable of the effect node
96+
EffectNode effectNode; //!< The engine node that performs effect processing
9797
std::vector<ma_channel> soundChannelMap; //!< The map of position in sample frame to sound channel (miniaudio channels)
98-
ma_sound sound{}; //!< The sound
99-
SoundSource::Status status{SoundSource::Status::Stopped}; //!< The status
100-
SoundSource::EffectProcessor effectProcessor; //!< The effect processor
98+
ma_sound sound{}; //!< The sound
99+
SoundSource::Status status{SoundSource::Status::Stopped}; //!< The status
100+
SoundSource::EffectProcessor effectProcessor; //!< The effect processor
101101
AudioDevice::ResourceEntryIter resourceEntryIter; //!< Iterator to the resource entry registered with the AudioDevice
102102
MiniaudioUtils::SavedSettings savedSettings; //!< Saved settings used to restore ma_sound state in case we need to recreate it
103103
};

0 commit comments

Comments
 (0)