diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-06 13:29:10 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:54 +0200 |
commit | 0854ebbc0720c1691f2de661c4ce3467b71746c6 (patch) | |
tree | 6bede8baea394711056db7109f395e71e880e03d /src/engine | |
parent | a285df324deb579d262ea7cf484de4d6b11b28e4 (diff) |
refactor: replace unsigned int with uint32_t
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/graphics/string_matrix.cpp | 8 | ||||
-rw-r--r-- | src/engine/graphics/string_matrix.hpp | 8 | ||||
-rw-r--r-- | src/engine/user/cursor.hpp | 2 | ||||
-rw-r--r-- | src/engine/user/cursor.tpp | 2 | ||||
-rw-r--r-- | src/engine/user/input.cpp | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/engine/graphics/string_matrix.cpp b/src/engine/graphics/string_matrix.cpp index 75d3700..b1db334 100644 --- a/src/engine/graphics/string_matrix.cpp +++ b/src/engine/graphics/string_matrix.cpp @@ -9,11 +9,11 @@ StringMatrix::StringMatrix(const Bounds &bounds) void StringMatrix::fill(std::string_view element) { - for (unsigned int row = 0U; row < _matrix.capacity(); row++) + for (uint32_t row = 0U; row < _matrix.capacity(); row++) { std::vector<std::string_view> row_vector = _matrix[row]; - for (unsigned int column = 0U; column < row_vector.capacity(); column++) + for (uint32_t column = 0U; column < row_vector.capacity(); column++) { _matrix[row][column] = element; } @@ -30,12 +30,12 @@ void StringMatrix::set(const Vector2 &pos, std::string_view element) _matrix[pos.get_y()][pos.get_x()] = element; } -unsigned int StringMatrix::rows() const +uint32_t StringMatrix::rows() const { return _rows; } -unsigned int StringMatrix::columns() const +uint32_t StringMatrix::columns() const { return _columns; } diff --git a/src/engine/graphics/string_matrix.hpp b/src/engine/graphics/string_matrix.hpp index 351053e..540d63b 100644 --- a/src/engine/graphics/string_matrix.hpp +++ b/src/engine/graphics/string_matrix.hpp @@ -46,16 +46,16 @@ public: /** * Returns the number of rows the matrix has. */ - [[nodiscard]] unsigned int rows() const override; + [[nodiscard]] uint32_t rows() const override; /** * Returns the number of columns the matrix has. */ - [[nodiscard]] unsigned int columns() const override; + [[nodiscard]] uint32_t columns() const override; private: std::vector<std::vector<std::string_view>> _matrix; - unsigned int _rows; - unsigned int _columns; + uint32_t _rows; + uint32_t _columns; }; diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp index 69d639a..70a2bf2 100644 --- a/src/engine/user/cursor.hpp +++ b/src/engine/user/cursor.hpp @@ -28,7 +28,7 @@ public: CursorController() = default; template <Direction::value_type direction> - constexpr void move(const unsigned int &amount) const; + constexpr void move(const uint32_t &amount) const; static void move_to(const Vector2 &pos); diff --git a/src/engine/user/cursor.tpp b/src/engine/user/cursor.tpp index 224418e..0743ae8 100644 --- a/src/engine/user/cursor.tpp +++ b/src/engine/user/cursor.tpp @@ -19,7 +19,7 @@ constexpr auto get_direction_format_map() } template <Direction::value_type direction> -constexpr void CursorController::move(const unsigned int &amount) const +constexpr void CursorController::move(const uint32_t &amount) const { constexpr auto direction_format_map = get_direction_format_map(); diff --git a/src/engine/user/input.cpp b/src/engine/user/input.cpp index e68f303..1dc7f63 100644 --- a/src/engine/user/input.cpp +++ b/src/engine/user/input.cpp @@ -46,7 +46,7 @@ void InputHandler::enter_raw_mode() auto raw_termios = termios(*_original_termios); - raw_termios.c_lflag &= static_cast<unsigned int>(~(ECHO | ICANON | ISIG)); + raw_termios.c_lflag &= static_cast<uint32_t>(~(ECHO | ICANON | ISIG)); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw_termios); } |