From 3b1577ab7eb2000a3477a0aa489b888fb1256434 Mon Sep 17 00:00:00 2001 From: lurumdare <8020186+lurumdare@users.noreply.github.com> Date: 周六, 07 9月 2019 20:40:25 +0800 Subject: [PATCH] const everywhere (#30) --- src/library/ini/ConvertUTF.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/library/ini/ConvertUTF.c b/src/library/ini/ConvertUTF.c index 20b7edc..fbc1911 100644 --- a/src/library/ini/ConvertUTF.c +++ b/src/library/ini/ConvertUTF.c @@ -228,7 +228,7 @@ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { /* If the 16 bits following the high surrogate are in the source buffer... */ if (source < sourceEnd) { - UTF32 ch2 = *source; + const UTF32 ch2 = *source; /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { ch = ((ch - UNI_SUR_HIGH_START) << halfShift) @@ -324,7 +324,7 @@ * This is not used here; it's just exported. */ Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { - int length = trailingBytesForUTF8[*source]+1; + const int length = trailingBytesForUTF8[*source]+1; if (source+length > sourceEnd) { return false; } @@ -341,7 +341,7 @@ UTF16* target = *targetStart; while (source < sourceEnd) { UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + const unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; if (source + extraBytesToRead >= sourceEnd) { result = sourceExhausted; break; } @@ -467,7 +467,7 @@ UTF32* target = *targetStart; while (source < sourceEnd) { UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + const unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; if (source + extraBytesToRead >= sourceEnd) { result = sourceExhausted; break; } -- Gitblit v1.9.1