summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-12 18:59:04 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-12 18:59:04 (GMT)
commit648162204d4c9bd80cde739b4cad361de6ebe6f1 (patch)
tree183773242a85ee384881e3ed8e2f5cef49c030ae /generic/tclUtf.c
parent09f4817353f0b33e04d9866888e1408a16b1afa6 (diff)
downloadtcl-648162204d4c9bd80cde739b4cad361de6ebe6f1.zip
tcl-648162204d4c9bd80cde739b4cad361de6ebe6f1.tar.gz
tcl-648162204d4c9bd80cde739b4cad361de6ebe6f1.tar.bz2
First, experimental implementation of TIP #575. Barely tested, will fail. WIP
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 7c09283..6f03053 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -88,13 +88,7 @@ static const unsigned char complete[256] = {
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
/* End of "continuation byte section" */
2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-#if TCL_UTF_MAX > 3
- 4,4,4,4,4,
-#else
- 3,3,3,3,3,
-#endif
- 1,1,1,1,1,1,1,1,1,1,1
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1
};
/*
@@ -694,7 +688,7 @@ Tcl_UtfToUniCharDString(
p += TclUtfToUCS4(p, &ch);
*w++ = ch;
}
- while ((p < endPtr) && TclUCS4Complete(p, endPtr-p)) {
+ while ((p < endPtr) && Tcl_UtfCharComplete(p, endPtr-p)) {
p += TclUtfToUCS4(p, &ch);
*w++ = ch;
}
@@ -752,7 +746,7 @@ Tcl_UtfToChar16DString(
*w++ = ch;
}
while (p < endPtr) {
- if (TclChar16Complete(p, endPtr-p)) {
+ if (Tcl_UtfCharComplete(p, endPtr-p)) {
p += Tcl_UtfToChar16(p, &ch);
*w++ = ch;
} else {
@@ -833,7 +827,7 @@ Tcl_NumUtfChars(
/* Pointer to the end of string. Never read endPtr[0] */
const char *endPtr = src + length;
/* Pointer to last byte where optimization still can be used */
- const char *optPtr = endPtr - TCL_UTF_MAX;
+ const char *optPtr = endPtr - 4;
/*
* Optimize away the call in this loop. Justified because...