diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-20 21:07:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-20 21:07:35 (GMT) |
commit | fc7ca4202ee105ad3bbd576d2a3bf2e5d5793825 (patch) | |
tree | 3561954263de77d32ce0789a163288d614ed56fc /generic | |
parent | 68c30819addefd8b550722d6a18bd83908db371b (diff) | |
download | tcl-fc7ca4202ee105ad3bbd576d2a3bf2e5d5793825.zip tcl-fc7ca4202ee105ad3bbd576d2a3bf2e5d5793825.tar.gz tcl-fc7ca4202ee105ad3bbd576d2a3bf2e5d5793825.tar.bz2 |
Change a few variables from type "int" to "size_t". Always test TCL_UTF_MAX for <= 3 or > 3, because that's the only 2 flavours we really have.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclDisassemble.c | 2 | ||||
-rw-r--r-- | generic/tclObj.c | 4 | ||||
-rw-r--r-- | generic/tclUtf.c | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 49904bd..85a17b0 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -832,7 +832,7 @@ UpdateStringOfInstName( if (inst > LAST_INST_OPCODE) { dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5); - TclOOM(dst, TCL_INTEGER_SPACE + 5); + TclOOM(dst, (size_t)TCL_INTEGER_SPACE + 5); sprintf(dst, "inst_%" TCL_Z_MODIFIER "u", inst); (void) Tcl_InitStringRep(objPtr, NULL, strlen(dst)); } else { diff --git a/generic/tclObj.c b/generic/tclObj.c index 7853507..8a628a7 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2381,7 +2381,7 @@ UpdateStringOfDouble( { char *dst = Tcl_InitStringRep(objPtr, NULL, TCL_DOUBLE_SPACE); - TclOOM(dst, TCL_DOUBLE_SPACE + 1); + TclOOM(dst, (size_t)TCL_DOUBLE_SPACE + 1); Tcl_PrintDouble(NULL, objPtr->internalRep.doubleValue, dst); (void) Tcl_InitStringRep(objPtr, NULL, strlen(dst)); @@ -2494,7 +2494,7 @@ UpdateStringOfInt( { char *dst = Tcl_InitStringRep( objPtr, NULL, TCL_INTEGER_SPACE); - TclOOM(dst, TCL_INTEGER_SPACE + 1); + TclOOM(dst, (size_t)TCL_INTEGER_SPACE + 1); (void) Tcl_InitStringRep(objPtr, NULL, TclFormatInt(dst, objPtr->internalRep.wideValue)); } diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 5b0c9e9..6e0a7db 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -344,7 +344,7 @@ Tcl_Char16ToUtfDString( * Tcl_UtfCharComplete() before calling this routine to ensure that * enough bytes remain in the string. * - * If TCL_UTF_MAX <= 4, special handling of Surrogate pairs is done: + * If TCL_UTF_MAX <= 3, special handling of Surrogate pairs is done: * For any UTF-8 string containing a character outside of the BMP, the * first call to this function will fill *chPtr with the high surrogate * and generate a return value of 1. Calling Tcl_UtfToUniChar again @@ -1031,13 +1031,13 @@ Tcl_UtfAtIndex( size_t index) /* The position of the desired character. */ { Tcl_UniChar ch = 0; -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX <= 3 size_t len = 0; #endif if (index != TCL_INDEX_NONE) { while (index--) { -#if TCL_UTF_MAX <= 4 +#if TCL_UTF_MAX <= 3 src += (len = TclUtfToUniChar(src, &ch)); #else src += TclUtfToUniChar(src, &ch); |