From 277be6dd08633dbebfda93afdfc6b5cb57e053e0 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 8 Apr 2024 13:18:22 +0200 Subject: Use properly included standard library types by default --- src/utils/archive/archive_ops.cpp | 4 ++-- src/utils/archive/archive_ops.hpp | 3 ++- src/utils/cpp/hex_string.hpp | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/utils') diff --git a/src/utils/archive/archive_ops.cpp b/src/utils/archive/archive_ops.cpp index d8363b76..59b1d8a0 100644 --- a/src/utils/archive/archive_ops.cpp +++ b/src/utils/archive/archive_ops.cpp @@ -27,7 +27,7 @@ extern "C" { namespace { /// \brief Default block size for archive extraction. -constexpr size_t kArchiveBlockSize = 10240; +constexpr std::size_t kArchiveBlockSize = 10240; /// \brief Clean-up function for archive entry objects. void archive_entry_cleanup(archive_entry* entry) { @@ -120,7 +120,7 @@ auto ArchiveOps::CopyData(archive* ar, archive* aw) #ifndef BOOTSTRAP_BUILD_TOOL int r{}; const void* buff{nullptr}; - size_t size{}; + std::size_t size{}; la_int64_t offset{}; while (true) { diff --git a/src/utils/archive/archive_ops.hpp b/src/utils/archive/archive_ops.hpp index 933bb814..89151790 100644 --- a/src/utils/archive/archive_ops.hpp +++ b/src/utils/archive/archive_ops.hpp @@ -15,6 +15,7 @@ #ifndef INCLUDED_SRC_UTILS_ARCHIVE_ARCHIVE_OPS_HPP #define INCLUDED_SRC_UTILS_ARCHIVE_ARCHIVE_OPS_HPP +#include #include #include @@ -25,7 +26,7 @@ using archive = struct archive; using archive_entry = struct archive_entry; } -enum class ArchiveType : size_t { +enum class ArchiveType : std::size_t { Zip, _7Zip, ZipAuto, // autodetect zip-like archives diff --git a/src/utils/cpp/hex_string.hpp b/src/utils/cpp/hex_string.hpp index 44e0adf6..23544d49 100644 --- a/src/utils/cpp/hex_string.hpp +++ b/src/utils/cpp/hex_string.hpp @@ -15,6 +15,7 @@ #ifndef INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP #define INCLUDED_SRC_UTILS_CPP_HEX_STRING_HPP +#include #include #include #include @@ -35,9 +36,9 @@ [[nodiscard]] static inline auto FromHexString(std::string const& hexstring) -> std::optional { try { - const size_t kHexBase = 16; + const std::size_t kHexBase = 16; std::stringstream ss{}; - for (size_t i = 0; i < hexstring.length(); i += 2) { + for (std::size_t i = 0; i < hexstring.length(); i += 2) { unsigned char c = std::stoul(hexstring.substr(i, 2), nullptr, kHexBase); ss << c; -- cgit v1.2.3