From 26d30bc6e730a3be9757b174da30ba756496521b Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 13 Jan 2015 09:44:35 +1100 Subject: Using size_t instead of unsigned int for conversions to UTF16 for 64-bit compatibility and to lessen the number of casts. --- src/UniConversion.cxx | 14 +++++++------- src/UniConversion.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx index d19828a52..dea069843 100644 --- a/src/UniConversion.cxx +++ b/src/UniConversion.cxx @@ -82,10 +82,10 @@ unsigned int UTF8CharLength(unsigned char ch) { } } -unsigned int UTF16Length(const char *s, unsigned int len) { - unsigned int ulen = 0; - unsigned int charLen; - for (unsigned int i=0; i(s[i]); if (ch < 0x80) { charLen = 1; @@ -103,10 +103,10 @@ unsigned int UTF16Length(const char *s, unsigned int len) { return ulen; } -unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen) { - unsigned int ui=0; +size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen) { + size_t ui = 0; const unsigned char *us = reinterpret_cast(s); - unsigned int i=0; + size_t i = 0; while ((i