diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-20 20:29:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-20 20:29:25 (GMT) |
commit | 8af92a8a6b470126d931eff19d97f7630f618006 (patch) | |
tree | ba0c6e7a1024d982938235931b0d1067bd1d9197 | |
parent | c820318356373338e81456fc7f995e2e19c0218c (diff) | |
parent | ab2ee17c917d4c1ac391bc15fe68a87e672f2f73 (diff) | |
download | tcl-8af92a8a6b470126d931eff19d97f7630f618006.zip tcl-8af92a8a6b470126d931eff19d97f7630f618006.tar.gz tcl-8af92a8a6b470126d931eff19d97f7630f618006.tar.bz2 |
Fix [6811a00819]: lsearch performance degradation on Tcl 8.6.11 release (thanks, Sergey!)
-rw-r--r-- | generic/tclBinary.c | 8 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 4 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 8 | ||||
-rw-r--r-- | generic/tclCompExpr.c | 4 | ||||
-rw-r--r-- | generic/tclDisassemble.c | 2 | ||||
-rw-r--r-- | generic/tclEncoding.c | 12 | ||||
-rw-r--r-- | generic/tclInt.h | 7 | ||||
-rw-r--r-- | generic/tclParse.c | 4 | ||||
-rw-r--r-- | generic/tclScan.c | 2 | ||||
-rw-r--r-- | generic/tclStringObj.c | 4 | ||||
-rw-r--r-- | generic/tclStubInit.c | 4 | ||||
-rw-r--r-- | generic/tclUtf.c | 20 | ||||
-rw-r--r-- | generic/tclUtil.c | 30 | ||||
-rw-r--r-- | tests-perf/list.perf.tcl | 99 | ||||
-rw-r--r-- | unix/tclUnixChan.c | 4 | ||||
-rw-r--r-- | win/tclWinSerial.c | 4 |
16 files changed, 151 insertions, 65 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 916ba4c..9dd9edf 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -512,7 +512,7 @@ MakeByteArray( for (; src < srcEnd && dst < dstEnd; ) { int ch; - int count = Tcl_UtfToUniChar(src, &ch); + int count = TclUtfToUniChar(src, &ch); if (ch > 255) { proper = 0; @@ -2563,7 +2563,7 @@ BinaryDecodeHex( if (pure) { ucs4 = c; } else { - Tcl_UtfToUniChar((const char *)(data - 1), &ucs4); + TclUtfToUniChar((const char *)(data - 1), &ucs4); } TclDecrRefCount(resultObj); Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -3028,7 +3028,7 @@ BinaryDecodeUu( if (pure) { ucs4 = c; } else { - Tcl_UtfToUniChar((const char *)(data - 1), &ucs4); + TclUtfToUniChar((const char *)(data - 1), &ucs4); } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid uuencode character \"%c\" (U+%06X) at position %" @@ -3203,7 +3203,7 @@ BinaryDecode64( * of a multi-byte character. */ /* Safe because we know data is NUL-terminated */ - Tcl_UtfToUniChar((const char *)(data - 1), &ucs4); + TclUtfToUniChar((const char *)(data - 1), &ucs4); } Tcl_SetObjResult(interp, Tcl_ObjPrintf( diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 4474513..c79fd86 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -5432,8 +5432,8 @@ DictionaryCompare( */ if ((*left != '\0') && (*right != '\0')) { - left += Tcl_UtfToUniChar(left, &uniLeft); - right += Tcl_UtfToUniChar(right, &uniRight); + left += TclUtfToUniChar(left, &uniLeft); + right += TclUtfToUniChar(right, &uniRight); /* * Convert both chars to lower for the comparison, because diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 56d4cca..a00762e 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1220,7 +1220,7 @@ Tcl_SplitObjCmd( Tcl_InitHashTable(&charReuseTable, TCL_ONE_WORD_KEYS); for ( ; stringPtr < end; stringPtr += len) { - len = Tcl_UtfToUniChar(stringPtr, &ch); + len = TclUtfToUniChar(stringPtr, &ch); hPtr = Tcl_CreateHashEntry(&charReuseTable, INT2PTR(ch), &isNew); if (isNew) { TclNewStringObj(objPtr, stringPtr, len); @@ -1266,9 +1266,9 @@ Tcl_SplitObjCmd( splitEnd = splitChars + splitCharLen; for (element = stringPtr; stringPtr < end; stringPtr += len) { - len = Tcl_UtfToUniChar(stringPtr, &ch); + len = TclUtfToUniChar(stringPtr, &ch); for (p = splitChars; p < splitEnd; p += splitLen) { - splitLen = Tcl_UtfToUniChar(p, &splitChar); + splitLen = TclUtfToUniChar(p, &splitChar); if (ch == splitChar) { TclNewStringObj(objPtr, element, stringPtr - element); Tcl_ListObjAppendElement(NULL, listPtr, objPtr); @@ -1891,7 +1891,7 @@ StringIsCmd( for (; string1 < end; string1 += length2, failat++) { int ucs4; - length2 = Tcl_UtfToUniChar(string1, &ucs4); + length2 = TclUtfToUniChar(string1, &ucs4); if (!chcomp(ucs4)) { result = 0; break; diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 85f475e..e7ea456 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2149,13 +2149,13 @@ ParseLexeme( if (!TclIsBareword(*start) || *start == '_') { Tcl_Size scanned; if (Tcl_UtfCharComplete(start, numBytes)) { - scanned = Tcl_UtfToUniChar(start, &ch); + scanned = TclUtfToUniChar(start, &ch); } else { char utfBytes[8]; memcpy(utfBytes, start, numBytes); utfBytes[numBytes] = '\0'; - scanned = Tcl_UtfToUniChar(utfBytes, &ch); + scanned = TclUtfToUniChar(utfBytes, &ch); } *lexemePtr = INVALID; Tcl_DecrRefCount(literal); diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 1a41562..68b3b6c 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -876,7 +876,7 @@ PrintSourceToObj( for (; (*p != '\0') && (i < maxChars); p+=len) { int ucs4; - len = Tcl_UtfToUniChar(p, &ucs4); + len = TclUtfToUniChar(p, &ucs4); switch (ucs4) { case '"': Tcl_AppendToObj(appendObj, "\\\"", -1); diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 074c58e..312ce85 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1581,7 +1581,7 @@ Tcl_UtfToExternalDStringEx( int ucs4; char buf[TCL_INTEGER_SPACE]; - Tcl_UtfToUniChar(&srcStart[nBytesProcessed], &ucs4); + TclUtfToUniChar(&srcStart[nBytesProcessed], &ucs4); snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "d", nBytesProcessed); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unexpected character at index %" TCL_SIZE_MODIFIER @@ -2551,11 +2551,11 @@ UtfToUtfProc( /* TCL_ENCODING_PROFILE_TCL8 */ char chbuf[2]; chbuf[0] = UCHAR(*src++); chbuf[1] = 0; - Tcl_UtfToUniChar(chbuf, &ch); + TclUtfToUniChar(chbuf, &ch); } dst += Tcl_UniCharToUtf(ch, dst); } else { - size_t len = Tcl_UtfToUniChar(src, &ch); + size_t len = TclUtfToUniChar(src, &ch); if (flags & ENCODING_INPUT) { if (((len < 2) && (ch != 0)) || ((ch > 0xFFFF) && !(flags & ENCODING_UTF))) { if (PROFILE_STRICT(profile)) { @@ -2799,7 +2799,7 @@ UtfToUtf32Proc( result = TCL_CONVERT_NOSPACE; break; } - len = Tcl_UtfToUniChar(src, &ch); + len = TclUtfToUniChar(src, &ch); if (SURROGATE(ch)) { if (PROFILE_STRICT(flags)) { result = TCL_CONVERT_UNKNOWN; @@ -3076,7 +3076,7 @@ UtfToUtf16Proc( result = TCL_CONVERT_NOSPACE; break; } - len = Tcl_UtfToUniChar(src, &ch); + len = TclUtfToUniChar(src, &ch); if (SURROGATE(ch)) { if (PROFILE_STRICT(flags)) { result = TCL_CONVERT_UNKNOWN; @@ -3323,7 +3323,7 @@ TableToUtfProc( } else { char chbuf[2]; chbuf[0] = byte; chbuf[1] = 0; - Tcl_UtfToUniChar(chbuf, &ch); + TclUtfToUniChar(chbuf, &ch); } } diff --git a/generic/tclInt.h b/generic/tclInt.h index ada17b3..50c7add 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4565,17 +4565,10 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[]; *---------------------------------------------------------------- */ -#if TCL_UTF_MAX > 3 #define TclUtfToUniChar(str, chPtr) \ (((UCHAR(*(str))) < 0x80) ? \ ((*(chPtr) = UCHAR(*(str))), 1) \ : Tcl_UtfToUniChar(str, chPtr)) -#else -#define TclUtfToUniChar(str, chPtr) \ - (((UCHAR(*(str))) < 0x80) ? \ - ((*(chPtr) = UCHAR(*(str))), 1) \ - : Tcl_UtfToChar16(str, chPtr)) -#endif /* *---------------------------------------------------------------- diff --git a/generic/tclParse.c b/generic/tclParse.c index 84200ac..92ec1c2 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -926,13 +926,13 @@ TclParseBackslash( */ if (Tcl_UtfCharComplete(p, numBytes - 1)) { - count = Tcl_UtfToUniChar(p, &unichar) + 1; /* +1 for '\' */ + count = TclUtfToUniChar(p, &unichar) + 1; /* +1 for '\' */ } else { char utfBytes[8]; memcpy(utfBytes, p, numBytes - 1); utfBytes[numBytes - 1] = '\0'; - count = Tcl_UtfToUniChar(utfBytes, &unichar) + 1; + count = TclUtfToUniChar(utfBytes, &unichar) + 1; } result = unichar; break; diff --git a/generic/tclScan.c b/generic/tclScan.c index 195153b..71af1f2 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -902,7 +902,7 @@ Tcl_ScanObjCmd( * Scan a single Unicode character. */ - offset = Tcl_UtfToUniChar(string, &i); + offset = TclUtfToUniChar(string, &i); string += offset; if (!(flags & SCAN_SUPPRESS)) { TclNewIntObj(objPtr, i); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index d8b96f7..dba36a6 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -618,8 +618,6 @@ TclGetUniChar( return -1; } const char *begin = TclUtfAtIndex(objPtr->bytes, index); -#undef Tcl_UtfToUniChar - Tcl_UtfToUniChar(begin, &ch); return ch; } @@ -4133,7 +4131,7 @@ TclStringReverse( * skip calling Tcl_UtfCharComplete() here. */ - int bytesInChar = Tcl_UtfToUniChar(from, &chw); + int bytesInChar = TclUtfToUniChar(from, &chw); ReverseBytes((unsigned char *)to, (unsigned char *)from, bytesInChar); diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 6b1dea2..e35a401 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -64,10 +64,6 @@ #undef Tcl_ParseArgsObjv #undef TclStaticLibrary #define TclStaticLibrary Tcl_StaticLibrary -#undef Tcl_UniCharToUtfDString -#undef Tcl_UtfToUniCharDString -#undef Tcl_UtfToUniChar -#undef Tcl_UniCharLen #undef TclObjInterpProc #if !defined(_WIN32) && !defined(__CYGWIN__) # undef Tcl_WinConvertError diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 3dede09..e107081 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -678,11 +678,11 @@ Tcl_UtfToUniCharDString( endPtr = src + length; optPtr = endPtr - 4; while (p <= optPtr) { - p += Tcl_UtfToUniChar(p, &ch); + p += TclUtfToUniChar(p, &ch); *w++ = ch; } while ((p < endPtr) && Tcl_UtfCharComplete(p, endPtr-p)) { - p += Tcl_UtfToUniChar(p, &ch); + p += TclUtfToUniChar(p, &ch); *w++ = ch; } while (p < endPtr) { @@ -928,7 +928,7 @@ Tcl_UtfFindFirst( int ch) /* The Unicode character to search for. */ { while (1) { - int find, len = Tcl_UtfToUniChar(src, &find); + int find, len = TclUtfToUniChar(src, &find); if (find == ch) { return src; @@ -967,7 +967,7 @@ Tcl_UtfFindLast( const char *last = NULL; while (1) { - int find, len = Tcl_UtfToUniChar(src, &find); + int find, len = TclUtfToUniChar(src, &find); if (find == ch) { last = src; @@ -1190,7 +1190,7 @@ Tcl_UniCharAtIndex( i = TclUtfToUniChar(src, &ch); src += i; } - Tcl_UtfToUniChar(src, &i); + TclUtfToUniChar(src, &i); return i; } @@ -1219,7 +1219,7 @@ Tcl_UtfAtIndex( Tcl_UniChar ch = 0; while (index-- > 0) { - src += Tcl_UtfToUniChar(src, &ch); + src += TclUtfToUniChar(src, &ch); } return src; } @@ -1329,7 +1329,7 @@ Tcl_UtfToUpper( src = dst = str; while (*src) { - len = Tcl_UtfToUniChar(src, &ch); + len = TclUtfToUniChar(src, &ch); upChar = Tcl_UniCharToUpper(ch); /* @@ -1382,7 +1382,7 @@ Tcl_UtfToLower( src = dst = str; while (*src) { - len = Tcl_UtfToUniChar(src, &ch); + len = TclUtfToUniChar(src, &ch); lowChar = Tcl_UniCharToLower(ch); /* @@ -1438,7 +1438,7 @@ Tcl_UtfToTitle( src = dst = str; if (*src) { - len = Tcl_UtfToUniChar(src, &ch); + len = TclUtfToUniChar(src, &ch); titleChar = Tcl_UniCharToTitle(ch); if (len < TclUtfCount(titleChar)) { @@ -1450,7 +1450,7 @@ Tcl_UtfToTitle( src += len; } while (*src) { - len = Tcl_UtfToUniChar(src, &ch); + len = TclUtfToUniChar(src, &ch); lowChar = ch; /* Special exception for Georgian Asomtavruli chars, no titlecase. */ if ((unsigned)(lowChar - 0x1C90) >= 0x30) { diff --git a/generic/tclUtil.c b/generic/tclUtil.c index efe7ea9..e15a18f 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1672,7 +1672,7 @@ TclTrimRight( pp = Tcl_UtfPrev(p, bytes); do { pp += pInc; - pInc = Tcl_UtfToUniChar(pp, &ch1); + pInc = TclUtfToUniChar(pp, &ch1); } while (pp + pInc < p); /* @@ -1680,7 +1680,7 @@ TclTrimRight( */ do { - pInc = Tcl_UtfToUniChar(q, &ch2); + pInc = TclUtfToUniChar(q, &ch2); if (ch1 == ch2) { break; @@ -1745,7 +1745,7 @@ TclTrimLeft( */ do { - Tcl_Size pInc = Tcl_UtfToUniChar(p, &ch1); + Tcl_Size pInc = TclUtfToUniChar(p, &ch1); const char *q = trim; Tcl_Size bytesLeft = numTrim; @@ -1754,7 +1754,7 @@ TclTrimLeft( */ do { - Tcl_Size qInc = Tcl_UtfToUniChar(q, &ch2); + Tcl_Size qInc = TclUtfToUniChar(q, &ch2); if (ch1 == ch2) { break; @@ -1821,7 +1821,7 @@ TclTrim( if (numBytes > 0) { int ch; const char *first = bytes + trimLeft; - bytes += Tcl_UtfToUniChar(first, &ch); + bytes += TclUtfToUniChar(first, &ch); numBytes -= (bytes - first); if (numBytes > 0) { @@ -2151,7 +2151,7 @@ Tcl_StringCaseMatch( ch2 = (int) (nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); } else { - Tcl_UtfToUniChar(pattern, &ch2); + TclUtfToUniChar(pattern, &ch2); if (nocase) { ch2 = Tcl_UniCharToLower(ch2); } @@ -2167,7 +2167,7 @@ Tcl_StringCaseMatch( if ((p != '[') && (p != '?') && (p != '\\')) { if (nocase) { while (*str) { - charLen = Tcl_UtfToUniChar(str, &ch1); + charLen = TclUtfToUniChar(str, &ch1); if (ch2==ch1 || ch2==Tcl_UniCharToLower(ch1)) { break; } @@ -2181,7 +2181,7 @@ Tcl_StringCaseMatch( */ while (*str) { - charLen = Tcl_UtfToUniChar(str, &ch1); + charLen = TclUtfToUniChar(str, &ch1); if (ch2 == ch1) { break; } @@ -2195,7 +2195,7 @@ Tcl_StringCaseMatch( if (*str == '\0') { return 0; } - str += Tcl_UtfToUniChar(str, &ch1); + str += TclUtfToUniChar(str, &ch1); } } @@ -2206,7 +2206,7 @@ Tcl_StringCaseMatch( if (p == '?') { pattern++; - str += Tcl_UtfToUniChar(str, &ch1); + str += TclUtfToUniChar(str, &ch1); continue; } @@ -2225,7 +2225,7 @@ Tcl_StringCaseMatch( (nocase ? tolower(UCHAR(*str)) : UCHAR(*str)); str++; } else { - str += Tcl_UtfToUniChar(str, &ch1); + str += TclUtfToUniChar(str, &ch1); if (nocase) { ch1 = Tcl_UniCharToLower(ch1); } @@ -2239,7 +2239,7 @@ Tcl_StringCaseMatch( ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); pattern++; } else { - pattern += Tcl_UtfToUniChar(pattern, &startChar); + pattern += TclUtfToUniChar(pattern, &startChar); if (nocase) { startChar = Tcl_UniCharToLower(startChar); } @@ -2254,7 +2254,7 @@ Tcl_StringCaseMatch( ? tolower(UCHAR(*pattern)) : UCHAR(*pattern)); pattern++; } else { - pattern += Tcl_UtfToUniChar(pattern, &endChar); + pattern += TclUtfToUniChar(pattern, &endChar); if (nocase) { endChar = Tcl_UniCharToLower(endChar); } @@ -2302,8 +2302,8 @@ Tcl_StringCaseMatch( * each string match. */ - str += Tcl_UtfToUniChar(str, &ch1); - pattern += Tcl_UtfToUniChar(pattern, &ch2); + str += TclUtfToUniChar(str, &ch1); + pattern += TclUtfToUniChar(pattern, &ch2); if (nocase) { if (Tcl_UniCharToLower(ch1) != Tcl_UniCharToLower(ch2)) { return 0; diff --git a/tests-perf/list.perf.tcl b/tests-perf/list.perf.tcl new file mode 100644 index 0000000..9fde335 --- /dev/null +++ b/tests-perf/list.perf.tcl @@ -0,0 +1,99 @@ +#!/usr/bin/tclsh + +# ------------------------------------------------------------------------ +# +# list.perf.tcl -- +# +# This file provides performance tests for comparison of tcl-speed +# of list facilities. +# +# ------------------------------------------------------------------------ +# +# Copyright (c) 2024 Serg G. Brester (aka sebres) +# +# See the file "license.terms" for information on usage and redistribution +# of this file. +# + + +if {![namespace exists ::tclTestPerf]} { + source [file join [file dirname [info script]] test-performance.tcl] +} + + +namespace eval ::tclTestPerf-List { + +namespace path {::tclTestPerf} + +proc test-lsearch-regress {{reptime 1000}} { + _test_run -no-result $reptime { + # list with 5000 strings with ca. 50 chars elements: + setup { set str [join [lrepeat 13 "XXX"] /]; set l [lrepeat 5000 $str]; llength $l } + # lsearch with no option, found immediatelly : + { lsearch $l $str } + # lsearch with -glob, found immediatelly : + { lsearch -glob $l $str } + # lsearch with -exact, found immediatelly : + { lsearch -exact $l $str } + # lsearch with -dictionary, found immediatelly : + { lsearch -dictionary $l $str } + + # lsearch with -nocase only, found immediatelly : + { lsearch -nocase $l $str } + # lsearch with -nocase -glob, found immediatelly : + { lsearch -nocase -glob $l $str } + # lsearch with -nocase -exact, found immediatelly : + { lsearch -nocase -exact $l $str } + # lsearch with -nocase -dictionary, found immediatelly : + { lsearch -nocase -dictionary $l $str } + } +} + +proc test-lsearch-nf-regress {{reptime 1000}} { + _test_run -no-result $reptime { + # list with 5000 strings with ca. 50 chars elements: + setup { set str [join [lrepeat 13 "XXX"] /]; set sNF $str/NF; set l [lrepeat 5000 $str]; llength $l } + # lsearch with no option, not found: + { lsearch $l $sNF } + # lsearch with -glob, not found: + { lsearch -glob $l $sNF } + # lsearch with -exact, not found: + { lsearch -exact $l $sNF } + # lsearch with -dictionary, not found: + { lsearch -dictionary $l $sNF } + } +} + +proc test-lsearch-nc-nf-regress {{reptime 1000}} { + _test_run -no-result $reptime { + # list with 5000 strings with ca. 50 chars elements: + setup { set str [join [lrepeat 13 "XXX"] /]; set sNF $str/NF; set l [lrepeat 5000 $str]; llength $l } + # lsearch with -nocase only, not found: + { lsearch -nocase $l $sNF } + # lsearch with -nocase -glob, not found: + { lsearch -nocase -glob $l $sNF } + # lsearch with -nocase -exact, not found: + { lsearch -nocase -exact $l $sNF } + # lsearch with -nocase -dictionary, not found: + { lsearch -nocase -dictionary $l $sNF } + } +} + +proc test {{reptime 1000}} { + test-lsearch-regress $reptime + test-lsearch-nf-regress $reptime + test-lsearch-nc-nf-regress $reptime + + puts \n**OK** +} + +}; # end of ::tclTestPerf-List + +# ------------------------------------------------------------------------ + +# if calling direct: +if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { + array set in {-time 500} + array set in $argv + ::tclTestPerf-List::test $in(-time) +} diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 0f63293..2718044 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -876,12 +876,12 @@ TtySetOptionProc( Tcl_UniChar character = 0; int charLen; - charLen = Tcl_UtfToUniChar(argv[0], &character); + charLen = TclUtfToUniChar(argv[0], &character); if ((character > 0xFF) || argv[0][charLen]) { goto badXchar; } iostate.c_cc[VSTART] = character; - charLen = Tcl_UtfToUniChar(argv[1], &character); + charLen = TclUtfToUniChar(argv[1], &character); if ((character > 0xFF) || argv[1][charLen]) { goto badXchar; } diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index c18837e..d8193b4 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1795,12 +1795,12 @@ SerialSetOptionProc( Tcl_UniChar character = 0; int charLen; - charLen = Tcl_UtfToUniChar(argv[0], &character); + charLen = TclUtfToUniChar(argv[0], &character); if ((character > 0xFF) || argv[0][charLen]) { goto badXchar; } dcb.XonChar = (char) character; - charLen = Tcl_UtfToUniChar(argv[1], &character); + charLen = TclUtfToUniChar(argv[1], &character); if ((character > 0xFF) || argv[1][charLen]) { goto badXchar; } |