diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-27 22:08:43 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-27 22:08:43 +0200 |
commit | 6b0e2a25cf1e98d3f11d4e6c0305dd327048bbb8 (patch) | |
tree | a62c23f4e66949fe109e07dec95ad3a3e5229a7c /src/engine | |
parent | 9d0fe1b42c9f6a5c09bab444966d347a71a4b905 (diff) |
refactor: use int types from std namespace
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/data/bounds.hpp | 6 | ||||
-rw-r--r-- | src/engine/data/style.hpp | 8 | ||||
-rw-r--r-- | src/engine/data/vector2.hpp | 6 | ||||
-rw-r--r-- | src/engine/graphics/matrix.hpp | 8 | ||||
-rw-r--r-- | src/engine/graphics/matrix_impl.hpp | 4 | ||||
-rw-r--r-- | src/engine/graphics/matrix_iterator.hpp | 8 | ||||
-rw-r--r-- | src/engine/graphics/matrix_iterator_impl.hpp | 4 | ||||
-rw-r--r-- | src/engine/graphics/scene.cpp | 2 | ||||
-rw-r--r-- | src/engine/user/cursor.cpp | 2 | ||||
-rw-r--r-- | src/engine/user/cursor.hpp | 2 |
10 files changed, 25 insertions, 25 deletions
diff --git a/src/engine/data/bounds.hpp b/src/engine/data/bounds.hpp index 731db5c..b122489 100644 --- a/src/engine/data/bounds.hpp +++ b/src/engine/data/bounds.hpp @@ -15,14 +15,14 @@ enum CoordsValidation struct BoundsOptions { - uint32_t width; - uint32_t height; + std::uint32_t width; + std::uint32_t height; }; class Bounds { public: - using Value = uint32_t; + using Value = std::uint32_t; explicit Bounds(const BoundsOptions &options) noexcept; diff --git a/src/engine/data/style.hpp b/src/engine/data/style.hpp index 50c1faa..6cb3fbd 100644 --- a/src/engine/data/style.hpp +++ b/src/engine/data/style.hpp @@ -7,14 +7,14 @@ class Style { public: // Colors - std::optional<uint32_t> fg_color{}; - std::optional<uint32_t> bg_color{}; + std::optional<std::uint32_t> fg_color{}; + std::optional<std::uint32_t> bg_color{}; // Toggles bool bold = false; bool reset_before = false; // Spacing - uint32_t padding_left = 0U; - uint32_t padding_right = 0U; + std::uint32_t padding_left = 0U; + std::uint32_t padding_right = 0U; }; diff --git a/src/engine/data/vector2.hpp b/src/engine/data/vector2.hpp index 96ebf87..b83e924 100644 --- a/src/engine/data/vector2.hpp +++ b/src/engine/data/vector2.hpp @@ -5,8 +5,8 @@ struct Vector2Options { - int32_t x; - int32_t y; + std::int32_t x; + std::int32_t y; }; /** @@ -15,7 +15,7 @@ struct Vector2Options class Vector2 { public: - using Value = int32_t; + using Value = std::int32_t; constexpr explicit Vector2(const Vector2Options &options) noexcept : _x(options.x), _y(options.y) diff --git a/src/engine/graphics/matrix.hpp b/src/engine/graphics/matrix.hpp index 7b4d037..58905ee 100644 --- a/src/engine/graphics/matrix.hpp +++ b/src/engine/graphics/matrix.hpp @@ -28,9 +28,9 @@ public: void set(const Vector2 &pos, Element element) noexcept override; - [[nodiscard]] auto get_row_cnt() const noexcept -> uint32_t override; + [[nodiscard]] auto get_row_cnt() const noexcept -> std::uint32_t override; - [[nodiscard]] auto get_column_cnt() const noexcept -> uint32_t override; + [[nodiscard]] auto get_column_cnt() const noexcept -> std::uint32_t override; [[nodiscard]] auto begin() const noexcept -> MatrixIterator<Element> override; @@ -43,8 +43,8 @@ public: private: gsl::owner<Element **> _matrix; - uint32_t _row_cnt; - uint32_t _column_cnt; + std::uint32_t _row_cnt; + std::uint32_t _column_cnt; void _delete_matrix() noexcept; diff --git a/src/engine/graphics/matrix_impl.hpp b/src/engine/graphics/matrix_impl.hpp index 527c61f..9105149 100644 --- a/src/engine/graphics/matrix_impl.hpp +++ b/src/engine/graphics/matrix_impl.hpp @@ -70,13 +70,13 @@ void Matrix<Element>::set(const Vector2 &pos, Element element) noexcept } template <typename Element> -auto Matrix<Element>::get_row_cnt() const noexcept -> uint32_t +auto Matrix<Element>::get_row_cnt() const noexcept -> std::uint32_t { return _row_cnt; } template <typename Element> -auto Matrix<Element>::get_column_cnt() const noexcept -> uint32_t +auto Matrix<Element>::get_column_cnt() const noexcept -> std::uint32_t { return _column_cnt; } diff --git a/src/engine/graphics/matrix_iterator.hpp b/src/engine/graphics/matrix_iterator.hpp index 70a59bf..2d91ff1 100644 --- a/src/engine/graphics/matrix_iterator.hpp +++ b/src/engine/graphics/matrix_iterator.hpp @@ -28,7 +28,7 @@ class MatrixRow public: using RowPtr = gsl::owner<Element *>; - explicit MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexcept; + explicit MatrixRow(RowPtr row_ptr, const std::uint32_t &column_cnt) noexcept; [[nodiscard]] auto begin() const noexcept -> MatrixRowIterator<Element>; @@ -37,7 +37,7 @@ public: private: RowPtr _row_ptr; - const uint32_t &_column_cnt; + const std::uint32_t &_column_cnt; }; template <typename Element> @@ -46,7 +46,7 @@ class MatrixIterator public: using RowPtr = gsl::owner<Element **>; - explicit MatrixIterator(RowPtr row_ptr, const uint32_t &column_cnt) noexcept; + explicit MatrixIterator(RowPtr row_ptr, const std::uint32_t &column_cnt) noexcept; auto operator++() noexcept -> MatrixIterator &; auto operator++(int) noexcept -> MatrixIterator; @@ -59,7 +59,7 @@ public: private: RowPtr _row_ptr; - const uint32_t &_column_cnt; + const std::uint32_t &_column_cnt; }; #include "matrix_iterator_impl.hpp" diff --git a/src/engine/graphics/matrix_iterator_impl.hpp b/src/engine/graphics/matrix_iterator_impl.hpp index 4b2c785..95846fe 100644 --- a/src/engine/graphics/matrix_iterator_impl.hpp +++ b/src/engine/graphics/matrix_iterator_impl.hpp @@ -51,7 +51,7 @@ auto MatrixRowIterator<Element>::operator!=(const MatrixRowIterator &rhs) const // Matrix row template <typename Element> -MatrixRow<Element>::MatrixRow(RowPtr row_ptr, const uint32_t &column_cnt) noexcept +MatrixRow<Element>::MatrixRow(RowPtr row_ptr, const std::uint32_t &column_cnt) noexcept : _row_ptr(row_ptr), _column_cnt(column_cnt) { } @@ -73,7 +73,7 @@ auto MatrixRow<Element>::end() const noexcept -> MatrixRowIterator<Element> template <typename Element> MatrixIterator<Element>::MatrixIterator( RowPtr row_ptr, - const uint32_t &column_cnt) noexcept + const std::uint32_t &column_cnt) noexcept : _row_ptr(row_ptr), _column_cnt(column_cnt) { } diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index e4bdb6e..ff64edd 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -39,7 +39,7 @@ void Scene::enter() noexcept // ICANON - Canonical mode (line by line input) // ISIG - Generate the corresponding signals for the characters // INTR, QUIT, SUSP and DSUSP - new_termios.c_lflag &= static_cast<uint32_t>(~(ECHO | ICANON | ISIG)); + new_termios.c_lflag &= static_cast<std::uint32_t>(~(ECHO | ICANON | ISIG)); // Set a new terminal state tcsetattr(STDIN_FILENO, TCSAFLUSH, &new_termios); diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp index e3ad56c..a372ca7 100644 --- a/src/engine/user/cursor.cpp +++ b/src/engine/user/cursor.cpp @@ -12,7 +12,7 @@ CursorController::CursorController() noexcept void CursorController::move( const Vector2 &direction, - const uint32_t &amount, + const std::uint32_t &amount, bool flush_cout) noexcept { auto direction_format = direction_format_map.at(direction); diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp index 8f352ef..06c6b88 100644 --- a/src/engine/user/cursor.hpp +++ b/src/engine/user/cursor.hpp @@ -39,7 +39,7 @@ class CursorController : public ICursorController, public: CursorController() noexcept; - void move(const Vector2 &direction, const uint32_t &amount, bool flush_cout) noexcept + void move(const Vector2 &direction, const std::uint32_t &amount, bool flush_cout) noexcept override; void move_to(const Vector2 &position, bool flush_cout) noexcept override; |