summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-19 15:37:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-19 15:37:08 (GMT)
commit40b259956cab45a623f5a2153918a8d795f45179 (patch)
treeebf76b3bfdaf4a7d5a86837e6a21afdb25835b1f /generic
parenta2db4b22d0437ecb4df580109e4ac21a1053cedd (diff)
parent6560454489df369db2c1edeaaf82a094efda0115 (diff)
downloadtcl-40b259956cab45a623f5a2153918a8d795f45179.zip
tcl-40b259956cab45a623f5a2153918a8d795f45179.tar.gz
tcl-40b259956cab45a623f5a2153918a8d795f45179.tar.bz2
Merge 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tclAlloc.c2
-rw-r--r--generic/tclBasic.c5
-rw-r--r--generic/tclBinary.c16
-rw-r--r--generic/tclCkalloc.c6
-rw-r--r--generic/tclCmdMZ.c4
-rw-r--r--generic/tclCompCmdsSZ.c2
-rw-r--r--generic/tclCompExpr.c2
-rw-r--r--generic/tclCompile.c8
-rw-r--r--generic/tclExecute.c4
-rw-r--r--generic/tclFileName.c2
-rw-r--r--generic/tclIO.c8
-rw-r--r--generic/tclIOUtil.c2
-rw-r--r--generic/tclInt.h1
-rw-r--r--generic/tclInterp.c8
-rw-r--r--generic/tclListObj.c6
-rw-r--r--generic/tclObj.c12
-rw-r--r--generic/tclPathObj.c2
-rw-r--r--generic/tclStubInit.c2
-rw-r--r--generic/tclTest.c52
-rw-r--r--generic/tclThread.c4
-rw-r--r--generic/tclThreadTest.c4
-rw-r--r--generic/tclTrace.c4
22 files changed, 104 insertions, 52 deletions
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c
index 6187ce2..39b9395 100644
--- a/generic/tclAlloc.c
+++ b/generic/tclAlloc.c
@@ -604,7 +604,7 @@ TclpRealloc(
if (maxSize < numBytes) {
numBytes = maxSize;
}
- memcpy(newPtr, oldPtr, (size_t) numBytes);
+ memcpy(newPtr, oldPtr, numBytes);
TclpFree(oldPtr);
return newPtr;
}
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index fe64f18..2ac6fef 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -3268,6 +3268,7 @@ Tcl_DeleteCommandFromToken(
* TclNRExecuteByteCode looks up the command in the command hashtable).
*/
+ cmdPtr->flags |= CMD_DEAD;
TclCleanupCommandMacro(cmdPtr);
return 0;
}
@@ -4138,7 +4139,7 @@ Tcl_CancelEval(
if (resultObjPtr != NULL) {
result = Tcl_GetStringFromObj(resultObjPtr, &cancelInfo->length);
cancelInfo->result = ckrealloc(cancelInfo->result,cancelInfo->length);
- memcpy(cancelInfo->result, result, (size_t) cancelInfo->length);
+ memcpy(cancelInfo->result, result, cancelInfo->length);
TclDecrRefCount(resultObjPtr); /* Discard their result object. */
} else {
cancelInfo->result = NULL;
@@ -4331,7 +4332,7 @@ EvalObjvCore(
* Caller gave it to us.
*/
- if (!(preCmdPtr->flags & CMD_IS_DELETED)) {
+ if (!(preCmdPtr->flags & CMD_DEAD)) {
/*
* So long as it exists, use it.
*/
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 8f4f6ab..f66aff7 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -339,7 +339,7 @@ Tcl_SetByteArrayObj(
byteArrayPtr->allocated = length;
if ((bytes != NULL) && (length > 0)) {
- memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
+ memcpy(byteArrayPtr->bytes, bytes, length);
}
objPtr->typePtr = &tclByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
@@ -532,7 +532,7 @@ DupByteArrayInternalRep(
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
- memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, (size_t) length);
+ memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
SET_BYTEARRAY(copyPtr, copyArrayPtr);
copyPtr->typePtr = &tclByteArrayType;
@@ -593,7 +593,7 @@ UpdateStringOfByteArray(
objPtr->length = size;
if (size == length) {
- memcpy(dst, src, (size_t) size);
+ memcpy(dst, src, size);
dst[size] = '\0';
} else {
for (i = 0; i < length; i++) {
@@ -945,7 +945,7 @@ BinaryFormatCmd(
resultPtr = Tcl_NewObj();
buffer = Tcl_SetByteArrayLength(resultPtr, length);
- memset(buffer, 0, (size_t) length);
+ memset(buffer, 0, length);
/*
* Pack the data into the result object. Note that we can skip the error
@@ -982,10 +982,10 @@ BinaryFormatCmd(
count = 1;
}
if (length >= count) {
- memcpy(cursor, bytes, (size_t) count);
+ memcpy(cursor, bytes, count);
} else {
- memcpy(cursor, bytes, (size_t) length);
- memset(cursor + length, pad, (size_t) (count - length));
+ memcpy(cursor, bytes, length);
+ memset(cursor + length, pad, count - length);
}
cursor += count;
break;
@@ -1174,7 +1174,7 @@ BinaryFormatCmd(
if (count == BINARY_NOCOUNT) {
count = 1;
}
- memset(cursor, 0, (size_t) count);
+ memset(cursor, 0, count);
cursor += count;
break;
case 'X':
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 9c3cbff..2730443 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -623,7 +623,7 @@ Tcl_DbCkfree(
Tcl_MutexLock(ckallocMutexPtr);
ValidateMemory(memp, file, line, TRUE);
if (init_malloced_bodies) {
- memset(ptr, GUARD_VALUE, (size_t) memp->length);
+ memset(ptr, GUARD_VALUE, memp->length);
}
total_frees++;
@@ -693,7 +693,7 @@ Tcl_DbCkrealloc(
copySize = memp->length;
}
newPtr = Tcl_DbCkalloc(size, file, line);
- memcpy(newPtr, ptr, (size_t) copySize);
+ memcpy(newPtr, ptr, copySize);
Tcl_DbCkfree(ptr, file, line);
return newPtr;
}
@@ -727,7 +727,7 @@ Tcl_AttemptDbCkrealloc(
if (newPtr == NULL) {
return NULL;
}
- memcpy(newPtr, ptr, (size_t) copySize);
+ memcpy(newPtr, ptr, copySize);
Tcl_DbCkfree(ptr, file, line);
return newPtr;
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 298b3b7..b9b6b6c 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -2288,7 +2288,7 @@ StringReptCmd(
return TCL_ERROR;
}
for (index = 0; index < count; index++) {
- memcpy(string2 + (length1 * index), string1, (size_t) length1);
+ memcpy(string2 + (length1 * index), string1, length1);
}
string2[length2] = '\0';
@@ -2850,7 +2850,7 @@ TclStringCmp(
* The comparison function should compare up to the minimum byte
* length only.
*/
- match = memCmpFn(s1, s2, (size_t) length);
+ match = memCmpFn(s1, s2, length);
}
if ((match == 0) && (reqlength > length)) {
match = s1len - s2len;
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 31e2c88..ddfe0dc 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -756,7 +756,7 @@ TclCompileStringMatchCmd(
}
str = tokenPtr[1].start;
length = tokenPtr[1].size;
- if ((length <= 1) || strncmp(str, "-nocase", (size_t) length)) {
+ if ((length <= 1) || strncmp(str, "-nocase", length)) {
/*
* Fail at run time, not in compilation.
*/
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 9c7ab8d..0d33821 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -2068,7 +2068,7 @@ ParseLexeme(
} else {
char utfBytes[TCL_UTF_MAX];
- memcpy(utfBytes, start, (size_t) numBytes);
+ memcpy(utfBytes, start, numBytes);
utfBytes[numBytes] = '\0';
scanned = TclUtfToUniChar(utfBytes, &ch);
}
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index ece0cae..1cc655e 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -2820,7 +2820,7 @@ TclInitByteCodeObj(
p += sizeof(ByteCode);
codePtr->codeStart = p;
- memcpy(p, envPtr->codeStart, (size_t) codeBytes);
+ memcpy(p, envPtr->codeStart, codeBytes);
p += TCL_ALIGN(codeBytes); /* align object array */
codePtr->objArrayPtr = (Tcl_Obj **) p;
@@ -2853,7 +2853,7 @@ TclInitByteCodeObj(
p += TCL_ALIGN(objArrayBytes); /* align exception range array */
if (exceptArrayBytes > 0) {
codePtr->exceptArrayPtr = (ExceptionRange *) p;
- memcpy(p, envPtr->exceptArrayPtr, (size_t) exceptArrayBytes);
+ memcpy(p, envPtr->exceptArrayPtr, exceptArrayBytes);
} else {
codePtr->exceptArrayPtr = NULL;
}
@@ -2861,7 +2861,7 @@ TclInitByteCodeObj(
p += TCL_ALIGN(exceptArrayBytes); /* align AuxData array */
if (auxDataArrayBytes > 0) {
codePtr->auxDataArrayPtr = (AuxData *) p;
- memcpy(p, envPtr->auxDataArrayPtr, (size_t) auxDataArrayBytes);
+ memcpy(p, envPtr->auxDataArrayPtr, auxDataArrayBytes);
} else {
codePtr->auxDataArrayPtr = NULL;
}
@@ -3028,7 +3028,7 @@ TclFindCompiledLocal(
localPtr->resolveInfo = NULL;
if (name != NULL) {
- memcpy(localPtr->name, name, (size_t) nameBytes);
+ memcpy(localPtr->name, name, nameBytes);
}
localPtr->name[nameBytes] = '\0';
procPtr->numCompiledLocals++;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index dd82f95..aacf565 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2838,7 +2838,7 @@ TEBCresume(
for (; currPtr <= &OBJ_AT_TOS; currPtr++) {
bytes = TclGetStringFromObj(*currPtr, &length);
if (bytes != NULL) {
- memcpy(p, bytes, (size_t) length);
+ memcpy(p, bytes, length);
p += length;
}
}
@@ -2873,7 +2873,7 @@ TEBCresume(
for (; currPtr <= &OBJ_AT_TOS; currPtr++) {
if ((*currPtr)->bytes != tclEmptyStringRep) {
bytes = (char *) Tcl_GetByteArrayFromObj(*currPtr,&length);
- memcpy(p, bytes, (size_t) length);
+ memcpy(p, bytes, length);
p += length;
}
}
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index f7de10c..6cdfa7e 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -598,7 +598,7 @@ Tcl_SplitPath(
for (i = 0; i < *argcPtr; i++) {
Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
str = Tcl_GetStringFromObj(eltPtr, &len);
- memcpy(p, str, (size_t) len+1);
+ memcpy(p, str, len+1);
p += len+1;
}
diff --git a/generic/tclIO.c b/generic/tclIO.c
index ab8d8ac..82eb581 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -4314,7 +4314,7 @@ Write(
* that we need to stick at the beginning of this buffer.
*/
- memcpy(InsertPoint(bufPtr), safe, (size_t) saved);
+ memcpy(InsertPoint(bufPtr), safe, saved);
bufPtr->nextAdded += saved;
saved = 0;
}
@@ -4711,7 +4711,7 @@ Tcl_GetsObj(
gs.rawRead -= rawRead;
gs.bytesWrote--;
gs.charsWrote--;
- memmove(dst, dst + 1, (size_t) (dstEnd - dst));
+ memmove(dst, dst + 1, dstEnd - dst);
dstEnd--;
}
}
@@ -7699,7 +7699,7 @@ Tcl_BadChannelOption(
}
Tcl_ResetResult(interp);
errObj = Tcl_ObjPrintf("bad option \"%s\": should be one of ",
- optionName);
+ optionName ? optionName : "");
argc--;
for (i = 0; i < argc; i++) {
Tcl_AppendPrintfToObj(errObj, "-%s, ", argv[i]);
@@ -10475,7 +10475,7 @@ Tcl_IsChannelExisting(
}
if ((*chanName == *name) &&
- (memcmp(name, chanName, (size_t) chanNameLen + 1) == 0)) {
+ (memcmp(name, chanName, chanNameLen + 1) == 0)) {
return 1;
}
}
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 7c2c478..e67da14 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -4209,7 +4209,7 @@ TclFSNonnativePathType(
if (pathLen < len) {
continue;
}
- if (strncmp(strVol, path, (size_t) len) == 0) {
+ if (strncmp(strVol, path, len) == 0) {
type = TCL_PATH_ABSOLUTE;
if (filesystemPtrPtr != NULL) {
*filesystemPtrPtr = fsRecPtr->fsPtr;
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 31108c7..317ae1f 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -1682,6 +1682,7 @@ typedef struct Command {
#define CMD_COMPILES_EXPANDED 0x08
#define CMD_REDEF_IN_PROGRESS 0x10
#define CMD_VIA_RESOLVER 0x20
+#define CMD_DEAD 0x40
/*
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index cebb31e..2c06789 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -1814,8 +1814,8 @@ AliasNRCmd(
cmdv = &listRep->elements;
prefv = &aliasPtr->objPtr;
- memcpy(cmdv, prefv, (size_t) (prefc * sizeof(Tcl_Obj *)));
- memcpy(cmdv+prefc, objv+1, (size_t) ((objc-1) * sizeof(Tcl_Obj *)));
+ memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
+ memcpy(cmdv+prefc, objv+1, (objc-1) * sizeof(Tcl_Obj *));
for (i=0; i<cmdc; i++) {
Tcl_IncrRefCount(cmdv[i]);
@@ -1863,8 +1863,8 @@ AliasObjCmd(
cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
}
- memcpy(cmdv, prefv, (size_t) (prefc * sizeof(Tcl_Obj *)));
- memcpy(cmdv+prefc, objv+1, (size_t) ((objc-1) * sizeof(Tcl_Obj *)));
+ memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
+ memcpy(cmdv+prefc, objv+1, (objc-1) * sizeof(Tcl_Obj *));
Tcl_ResetResult(targetInterp);
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 6eb6780..e0d7bcc 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -653,7 +653,7 @@ Tcl_ListObjAppendElement(
* Old intrep to be freed, re-use refCounts.
*/
- memcpy(dst, src, (size_t) numElems * sizeof(Tcl_Obj *));
+ memcpy(dst, src, numElems * sizeof(Tcl_Obj *));
ckfree(listRepPtr);
}
listRepPtr = newPtr;
@@ -953,7 +953,7 @@ Tcl_ListObjReplace(
if ((numAfterLast > 0) && (shift != 0)) {
Tcl_Obj **src = elemPtrs + start;
- memmove(src+shift, src, (size_t) numAfterLast * sizeof(Tcl_Obj*));
+ memmove(src+shift, src, numAfterLast * sizeof(Tcl_Obj*));
}
} else {
/*
@@ -1024,7 +1024,7 @@ Tcl_ListObjReplace(
*/
if (first > 0) {
- memcpy(elemPtrs, oldPtrs, (size_t) first * sizeof(Tcl_Obj *));
+ memcpy(elemPtrs, oldPtrs, first * sizeof(Tcl_Obj *));
}
/*
diff --git a/generic/tclObj.c b/generic/tclObj.c
index a4df3e7..28fb3da 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -2059,25 +2059,25 @@ ParseBoolean(
/*
* Checking the 'y' is redundant, but makes the code clearer.
*/
- if (strncmp(lowerCase, "yes", (size_t) length) == 0) {
+ if (strncmp(lowerCase, "yes", length) == 0) {
newBool = 1;
goto goodBoolean;
}
return TCL_ERROR;
case 'n':
- if (strncmp(lowerCase, "no", (size_t) length) == 0) {
+ if (strncmp(lowerCase, "no", length) == 0) {
newBool = 0;
goto goodBoolean;
}
return TCL_ERROR;
case 't':
- if (strncmp(lowerCase, "true", (size_t) length) == 0) {
+ if (strncmp(lowerCase, "true", length) == 0) {
newBool = 1;
goto goodBoolean;
}
return TCL_ERROR;
case 'f':
- if (strncmp(lowerCase, "false", (size_t) length) == 0) {
+ if (strncmp(lowerCase, "false", length) == 0) {
newBool = 0;
goto goodBoolean;
}
@@ -2086,10 +2086,10 @@ ParseBoolean(
if (length < 2) {
return TCL_ERROR;
}
- if (strncmp(lowerCase, "on", (size_t) length) == 0) {
+ if (strncmp(lowerCase, "on", length) == 0) {
newBool = 1;
goto goodBoolean;
- } else if (strncmp(lowerCase, "off", (size_t) length) == 0) {
+ } else if (strncmp(lowerCase, "off", length) == 0) {
newBool = 0;
goto goodBoolean;
}
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index c5b1ef6..0f98881 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1745,7 +1745,7 @@ Tcl_FSGetTranslatedStringPath(
const char *orig = Tcl_GetStringFromObj(transPtr, &len);
char *result = ckalloc(len+1);
- memcpy(result, orig, (size_t) len+1);
+ memcpy(result, orig, len+1);
TclDecrRefCount(transPtr);
return result;
}
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 7807083..bab9d5e 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -465,7 +465,7 @@ mp_err mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen)
if (maxlen < 0) {
return MP_VAL;
}
- return mp_to_radix(a, str, (size_t)maxlen, NULL, radix);
+ return mp_to_radix(a, str, maxlen, NULL, radix);
}
void bn_reverse(unsigned char *s, int len)
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 37aafd2..fde7190 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -307,7 +307,7 @@ static Tcl_FSNormalizePathProc TestReportNormalizePath;
static Tcl_FSPathInFilesystemProc TestReportInFilesystem;
static Tcl_FSFreeInternalRepProc TestReportFreeInternalRep;
static Tcl_FSDupInternalRepProc TestReportDupInternalRep;
-
+static Tcl_CmdProc TestServiceModeCmd;
static Tcl_FSStatProc SimpleStat;
static Tcl_FSAccessProc SimpleAccess;
static Tcl_FSOpenFileChannelProc SimpleOpenFileChannel;
@@ -561,6 +561,8 @@ Tcltest_Init(
NULL, NULL);
Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd,
NULL, NULL);
+ Tcl_CreateCommand(interp, "testservicemode", TestServiceModeCmd,
+ NULL, NULL);
Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testsetnoerr", TestsetCmd,
@@ -6049,6 +6051,54 @@ TestChannelEventCmd(
/*
*----------------------------------------------------------------------
*
+ * TestServiceModeCmd --
+ *
+ * This procedure implements the "testservicemode" command which gets or
+ * sets the current Tcl ServiceMode. There are several tests which open
+ * a file and assign various handlers to it. For these tests to be
+ * deterministic it is important that file events not be processed until
+ * all of the handlers are in place.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * May change the ServiceMode setting.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestServiceModeCmd(
+ ClientData dummy, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ const char **argv) /* Argument strings. */
+{
+ int newmode, oldmode;
+ if (argc > 2) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ?newmode?\"", NULL);
+ return TCL_ERROR;
+ }
+ oldmode = (Tcl_GetServiceMode() != TCL_SERVICE_NONE);
+ if (argc == 2) {
+ if (Tcl_GetInt(interp, argv[1], &newmode) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ if (newmode == 0) {
+ Tcl_SetServiceMode(TCL_SERVICE_NONE);
+ } else {
+ Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ }
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(oldmode));
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TestWrongNumArgsObjCmd --
*
* Test the Tcl_WrongNumArgs function.
diff --git a/generic/tclThread.c b/generic/tclThread.c
index 8915792..03937de 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -88,13 +88,13 @@ Tcl_GetThreadData(
if (result == NULL) {
result = ckalloc(size);
- memset(result, 0, (size_t) size);
+ memset(result, 0, size);
TclThreadStorageKeySet(keyPtr, result);
}
#else /* TCL_THREADS */
if (*keyPtr == NULL) {
result = ckalloc(size);
- memset(result, 0, (size_t)size);
+ memset(result, 0, size);
*keyPtr = result;
RememberSyncObject(keyPtr, &keyRecord);
} else {
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 35b3fc3..ff18077 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.c
@@ -294,7 +294,7 @@ ThreadObjCmd(
script = Tcl_GetStringFromObj(objv[2], &len);
if ((len > 1) && (script[0] == '-') && (script[1] == 'j') &&
- (0 == strncmp(script, "-joinable", (size_t) len))) {
+ (0 == strncmp(script, "-joinable", len))) {
joinable = 1;
script = "testthread wait"; /* Just enter event loop */
} else {
@@ -311,7 +311,7 @@ ThreadObjCmd(
script = Tcl_GetStringFromObj(objv[2], &len);
joinable = ((len > 1) && (script[0] == '-') && (script[1] == 'j')
- && (0 == strncmp(script, "-joinable", (size_t) len)));
+ && (0 == strncmp(script, "-joinable", len)));
script = Tcl_GetString(objv[3]);
} else {
Tcl_WrongNumArgs(interp, 2, objv, "?-joinable? ?script?");
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 882dc39..3178441 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -1689,8 +1689,8 @@ CallTraceFunction(
* Copy the command characters into a new string.
*/
- commandCopy = TclStackAlloc(interp, (unsigned) numChars + 1);
- memcpy(commandCopy, command, (size_t) numChars);
+ commandCopy = TclStackAlloc(interp, numChars + 1);
+ memcpy(commandCopy, command, numChars);
commandCopy[numChars] = '\0';
/*