mirror of
https://github.com/nemtrif/utfcpp.git
synced 2025-04-04 13:05:06 +00:00
Added a couple of statis_casts to eliminate signed conversion warnings.
This commit is contained in:
parent
ee90a4a528
commit
aa3b12c52b
3 changed files with 3 additions and 3 deletions
|
@ -148,7 +148,7 @@ namespace utf8
|
|||
case internal::INVALID_LEAD :
|
||||
case internal::INCOMPLETE_SEQUENCE :
|
||||
case internal::OVERLONG_SEQUENCE :
|
||||
throw invalid_utf8(*it);
|
||||
throw invalid_utf8(static_cast<uint8_t>(*it));
|
||||
case internal::INVALID_CODE_POINT :
|
||||
throw invalid_code_point(cp);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace utf8
|
|||
inline std::size_t find_invalid(const std::string& s)
|
||||
{
|
||||
std::string::const_iterator invalid = find_invalid(s.begin(), s.end());
|
||||
return (invalid == s.end()) ? std::string::npos : (invalid - s.begin());
|
||||
return (invalid == s.end()) ? std::string::npos : static_cast<std::size_t>(invalid - s.begin());
|
||||
}
|
||||
|
||||
inline bool is_valid(const std::string& s)
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace utf8
|
|||
inline std::size_t find_invalid(std::string_view s)
|
||||
{
|
||||
std::string_view::const_iterator invalid = find_invalid(s.begin(), s.end());
|
||||
return (invalid == s.end()) ? std::string_view::npos : (invalid - s.begin());
|
||||
return (invalid == s.end()) ? std::string_view::npos : static_cast<std::size_t>(invalid - s.begin());
|
||||
}
|
||||
|
||||
inline bool is_valid(std::string_view s)
|
||||
|
|
Loading…
Add table
Reference in a new issue