diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-18 14:06:17 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-18 14:06:17 (GMT) |
commit | d7364d1f4bcb025930cf6d91cb2fe5787918bc41 (patch) | |
tree | 2d6a5d0e295ff78acb9fc9b3d15b6d340b6a8b21 /generic/tclEncoding.c | |
parent | 303fbfc4be38a234f52db032c7cb87d0482e9cdc (diff) | |
parent | 176431f58481aeaba56e3463648fd85990236de4 (diff) | |
download | tcl-d7364d1f4bcb025930cf6d91cb2fe5787918bc41.zip tcl-d7364d1f4bcb025930cf6d91cb2fe5787918bc41.tar.gz tcl-d7364d1f4bcb025930cf6d91cb2fe5787918bc41.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r-- | generic/tclEncoding.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 71a4cc4..2753785 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1713,7 +1713,7 @@ LoadTableEncoding( dataPtr->toUnicode[hi] = pageMemPtr; p += 2; for (lo = 0; lo < 256; lo++) { - if ((lo & 0x0f) == 0) { + if ((lo & 0x0F) == 0) { p++; } ch = (staticHex[UCHAR(p[0])] << 12) + (staticHex[UCHAR(p[1])] << 8) @@ -1774,7 +1774,7 @@ LoadTableEncoding( pageMemPtr += 256; dataPtr->fromUnicode[ch >> 8] = page; } - page[ch & 0xff] = (unsigned short) ((hi << 8) + lo); + page[ch & 0xFF] = (unsigned short) ((hi << 8) + lo); } } } @@ -1880,7 +1880,7 @@ LoadTableEncoding( if (from == 0) { continue; } - dataPtr->fromUnicode[from >> 8][from & 0xff] = to; + dataPtr->fromUnicode[from >> 8][from & 0xFF] = to; } } doneParse: @@ -2095,7 +2095,7 @@ BinaryProc( * UtfIntToUtfExtProc -- * * Convert from UTF-8 to UTF-8. While converting null-bytes from the - * Tcl's internal representation (0xc0, 0x80) to the official + * Tcl's internal representation (0xC0, 0x80) to the official * representation (0x00). See UtfToUtfProc for details. * * Results: @@ -2144,7 +2144,7 @@ UtfIntToUtfExtProc( * UtfExtToUtfIntProc -- * * Convert from UTF-8 to UTF-8 while converting null-bytes from the - * official representation (0x00) to Tcl's internal representation (0xc0, + * official representation (0x00) to Tcl's internal representation (0xC0, * 0x80). See UtfToUtfProc for details. * * Results: @@ -2275,14 +2275,14 @@ UtfToUtfProc( if (UCHAR(*src) < 0x80 && !(UCHAR(*src) == 0 && pureNullMode == 0)) { /* * Copy 7bit characters, but skip null-bytes when we are in input - * mode, so that they get converted to 0xc080. + * mode, so that they get converted to 0xC080. */ *dst++ = *src++; - } else if (pureNullMode == 1 && UCHAR(*src) == 0xc0 && + } else if (pureNullMode == 1 && UCHAR(*src) == 0xC0 && (src + 1 < srcEnd) && UCHAR(*(src+1)) == 0x80) { /* - * Convert 0xc080 to real nulls when we are in output mode. + * Convert 0xC080 to real nulls when we are in output mode. */ *dst++ = 0; @@ -2831,7 +2831,7 @@ TableFromUtfProc( * full support of int Tcl_UniChar. [Bug 1004065] */ - if (ch & 0xffff0000) { + if (ch & 0xFFFF0000) { word = 0; } else #else @@ -2839,7 +2839,7 @@ TableFromUtfProc( word = 0; } else #endif - word = fromUnicode[(ch >> 8)][ch & 0xff]; + word = fromUnicode[(ch >> 8)][ch & 0xFF]; if ((word == 0) && (ch != 0)) { if (flags & TCL_ENCODING_STOPONERROR) { @@ -3025,7 +3025,7 @@ Iso88591FromUtfProc( * Check for illegal characters. */ - if (ch > 0xff + if (ch > 0xFF #if TCL_UTF_MAX <= 3 || ((ch >= 0xD800) && (len < 3)) #endif @@ -3412,7 +3412,7 @@ EscapeFromUtfProc( break; } len = TclUtfToUniChar(src, &ch); - word = tableFromUnicode[(ch >> 8)][ch & 0xff]; + word = tableFromUnicode[(ch >> 8)][ch & 0xFF]; if ((word == 0) && (ch != 0)) { int oldState; @@ -3422,7 +3422,7 @@ EscapeFromUtfProc( for (state = 0; state < dataPtr->numSubTables; state++) { encodingPtr = GetTableEncoding(dataPtr, state); tableDataPtr = (const TableEncodingData *)encodingPtr->clientData; - word = tableDataPtr->fromUnicode[(ch >> 8)][ch & 0xff]; + word = tableDataPtr->fromUnicode[(ch >> 8)][ch & 0xFF]; if (word != 0) { break; } |