From 019337908e37ffee9b624b313e9d7f885bff9781 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 15 May 2022 19:57:02 +0200 Subject: style: change braced list & bracket style --- src/engine/graphics/scene.cpp | 5 ++--- src/engine/graphics/scene.hpp | 3 +-- src/engine/graphics/statusline.cpp | 19 +++++++------------ src/engine/graphics/statusline.hpp | 10 ++++------ src/engine/graphics/window.cpp | 2 +- 5 files changed, 15 insertions(+), 24 deletions(-) (limited to 'src/engine/graphics') diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index d5cf89b..73c1292 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -11,10 +11,9 @@ Scene::Scene( IMatrixFactory matrix_factory, std::shared_ptr cursor_controller, - std::shared_ptr window -) noexcept + std::shared_ptr window) noexcept : _is_shown(false), - _matrix(matrix_factory(window->size() - Bounds({ .width = 0U, .height = 1U }))), + _matrix(matrix_factory(window->size() - Bounds({.width = 0U, .height = 1U}))), _cursor_controller(std::move(cursor_controller)), _window(std::move(window)) { diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index aaf0095..5e74725 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -18,8 +18,7 @@ public: explicit Scene( IMatrixFactory matrix_factory, std::shared_ptr cursor_controller, - std::shared_ptr window - ) noexcept; + std::shared_ptr window) noexcept; void enter() noexcept override; diff --git a/src/engine/graphics/statusline.cpp b/src/engine/graphics/statusline.cpp index 1abb87b..3968fae 100644 --- a/src/engine/graphics/statusline.cpp +++ b/src/engine/graphics/statusline.cpp @@ -8,8 +8,7 @@ StatusLine::StatusLine( std::shared_ptr cursor_controller, - std::shared_ptr window -) noexcept + std::shared_ptr window) noexcept : _cursor_controller(std::move(cursor_controller)), _window(std::move(window)) { } @@ -29,8 +28,7 @@ void StatusLine::initialize_background() noexcept void StatusLine::set_status( const StatusLineSection §ion, const std::string_view &status, - std::size_t start -) noexcept + std::size_t start) noexcept { _clear_section(section, start); @@ -51,8 +49,7 @@ void StatusLine::set_status( void StatusLine::set_section_length( const StatusLineSection §ion, - uint32_t length -) noexcept + uint32_t length) noexcept { _sections_lengths[section] = length; } @@ -67,7 +64,7 @@ auto StatusLine::_move_to_statusline(int32_t x) noexcept -> Vector2 auto window_height = static_cast(window_size.get_height()); - _cursor_controller->move_to(Vector2({ .x = x, .y = window_height }), true); + _cursor_controller->move_to(Vector2({.x = x, .y = window_height}), true); return previous_position; } @@ -87,9 +84,8 @@ auto StatusLine::_get_section_start_x(const StatusLineSection §ion) const no while (section_index > 0) { - section_start += - static_cast(_sections_lengths.at(StatusLineSection(section_index - 1) - )); + section_start += static_cast( + _sections_lengths.at(StatusLineSection(section_index - 1))); section_index--; } @@ -99,8 +95,7 @@ auto StatusLine::_get_section_start_x(const StatusLineSection §ion) const no void StatusLine::_clear_section( const StatusLineSection §ion, - std::size_t start -) noexcept + std::size_t start) noexcept { auto section_start = _get_section_start_x(section); diff --git a/src/engine/graphics/statusline.hpp b/src/engine/graphics/statusline.hpp index 181090d..add8e02 100644 --- a/src/engine/graphics/statusline.hpp +++ b/src/engine/graphics/statusline.hpp @@ -19,16 +19,14 @@ class StatusLine : public IStatusLine public: StatusLine( std::shared_ptr cursor_controller, - std::shared_ptr window - ) noexcept; + std::shared_ptr window) noexcept; void initialize_background() noexcept override; void set_status( const StatusLineSection §ion, const std::string_view &status, - std::size_t start - ) noexcept override; + std::size_t start) noexcept override; void set_section_length(const StatusLineSection §ion, uint32_t length) noexcept override; @@ -43,8 +41,8 @@ private: void _move_back(Vector2 previous_position) noexcept; - [[nodiscard]] auto _get_section_start_x(const StatusLineSection §ion - ) const noexcept -> int32_t; + [[nodiscard]] auto + _get_section_start_x(const StatusLineSection §ion) const noexcept -> int32_t; void _clear_section(const StatusLineSection §ion, std::size_t start) noexcept; }; diff --git a/src/engine/graphics/window.cpp b/src/engine/graphics/window.cpp index 2d880fc..bb33402 100644 --- a/src/engine/graphics/window.cpp +++ b/src/engine/graphics/window.cpp @@ -9,5 +9,5 @@ auto Window::size() const noexcept -> Bounds // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) ioctl(0, TIOCGWINSZ, &window_size); - return Bounds({ window_size.ws_col, window_size.ws_row }); + return Bounds({window_size.ws_col, window_size.ws_row}); } -- cgit v1.2.3-18-g5258