summaryrefslogtreecommitdiff
path: root/src/utils/cpp/hex_string.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-04-08 13:18:22 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-04-08 15:19:50 +0200
commit277be6dd08633dbebfda93afdfc6b5cb57e053e0 (patch)
tree6c86157c7f93636459361264054753a1dc9d33e9 /src/utils/cpp/hex_string.hpp
parent419a458ad9d4383eb47d51fe8e4408a0e240c2f1 (diff)
downloadjustbuild-277be6dd08633dbebfda93afdfc6b5cb57e053e0.tar.gz
Use properly included standard library types by default
Diffstat (limited to 'src/utils/cpp/hex_string.hpp')
-rw-r--r--src/utils/cpp/hex_string.hpp5
1 files changed, 3 insertions, 2 deletions
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 <cstddef>
#include <iomanip>
#include <iostream>
#include <optional>
@@ -35,9 +36,9 @@
[[nodiscard]] static inline auto FromHexString(std::string const& hexstring)
-> std::optional<std::string> {
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;