diff options
author | Roland Reichwein <mail@reichwein.it> | 2022-01-02 18:18:15 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2022-01-02 18:18:15 +0100 |
commit | 58a7b18ba7d593b52521e4d70b4c1b546876c678 (patch) | |
tree | da13b110ad93d76a5b38ee673b05a94cb9287fd7 /include/unicode | |
parent | 7241d48ec4d0a0a59325d7a9208bdf5e076ba002 (diff) |
Bugfix for C++17, fix comments, fix GCC warnings
Diffstat (limited to 'include/unicode')
-rw-r--r-- | include/unicode/iso.h | 1 | ||||
-rw-r--r-- | include/unicode/utf.h | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/unicode/iso.h b/include/unicode/iso.h index 9b20afd..1f5f007 100644 --- a/include/unicode/iso.h +++ b/include/unicode/iso.h @@ -2,6 +2,7 @@ #include "types.h" +#include <algorithm> #include <stdexcept> #include <string> #include <unordered_map> diff --git a/include/unicode/utf.h b/include/unicode/utf.h index 6d7c2f7..1d2f28e 100644 --- a/include/unicode/utf.h +++ b/include/unicode/utf.h @@ -43,8 +43,8 @@ namespace unicode::detail { template<typename T, typename std::enable_if_t<is_utf_8_v<T>, bool> = true> inline bool validate_utf(const std::basic_string<T>& s) { - int i{}; - auto size{s.size()}; + size_t i{}; + size_t size{s.size()}; while (i < size) { if (is_utf8_sequence(s[i])) { i++; @@ -86,8 +86,8 @@ namespace unicode::detail { template<typename T, typename std::enable_if_t<is_utf_16_v<T>, bool> = true> inline bool validate_utf(const std::basic_string<T>& s) { - int i{}; - auto size{s.size()}; + size_t i{}; + size_t size{s.size()}; while (i < size) { if (is_utf16_sequence(s[i])) { i++; |