summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-11-05 17:06:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-11-05 17:06:22 (GMT)
commitcccc07aa2829b401bc101caeb9890a7e876081a2 (patch)
tree620ee207ede848ef890070313145c275721cb615 /generic
parent263312727f8fc4187995ed52540370d6b0589143 (diff)
parent3b0ee42270085b039b75e2e27a3a145399a1bfac (diff)
downloadtcl-cccc07aa2829b401bc101caeb9890a7e876081a2.zip
tcl-cccc07aa2829b401bc101caeb9890a7e876081a2.tar.gz
tcl-cccc07aa2829b401bc101caeb9890a7e876081a2.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/regc_locale.c2
-rw-r--r--generic/tcl.decls3
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclCmdIL.c4
-rw-r--r--generic/tclCmdMZ.c12
-rw-r--r--generic/tclCompCmdsGR.c2
-rw-r--r--generic/tclCompCmdsSZ.c2
-rw-r--r--generic/tclDecls.h5
-rw-r--r--generic/tclStubInit.c1
-rw-r--r--generic/tclUtf.c68
-rw-r--r--generic/tclUtil.c12
11 files changed, 37 insertions, 78 deletions
diff --git a/generic/regc_locale.c b/generic/regc_locale.c
index cc4681b..c90dd64 100644
--- a/generic/regc_locale.c
+++ b/generic/regc_locale.c
@@ -1269,7 +1269,7 @@ casecmp(
size_t len) /* exact length of comparison */
{
for (; len > 0; len--, x++, y++) {
- if ((*x!=*y) && (Tcl_UniCharFold(*x) != Tcl_UniCharFold(*y))) {
+ if ((*x!=*y) && (Tcl_UniCharToLower(*x) != Tcl_UniCharToLower(*y))) {
return 1;
}
}
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 3785558..b061767 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2412,9 +2412,6 @@ declare 650 {
declare 651 {
const char *Tcl_UtfPrev(const char *src, const char *start)
}
-declare 652 {
- int Tcl_UniCharFold(int ch)
-}
# ----- BASELINE -- FOR -- 8.7.0 ----- #
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 4e2bcb1..88e51be 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -8790,8 +8790,8 @@ MathFuncWrongNumArgs(
}
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "too %s arguments for math function \"%s\"",
- (found < expected ? "few" : "many"), name));
+ "%s arguments for math function \"%s\"",
+ (found < expected ? "not enough" : "too many"), name));
Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL);
}
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index cf900a3..da8dc65 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -4782,8 +4782,8 @@ DictionaryCompare(
* other interesting punctuations occur).
*/
- uniLeftLower = Tcl_UniCharFold(uniLeft);
- uniRightLower = Tcl_UniCharFold(uniRight);
+ uniLeftLower = Tcl_UniCharToLower(uniLeft);
+ uniRightLower = Tcl_UniCharToLower(uniRight);
} else {
diff = UCHAR(*left) - UCHAR(*right);
break;
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index cf4240a..d6b4aa5 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -629,10 +629,10 @@ Tcl_RegsubObjCmd(
wlen = 0;
}
} else {
- wsrclc = Tcl_UniCharFold(*wsrc);
+ wsrclc = Tcl_UniCharToLower(*wsrc);
for (p = wfirstChar = wstring; wstring < wend; wstring++) {
if ((*wstring == *wsrc ||
- (nocase && Tcl_UniCharFold(*wstring)==wsrclc)) &&
+ (nocase && Tcl_UniCharToLower(*wstring)==wsrclc)) &&
(slen==1 || (strCmpFn(wstring, wsrc,
(unsigned long) slen) == 0))) {
if (numMatches == 0) {
@@ -2096,10 +2096,10 @@ StringMapCmd(
ustring1 = end;
} else {
mapString = Tcl_GetUnicodeFromObj(mapElemv[1], &mapLen);
- u2lc = (nocase ? Tcl_UniCharFold(*ustring2) : 0);
+ u2lc = (nocase ? Tcl_UniCharToLower(*ustring2) : 0);
for (; ustring1 < end; ustring1++) {
if (((*ustring1 == *ustring2) ||
- (nocase&&Tcl_UniCharFold(*ustring1)==u2lc)) &&
+ (nocase&&Tcl_UniCharToLower(*ustring1)==u2lc)) &&
(length2==1 || strCmpFn(ustring1, ustring2,
(unsigned long) length2) == 0)) {
if (p != ustring1) {
@@ -2134,7 +2134,7 @@ StringMapCmd(
mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index],
mapLens+index);
if (nocase && ((index % 2) == 0)) {
- u2lc[index/2] = Tcl_UniCharFold(*mapStrings[index]);
+ u2lc[index/2] = Tcl_UniCharToLower(*mapStrings[index]);
}
}
for (p = ustring1; ustring1 < end; ustring1++) {
@@ -2146,7 +2146,7 @@ StringMapCmd(
ustring2 = mapStrings[index];
length2 = mapLens[index];
if ((length2 > 0) && ((*ustring1 == *ustring2) || (nocase &&
- (Tcl_UniCharFold(*ustring1) == u2lc[index/2]))) &&
+ (Tcl_UniCharToLower(*ustring1) == u2lc[index/2]))) &&
/* Restrict max compare length. */
(end-ustring1 >= length2) && ((length2 == 1) ||
!strCmpFn(ustring2, ustring1, length2))) {
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 780f7b8..cebd8f5 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -1064,7 +1064,7 @@ TclCompileLindexCmd(
int i, idx, numWords = parsePtr->numWords;
/*
- * Quit if too few args.
+ * Quit if not enough args.
*/
/* TODO: Consider support for compiling expanded args. */
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index fe661f8..26698a8 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -462,7 +462,7 @@ TclCompileStringInsertCmd(
TCL_INDEX_END, &idx)) {
/* Nothing useful knowable - cease compile; let it direct eval */
- return TCL_OK;
+ return TCL_ERROR;
}
/* Compute and push the string to be inserted */
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 31bb2d4..5bec811 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1926,8 +1926,6 @@ EXTERN int Tcl_UtfCharComplete(const char *src, int length);
EXTERN const char * Tcl_UtfNext(const char *src);
/* 651 */
EXTERN const char * Tcl_UtfPrev(const char *src, const char *start);
-/* 652 */
-EXTERN int Tcl_UniCharFold(int ch);
typedef struct {
const struct TclPlatStubs *tclPlatStubs;
@@ -2615,7 +2613,6 @@ typedef struct TclStubs {
int (*tcl_UtfCharComplete) (const char *src, int length); /* 649 */
const char * (*tcl_UtfNext) (const char *src); /* 650 */
const char * (*tcl_UtfPrev) (const char *src, const char *start); /* 651 */
- int (*tcl_UniCharFold) (int ch); /* 652 */
} TclStubs;
extern const TclStubs *tclStubsPtr;
@@ -3950,8 +3947,6 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_UtfNext) /* 650 */
#define Tcl_UtfPrev \
(tclStubsPtr->tcl_UtfPrev) /* 651 */
-#define Tcl_UniCharFold \
- (tclStubsPtr->tcl_UniCharFold) /* 652 */
#endif /* defined(USE_TCL_STUBS) */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 903ad10..03577f7 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -1901,7 +1901,6 @@ const TclStubs tclStubs = {
Tcl_UtfCharComplete, /* 649 */
Tcl_UtfNext, /* 650 */
Tcl_UtfPrev, /* 651 */
- Tcl_UniCharFold, /* 652 */
};
/* !END!: Do not edit above this line. */
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 807e087..3c18b9e 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -1557,8 +1557,8 @@ Tcl_UtfNcasecmp(
return -ch2;
}
#endif
- ch1 = Tcl_UniCharFold(ch1);
- ch2 = Tcl_UniCharFold(ch2);
+ ch1 = Tcl_UniCharToLower(ch1);
+ ch2 = Tcl_UniCharToLower(ch2);
if (ch1 != ch2) {
return (ch1 - ch2);
}
@@ -1652,8 +1652,8 @@ TclUtfCasecmp(
return -ch2;
}
#endif
- ch1 = Tcl_UniCharFold(ch1);
- ch2 = Tcl_UniCharFold(ch2);
+ ch1 = Tcl_UniCharToLower(ch1);
+ ch2 = Tcl_UniCharToLower(ch2);
if (ch1 != ch2) {
return ch1 - ch2;
}
@@ -1729,38 +1729,6 @@ Tcl_UniCharToLower(
/*
*----------------------------------------------------------------------
*
- * Tcl_UniCharFold --
- *
- * Compute the lowercase equivalent of the given Unicode character.
- *
- * Results:
- * Returns the lowercase Unicode character.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-Tcl_UniCharFold(
- int ch) /* Unicode character to convert. */
-{
- if (!UNICODE_OUT_OF_RANGE(ch)) {
- int info = GetUniCharInfo(ch);
- int mode = GetCaseType(info);
-
- if ((mode & 0x02) && (mode != 0x7)) {
- ch += GetDelta(info);
- }
- }
- /* Clear away extension bits, if any */
- return ch & 0x1FFFFF;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_UniCharToTitle --
*
* Compute the titlecase equivalent of the given Unicode character.
@@ -1898,8 +1866,8 @@ Tcl_UniCharNcasecmp(
{
for ( ; numChars != 0; numChars--, ucs++, uct++) {
if (*ucs != *uct) {
- Tcl_UniChar lcs = Tcl_UniCharFold(*ucs);
- Tcl_UniChar lct = Tcl_UniCharFold(*uct);
+ Tcl_UniChar lcs = Tcl_UniCharToLower(*ucs);
+ Tcl_UniChar lct = Tcl_UniCharToLower(*uct);
if (lcs != lct) {
return (lcs - lct);
@@ -2287,7 +2255,7 @@ Tcl_UniCharCaseMatch(
return 1;
}
if (nocase) {
- p = Tcl_UniCharFold(p);
+ p = Tcl_UniCharToLower(p);
}
while (1) {
/*
@@ -2339,13 +2307,13 @@ Tcl_UniCharCaseMatch(
Tcl_UniChar startChar, endChar;
uniPattern++;
- ch1 = (nocase ? Tcl_UniCharFold(*uniStr) : *uniStr);
+ ch1 = (nocase ? Tcl_UniCharToLower(*uniStr) : *uniStr);
uniStr++;
while (1) {
if ((*uniPattern == ']') || (*uniPattern == 0)) {
return 0;
}
- startChar = (nocase ? Tcl_UniCharFold(*uniPattern)
+ startChar = (nocase ? Tcl_UniCharToLower(*uniPattern)
: *uniPattern);
uniPattern++;
if (*uniPattern == '-') {
@@ -2353,7 +2321,7 @@ Tcl_UniCharCaseMatch(
if (*uniPattern == 0) {
return 0;
}
- endChar = (nocase ? Tcl_UniCharFold(*uniPattern)
+ endChar = (nocase ? Tcl_UniCharToLower(*uniPattern)
: *uniPattern);
uniPattern++;
if (((startChar <= ch1) && (ch1 <= endChar))
@@ -2395,8 +2363,8 @@ Tcl_UniCharCaseMatch(
*/
if (nocase) {
- if (Tcl_UniCharFold(*uniStr) !=
- Tcl_UniCharFold(*uniPattern)) {
+ if (Tcl_UniCharToLower(*uniStr) !=
+ Tcl_UniCharToLower(*uniPattern)) {
return 0;
}
} else if (*uniStr != *uniPattern) {
@@ -2479,7 +2447,7 @@ TclUniCharMatch(
}
p = *pattern;
if (nocase) {
- p = Tcl_UniCharFold(p);
+ p = Tcl_UniCharToLower(p);
}
while (1) {
/*
@@ -2491,7 +2459,7 @@ TclUniCharMatch(
if ((p != '[') && (p != '?') && (p != '\\')) {
if (nocase) {
while ((string < stringEnd) && (p != *string)
- && (p != Tcl_UniCharFold(*string))) {
+ && (p != Tcl_UniCharToLower(*string))) {
string++;
}
} else {
@@ -2532,20 +2500,20 @@ TclUniCharMatch(
Tcl_UniChar ch1, startChar, endChar;
pattern++;
- ch1 = (nocase ? Tcl_UniCharFold(*string) : *string);
+ ch1 = (nocase ? Tcl_UniCharToLower(*string) : *string);
string++;
while (1) {
if ((*pattern == ']') || (pattern == patternEnd)) {
return 0;
}
- startChar = (nocase ? Tcl_UniCharFold(*pattern) : *pattern);
+ startChar = (nocase ? Tcl_UniCharToLower(*pattern) : *pattern);
pattern++;
if (*pattern == '-') {
pattern++;
if (pattern == patternEnd) {
return 0;
}
- endChar = (nocase ? Tcl_UniCharFold(*pattern)
+ endChar = (nocase ? Tcl_UniCharToLower(*pattern)
: *pattern);
pattern++;
if (((startChar <= ch1) && (ch1 <= endChar))
@@ -2587,7 +2555,7 @@ TclUniCharMatch(
*/
if (nocase) {
- if (Tcl_UniCharFold(*string) != Tcl_UniCharFold(*pattern)) {
+ if (Tcl_UniCharToLower(*string) != Tcl_UniCharToLower(*pattern)) {
return 0;
}
} else if (*string != *pattern) {
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 0cf5d98..0241e29 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2208,7 +2208,7 @@ Tcl_StringCaseMatch(
} else {
TclUtfToUCS4(pattern, &ch2);
if (nocase) {
- ch2 = Tcl_UniCharFold(ch2);
+ ch2 = Tcl_UniCharToLower(ch2);
}
}
@@ -2223,7 +2223,7 @@ Tcl_StringCaseMatch(
if (nocase) {
while (*str) {
charLen = TclUtfToUCS4(str, &ch1);
- if (ch2==ch1 || ch2==Tcl_UniCharFold(ch1)) {
+ if (ch2==ch1 || ch2==Tcl_UniCharToLower(ch1)) {
break;
}
str += charLen;
@@ -2282,7 +2282,7 @@ Tcl_StringCaseMatch(
} else {
str += TclUtfToUCS4(str, &ch1);
if (nocase) {
- ch1 = Tcl_UniCharFold(ch1);
+ ch1 = Tcl_UniCharToLower(ch1);
}
}
while (1) {
@@ -2296,7 +2296,7 @@ Tcl_StringCaseMatch(
} else {
pattern += TclUtfToUCS4(pattern, &startChar);
if (nocase) {
- startChar = Tcl_UniCharFold(startChar);
+ startChar = Tcl_UniCharToLower(startChar);
}
}
if (*pattern == '-') {
@@ -2311,7 +2311,7 @@ Tcl_StringCaseMatch(
} else {
pattern += TclUtfToUCS4(pattern, &endChar);
if (nocase) {
- endChar = Tcl_UniCharFold(endChar);
+ endChar = Tcl_UniCharToLower(endChar);
}
}
if (((startChar <= ch1) && (ch1 <= endChar))
@@ -2360,7 +2360,7 @@ Tcl_StringCaseMatch(
str += TclUtfToUCS4(str, &ch1);
pattern += TclUtfToUCS4(pattern, &ch2);
if (nocase) {
- if (Tcl_UniCharFold(ch1) != Tcl_UniCharFold(ch2)) {
+ if (Tcl_UniCharToLower(ch1) != Tcl_UniCharToLower(ch2)) {
return 0;
}
} else if (ch1 != ch2) {