From 59db656f2569a75ac8c03c014e81a7b848409ccf Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 13 Jan 2023 18:55:05 +0100 Subject: [PATCH] size_t -> usize --- luna/include/luna/Utf8.h | 4 ++-- luna/src/Utf8.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/luna/include/luna/Utf8.h b/luna/include/luna/Utf8.h index 2f5b1b45..162ee2ea 100644 --- a/luna/include/luna/Utf8.h +++ b/luna/include/luna/Utf8.h @@ -18,7 +18,7 @@ class Utf8StringDecoder // The caller must ensure that 'buf' is at least code_points() + a NULL wide. Result decode(wchar_t* buf) const; - Result decode(wchar_t* buf, size_t max) const; + Result decode(wchar_t* buf, usize max) const; private: const char* m_str; @@ -40,7 +40,7 @@ class Utf8StringEncoder // The caller must ensure that 'buf' is at least byte_length() + a NULL wide. Result encode(char* buf) const; - Result encode(char* buf, size_t max) const; + Result encode(char* buf, usize max) const; private: const wchar_t* m_str; diff --git a/luna/src/Utf8.cpp b/luna/src/Utf8.cpp index f065184a..1311c68a 100644 --- a/luna/src/Utf8.cpp +++ b/luna/src/Utf8.cpp @@ -146,7 +146,7 @@ Result Utf8StringDecoder::code_points() const return len; } -Result Utf8StringDecoder::decode(wchar_t* buf, size_t max) const +Result Utf8StringDecoder::decode(wchar_t* buf, usize max) const { const char* it = m_str; @@ -165,7 +165,7 @@ Result Utf8StringDecoder::decode(wchar_t* buf, size_t max) const Result Utf8StringDecoder::decode(wchar_t* buf) const { - return decode(buf, (size_t)-1); + return decode(buf, (usize)-1); } Utf8StringEncoder::Utf8StringEncoder(const wchar_t* str) : m_str(str), m_code_points(wcslen(str)) @@ -186,7 +186,7 @@ Result Utf8StringEncoder::byte_length() const return len; } -Result Utf8StringEncoder::encode(char* buf, size_t max) const +Result Utf8StringEncoder::encode(char* buf, usize max) const { const wchar_t* it = m_str; @@ -206,7 +206,7 @@ Result Utf8StringEncoder::encode(char* buf, size_t max) const Result Utf8StringEncoder::encode(char* buf) const { - return encode(buf, (size_t)-1); + return encode(buf, (usize)-1); } Utf8StateDecoder::Utf8StateDecoder() : m_state_len(0), m_state_index(0)