size_t -> usize

This commit is contained in:
apio 2023-01-13 18:55:05 +01:00
parent 16a62552db
commit 59db656f25
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ class Utf8StringDecoder
// The caller must ensure that 'buf' is at least code_points() + a NULL wide.
Result<void> decode(wchar_t* buf) const;
Result<void> decode(wchar_t* buf, size_t max) const;
Result<void> 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<void> encode(char* buf) const;
Result<void> encode(char* buf, size_t max) const;
Result<void> encode(char* buf, usize max) const;
private:
const wchar_t* m_str;

View File

@ -146,7 +146,7 @@ Result<usize> Utf8StringDecoder::code_points() const
return len;
}
Result<void> Utf8StringDecoder::decode(wchar_t* buf, size_t max) const
Result<void> Utf8StringDecoder::decode(wchar_t* buf, usize max) const
{
const char* it = m_str;
@ -165,7 +165,7 @@ Result<void> Utf8StringDecoder::decode(wchar_t* buf, size_t max) const
Result<void> 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<usize> Utf8StringEncoder::byte_length() const
return len;
}
Result<void> Utf8StringEncoder::encode(char* buf, size_t max) const
Result<void> Utf8StringEncoder::encode(char* buf, usize max) const
{
const wchar_t* it = m_str;
@ -206,7 +206,7 @@ Result<void> Utf8StringEncoder::encode(char* buf, size_t max) const
Result<void> 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)