diff options
| author | Neil <nyamatongwe@gmail.com> | 2017-04-06 21:04:37 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2017-04-06 21:04:37 +1000 | 
| commit | cda15af9657880e91ccf65603e109b202d9e78bf (patch) | |
| tree | eb730cdcc810842ce2255c3d2af9872041583a74 /src/UniConversion.cxx | |
| parent | dba2fe55b8a4ab4ac34795fe4a4b30a729c77016 (diff) | |
| download | scintilla-mirror-cda15af9657880e91ccf65603e109b202d9e78bf.tar.gz | |
Added const where possible.
Diffstat (limited to 'src/UniConversion.cxx')
| -rw-r--r-- | src/UniConversion.cxx | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx index 9c4acb422..9f0fa34e4 100644 --- a/src/UniConversion.cxx +++ b/src/UniConversion.cxx @@ -23,7 +23,7 @@ namespace Scintilla {  unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {  	unsigned int len = 0;  	for (unsigned int i = 0; i < tlen && uptr[i];) { -		unsigned int uch = uptr[i]; +		const unsigned int uch = uptr[i];  		if (uch < 0x80) {  			len++;  		} else if (uch < 0x800) { @@ -43,7 +43,7 @@ unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {  void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len) {  	unsigned int k = 0;  	for (unsigned int i = 0; i < tlen && uptr[i];) { -		unsigned int uch = uptr[i]; +		const unsigned int uch = uptr[i];  		if (uch < 0x80) {  			putf[k++] = static_cast<char>(uch);  		} else if (uch < 0x800) { @@ -53,7 +53,7 @@ void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned  			(uch <= SURROGATE_TRAIL_LAST)) {  			// Half a surrogate pair  			i++; -			unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff); +			const unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff);  			putf[k++] = static_cast<char>(0xF0 | (xch >> 18));  			putf[k++] = static_cast<char>(0x80 | ((xch >> 12) & 0x3f));  			putf[k++] = static_cast<char>(0x80 | ((xch >> 6) & 0x3f)); @@ -85,7 +85,7 @@ size_t UTF16Length(const char *s, size_t len) {  	size_t ulen = 0;  	size_t charLen;  	for (size_t i = 0; i<len;) { -		unsigned char ch = static_cast<unsigned char>(s[i]); +		const unsigned char ch = static_cast<unsigned char>(s[i]);  		if (ch < 0x80) {  			charLen = 1;  		} else if (ch < 0x80 + 0x40 + 0x20) { @@ -301,7 +301,7 @@ int UTF8Classify(const unsigned char *us, int len) {  }  int UTF8DrawBytes(const unsigned char *us, int len) { -	int utf8StatusNext = UTF8Classify(us, len); +	const int utf8StatusNext = UTF8Classify(us, len);  	return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth);  }  | 
