Use size_t instead of int for certain parts

This commit is contained in:
Amber Brault 2024-12-07 22:47:10 -05:00
parent 6983e9233d
commit 6efd2ae472
2 changed files with 5 additions and 5 deletions

View File

@ -92,10 +92,10 @@ std::tuple<std::string, std::string, std::string> CWDemangler::parse_qualifiers(
return {pre, post, str};
}
std::optional<std::tuple<int, std::string>> CWDemangler::parse_digits(std::string str)
std::optional<std::tuple<size_t, std::string>> CWDemangler::parse_digits(std::string str)
{
bool containsNonDigit = false;
int idx = 0;
size_t idx = 0;
while (idx < str.length())
{
if (!std::isdigit(str[idx]))
@ -106,7 +106,7 @@ std::optional<std::tuple<int, std::string>> CWDemangler::parse_digits(std::strin
idx++;
}
int val = 0;
size_t val = 0;
if (containsNonDigit)
{
@ -189,7 +189,7 @@ CWDemangler::demangle_name(std::string str, DemangleOptions options)
if (!result)
return {};
int size;
size_t size;
std::string rest;
std::tie(size, rest) = result.value();

View File

@ -60,6 +60,6 @@ private:
}
static std::tuple<std::string, std::string, std::string> parse_qualifiers(std::string str);
static std::optional<std::tuple<int, std::string>> parse_digits(std::string str);
static std::optional<std::tuple<size_t, std::string>> parse_digits(std::string str);
static std::optional<size_t> find_split(std::string s, bool special, DemangleOptions options);
};