From aa3b12c52b2f96a8c2b7873e9b4e061c9e534aa4 Mon Sep 17 00:00:00 2001 From: nemtrif Date: Mon, 17 Oct 2022 05:20:34 -0400 Subject: [PATCH] Added a couple of statis_casts to eliminate signed conversion warnings. --- source/utf8/checked.h | 2 +- source/utf8/cpp11.h | 2 +- source/utf8/cpp17.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/utf8/checked.h b/source/utf8/checked.h index 993b7f7..9b0a98d 100644 --- a/source/utf8/checked.h +++ b/source/utf8/checked.h @@ -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(*it)); case internal::INVALID_CODE_POINT : throw invalid_code_point(cp); } diff --git a/source/utf8/cpp11.h b/source/utf8/cpp11.h index d93961b..2366f12 100644 --- a/source/utf8/cpp11.h +++ b/source/utf8/cpp11.h @@ -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(invalid - s.begin()); } inline bool is_valid(const std::string& s) diff --git a/source/utf8/cpp17.h b/source/utf8/cpp17.h index 7bfa869..32a77ce 100644 --- a/source/utf8/cpp17.h +++ b/source/utf8/cpp17.h @@ -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(invalid - s.begin()); } inline bool is_valid(std::string_view s)