From f04b875d88bbe9cd4d2114d60c194be01a7c9e04 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Feb 2019 08:34:05 +0000 Subject: More use of (efficient) TclHasIntRep() macro. Also eliminate many (size_t) and (unsigned) type-casts, which don't make sense any more. --- generic/tclAlloc.c | 6 +++--- generic/tclBasic.c | 2 +- generic/tclBinary.c | 16 ++++++++-------- generic/tclCkalloc.c | 8 ++++---- generic/tclCmdMZ.c | 2 +- generic/tclCompCmdsGR.c | 2 +- generic/tclCompExpr.c | 2 +- generic/tclCompile.c | 10 +++++----- generic/tclEncoding.c | 10 +++++----- generic/tclEnsemble.c | 4 ++-- generic/tclEnv.c | 10 +++++----- generic/tclFileName.c | 10 +++++----- generic/tclHash.c | 4 ++-- generic/tclIO.c | 16 ++++++++-------- generic/tclIOCmd.c | 2 +- generic/tclIORChan.c | 6 +++--- generic/tclIORTrans.c | 10 +++++----- generic/tclIndexObj.c | 6 ++---- generic/tclInt.h | 10 +++++----- generic/tclInterp.c | 12 ++++++------ generic/tclListObj.c | 4 ++-- generic/tclLiteral.c | 4 ++-- generic/tclLoad.c | 2 +- generic/tclNamesp.c | 4 ++-- generic/tclOOCall.c | 2 +- generic/tclParse.c | 2 +- generic/tclPathObj.c | 26 ++++++++------------------ generic/tclPkg.c | 8 ++++---- generic/tclProc.c | 2 +- generic/tclRegexp.c | 2 +- generic/tclResult.c | 2 +- generic/tclStringObj.c | 4 ++-- generic/tclThread.c | 4 ++-- generic/tclTimer.c | 2 +- generic/tclTrace.c | 6 +++--- generic/tclUtf.c | 8 ++++---- generic/tclUtil.c | 10 +++++----- macosx/tclMacOSXFCmd.c | 2 +- unix/tclUnixFile.c | 2 +- unix/tclUnixSock.c | 2 +- win/tclWinConsole.c | 6 +++--- win/tclWinInit.c | 4 ++-- win/tclWinPipe.c | 2 +- 43 files changed, 123 insertions(+), 135 deletions(-) diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index df1718b..bad3d8a 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -274,8 +274,8 @@ TclpAlloc( if (numBytes >= MAXMALLOC - OVERHEAD) { if (numBytes <= UINT_MAX - OVERHEAD -sizeof(struct block)) { - bigBlockPtr = (struct block *) TclpSysAlloc((unsigned) - (sizeof(struct block) + OVERHEAD + numBytes), 0); + bigBlockPtr = (struct block *) TclpSysAlloc( + sizeof(struct block) + OVERHEAD + numBytes, 0); } if (bigBlockPtr == NULL) { Tcl_MutexUnlock(allocMutexPtr); @@ -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 3747c90..67e4aa3 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -4408,7 +4408,7 @@ Tcl_CancelEval( if (resultObjPtr != NULL) { result = TclGetStringFromObj(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; diff --git a/generic/tclBinary.c b/generic/tclBinary.c index ab9262f..00d7eba 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -421,7 +421,7 @@ Tcl_SetByteArrayObj( byteArrayPtr->allocated = length; if ((bytes != NULL) && (length > 0)) { - memcpy(byteArrayPtr->bytes, bytes, (size_t) length); + memcpy(byteArrayPtr->bytes, bytes, length); } SET_BYTEARRAY(&ir, byteArrayPtr); @@ -653,7 +653,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(&ir, copyArrayPtr); Tcl_StoreIntRep(copyPtr, &tclByteArrayType, &ir); @@ -674,7 +674,7 @@ DupProperByteArrayInternalRep( 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(&ir, copyArrayPtr); Tcl_StoreIntRep(copyPtr, &properByteArrayType, &ir); @@ -1076,7 +1076,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 @@ -1113,10 +1113,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; @@ -1305,7 +1305,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 e3fb98e..94327b5 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -405,7 +405,7 @@ Tcl_DbCkalloc( /* Don't let size argument to TclpAlloc overflow */ if (size <= UINT_MAX - HIGH_GUARD_SIZE -sizeof(struct mem_header)) { - result = (struct mem_header *) TclpAlloc((unsigned)size + + result = (struct mem_header *) TclpAlloc(size + sizeof(struct mem_header) + HIGH_GUARD_SIZE); } if (result == NULL) { @@ -495,7 +495,7 @@ Tcl_AttemptDbCkalloc( /* Don't let size argument to TclpAlloc overflow */ if (size <= UINT_MAX - HIGH_GUARD_SIZE - sizeof(struct mem_header)) { - result = (struct mem_header *) TclpAlloc((unsigned)size + + result = (struct mem_header *) TclpAlloc(size + sizeof(struct mem_header) + HIGH_GUARD_SIZE); } if (result == NULL) { @@ -691,7 +691,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; } @@ -725,7 +725,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 2dea688..4d9f311 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -2114,7 +2114,7 @@ StringMapCmd( (Tcl_UniCharToLower(*ustring1) == u2lc[index/2]))) && /* Restrict max compare length. */ (end-ustring1 >= length2) && ((length2 == 1) || - !strCmpFn(ustring2, ustring1, (unsigned) length2))) { + !strCmpFn(ustring2, ustring1, length2))) { if (p != ustring1) { /* * Put the skipped chars onto the result first. diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index 26e9c87..441611e 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -2121,7 +2121,7 @@ TclCompileRegexpCmd( sawLast++; i++; break; - } else if ((len > 1) && (strncmp(str,"-nocase",(unsigned)len) == 0)) { + } else if ((len > 1) && (strncmp(str, "-nocase", len) == 0)) { nocase = 1; } else { /* diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index e96e264..7e340e4 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 f6e6b81..32ddfc8 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2837,7 +2837,7 @@ TclInitByteCode( 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; @@ -2848,7 +2848,7 @@ TclInitByteCode( 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; } @@ -2856,7 +2856,7 @@ TclInitByteCode( 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; } @@ -3008,7 +3008,7 @@ TclFindCompiledLocal( char *localName = localPtr->name; if ((nameBytes == localPtr->nameLength) && - (strncmp(name,localName,(unsigned)nameBytes) == 0)) { + (strncmp(name, localName, nameBytes) == 0)) { return i; } } @@ -3040,7 +3040,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/tclEncoding.c b/generic/tclEncoding.c index e601c3a..c72368b 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2073,9 +2073,9 @@ LoadEscapeEncoding( + Tcl_DStringLength(&escapeData); dataPtr = ckalloc(size); dataPtr->initLen = strlen(init); - memcpy(dataPtr->init, init, (unsigned) dataPtr->initLen + 1); + memcpy(dataPtr->init, init, dataPtr->initLen + 1); dataPtr->finalLen = strlen(final); - memcpy(dataPtr->final, final, (unsigned) dataPtr->finalLen + 1); + memcpy(dataPtr->final, final, dataPtr->finalLen + 1); dataPtr->numSubTables = Tcl_DStringLength(&escapeData) / sizeof(EscapeSubTable); memcpy(dataPtr->subTables, Tcl_DStringValue(&escapeData), @@ -2167,7 +2167,7 @@ BinaryProc( *srcReadPtr = srcLen; *dstWrotePtr = srcLen; *dstCharsPtr = srcLen; - memcpy(dst, src, (size_t) srcLen); + memcpy(dst, src, srcLen); return result; } @@ -3364,7 +3364,7 @@ EscapeFromUtfProc( *dstWrotePtr = 0; return TCL_CONVERT_NOSPACE; } - memcpy(dst, dataPtr->init, (size_t)dataPtr->initLen); + memcpy(dst, dataPtr->init, dataPtr->initLen); dst += dataPtr->initLen; } else { state = PTR2INT(*statePtr); @@ -3486,7 +3486,7 @@ EscapeFromUtfProc( memcpy(dst, dataPtr->subTables[0].sequence, len); dst += len; } - memcpy(dst, dataPtr->final, (size_t) dataPtr->finalLen); + memcpy(dst, dataPtr->final, dataPtr->finalLen); dst += dataPtr->finalLen; state &= ~TCL_ENCODING_END; } diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 73e3ce7..53b8bfb 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1815,7 +1815,7 @@ NsEnsembleImplementationCmdNR( for (i=0 ; isubcommandArrayPtr[i], - (unsigned) stringLength); + stringLength); if (cmp == 0) { if (fullName != NULL) { @@ -2769,7 +2769,7 @@ BuildEnsembleConfig( hPtr = Tcl_NextHashEntry(&search); } if (hash->numEntries > 1) { - qsort(ensemblePtr->subcommandArrayPtr, (unsigned) hash->numEntries, + qsort(ensemblePtr->subcommandArrayPtr, hash->numEntries, sizeof(char *), NsEnsembleStringOrder); } } diff --git a/generic/tclEnv.c b/generic/tclEnv.c index 40ced17..2c7db0d 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -260,7 +260,7 @@ TclSetEnv( Tcl_DStringFree(&envString); oldValue = environ[index]; - nameLength = (unsigned) length; + nameLength = length; } /* @@ -281,7 +281,7 @@ TclSetEnv( */ p = ckrealloc(p, Tcl_DStringLength(&envString) + 1); - memcpy(p, p2, (unsigned) Tcl_DStringLength(&envString) + 1); + memcpy(p, p2, Tcl_DStringLength(&envString) + 1); Tcl_DStringFree(&envString); #ifdef USE_PUTENV @@ -442,19 +442,19 @@ TclUnsetEnv( #if defined(_WIN32) string = ckalloc(length + 2); - memcpy(string, name, (size_t) length); + memcpy(string, name, length); string[length] = '='; string[length+1] = '\0'; #else string = ckalloc(length + 1); - memcpy(string, name, (size_t) length); + memcpy(string, name, length); string[length] = '\0'; #endif /* _WIN32 */ Tcl_UtfToExternalDString(NULL, string, -1, &envString); string = ckrealloc(string, Tcl_DStringLength(&envString) + 1); memcpy(string, Tcl_DStringValue(&envString), - (unsigned) Tcl_DStringLength(&envString)+1); + Tcl_DStringLength(&envString)+1); Tcl_DStringFree(&envString); putenv(string); diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 7dba19c..98ee37c 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 = TclGetStringFromObj(eltPtr, &len); - memcpy(p, str, (size_t) len+1); + memcpy(p, str, len+1); p += len+1; } @@ -2548,21 +2548,21 @@ unsigned Tcl_GetFSDeviceFromStat( const Tcl_StatBuf *statPtr) { - return (unsigned) statPtr->st_dev; + return statPtr->st_dev; } unsigned Tcl_GetFSInodeFromStat( const Tcl_StatBuf *statPtr) { - return (unsigned) statPtr->st_ino; + return statPtr->st_ino; } unsigned Tcl_GetModeFromStat( const Tcl_StatBuf *statPtr) { - return (unsigned) statPtr->st_mode; + return statPtr->st_mode; } int @@ -2639,7 +2639,7 @@ Tcl_GetBlockSizeFromStat( const Tcl_StatBuf *statPtr) { #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - return (unsigned) statPtr->st_blksize; + return statPtr->st_blksize; #else /* * Not a great guess, but will do... diff --git a/generic/tclHash.c b/generic/tclHash.c index 32c9aec..f7f9b32 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -1015,8 +1015,8 @@ RebuildTable( tablePtr->numBuckets *= 4; if (typePtr->flags & TCL_HASH_KEY_SYSTEM_HASH) { - tablePtr->buckets = (Tcl_HashEntry **) TclpSysAlloc((unsigned) - (tablePtr->numBuckets * sizeof(Tcl_HashEntry *)), 0); + tablePtr->buckets = (Tcl_HashEntry **) TclpSysAlloc( + tablePtr->numBuckets * sizeof(Tcl_HashEntry *), 0); } else { tablePtr->buckets = ckalloc(tablePtr->numBuckets * sizeof(Tcl_HashEntry *)); diff --git a/generic/tclIO.c b/generic/tclIO.c index 7c93e1a..3879aa9 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -4320,7 +4320,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; } @@ -4408,7 +4408,7 @@ Write( */ saved = -SpaceLeft(bufPtr); - memcpy(safe, dst + dstLen, (size_t) saved); + memcpy(safe, dst + dstLen, saved); bufPtr->nextAdded = bufPtr->bufLength; } @@ -5086,7 +5086,7 @@ TclGetsObjBinary( rawLen = dstEnd - dst; byteArray = Tcl_SetByteArrayLength(objPtr, byteLen + rawLen); - memcpy(byteArray + byteLen, dst, (size_t) rawLen); + memcpy(byteArray + byteLen, dst, rawLen); byteLen += rawLen; } @@ -5103,7 +5103,7 @@ TclGetsObjBinary( rawLen = eol - dst; byteArray = Tcl_SetByteArrayLength(objPtr, byteLen + rawLen); - memcpy(byteArray + byteLen, dst, (size_t) rawLen); + memcpy(byteArray + byteLen, dst, rawLen); byteLen += rawLen; bufPtr->nextRemoved += rawLen + skip; @@ -5654,7 +5654,7 @@ Tcl_ReadRaw( * Copy the current chunk into the read buffer. */ - memcpy(readBuf, RemovePoint(bufPtr), (size_t) toCopy); + memcpy(readBuf, RemovePoint(bufPtr), toCopy); bufPtr->nextRemoved += toCopy; copied += toCopy; readBuf += toCopy; @@ -6402,7 +6402,7 @@ ReadChars( } nextPtr->nextRemoved -= srcLen; - memcpy(RemovePoint(nextPtr), src, (size_t) srcLen); + memcpy(RemovePoint(nextPtr), src, srcLen); RecycleBuffer(statePtr, bufPtr, 0); statePtr->inQueueHead = nextPtr; Tcl_SetObjLength(objPtr, numBytes); @@ -6508,7 +6508,7 @@ TranslateInputEOL( case TCL_TRANSLATE_LF: case TCL_TRANSLATE_CR: if (dstStart != srcStart) { - memcpy(dstStart, srcStart, (size_t) srcLen); + memcpy(dstStart, srcStart, srcLen); } if (statePtr->inputTranslation == TCL_TRANSLATE_CR) { char *dst = dstStart; @@ -6665,7 +6665,7 @@ Tcl_Ungets( statePtr->inputEncodingFlags &= ~TCL_ENCODING_END; bufPtr = AllocChannelBuffer(len); - memcpy(InsertPoint(bufPtr), str, (size_t) len); + memcpy(InsertPoint(bufPtr), str, len); bufPtr->nextAdded += len; if (statePtr->inQueueHead == NULL) { diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 1dd8666..271fc57 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -952,7 +952,7 @@ Tcl_ExecObjCmd( */ argc = objc - skip; - argv = TclStackAlloc(interp, (unsigned)(argc + 1) * sizeof(char *)); + argv = TclStackAlloc(interp, (argc + 1) * sizeof(char *)); /* * Copy the string conversions of each (post option) object into the diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 611ee3f..be82b48 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -1326,7 +1326,7 @@ ReflectInput( *errorCodePtr = EOK; if (bytec > 0) { - memcpy(buf, bytev, (size_t) bytec); + memcpy(buf, bytev, bytec); } stop: @@ -3008,7 +3008,7 @@ ForwardProc( paramPtr->input.toRead = -1; } else { if (bytec > 0) { - memcpy(paramPtr->input.buf, bytev, (size_t) bytec); + memcpy(paramPtr->input.buf, bytev, bytec); } paramPtr->input.toRead = bytec; } @@ -3298,7 +3298,7 @@ ForwardSetObjError( len++; ForwardSetDynamicError(paramPtr, ckalloc(len)); - memcpy(paramPtr->base.msgStr, msgStr, (unsigned) len); + memcpy(paramPtr->base.msgStr, msgStr, len); } #endif diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 4841e39..8e24cf7 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -2607,7 +2607,7 @@ ForwardProc( if (bytec > 0) { paramPtr->transform.buf = ckalloc(bytec); - memcpy(paramPtr->transform.buf, bytev, (size_t)bytec); + memcpy(paramPtr->transform.buf, bytev, bytec); } else { paramPtr->transform.buf = NULL; } @@ -2641,7 +2641,7 @@ ForwardProc( if (bytec > 0) { paramPtr->transform.buf = ckalloc(bytec); - memcpy(paramPtr->transform.buf, bytev, (size_t)bytec); + memcpy(paramPtr->transform.buf, bytev, bytec); } else { paramPtr->transform.buf = NULL; } @@ -2670,7 +2670,7 @@ ForwardProc( if (bytec > 0) { paramPtr->transform.buf = ckalloc(bytec); - memcpy(paramPtr->transform.buf, bytev, (size_t)bytec); + memcpy(paramPtr->transform.buf, bytev, bytec); } else { paramPtr->transform.buf = NULL; } @@ -2697,7 +2697,7 @@ ForwardProc( if (bytec > 0) { paramPtr->transform.buf = ckalloc(bytec); - memcpy(paramPtr->transform.buf, bytev, (size_t)bytec); + memcpy(paramPtr->transform.buf, bytev, bytec); } else { paramPtr->transform.buf = NULL; } @@ -2810,7 +2810,7 @@ ForwardSetObjError( len++; ForwardSetDynamicError(paramPtr, ckalloc(len)); - memcpy(paramPtr->base.msgStr, msgStr, (unsigned) len); + memcpy(paramPtr->base.msgStr, msgStr, len); } #endif /* TCL_THREADS */ diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 965ec24..e2be3aa 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -978,8 +978,7 @@ Tcl_WrongNumArgs( len = TclScanElement(elementStr, elemLen, &flags); if (MAY_QUOTE_WORD && len != elemLen) { - char *quotedElementStr = TclStackAlloc(interp, - (unsigned)len + 1); + char *quotedElementStr = TclStackAlloc(interp, len + 1); len = TclConvertElement(elementStr, elemLen, quotedElementStr, flags); @@ -1030,8 +1029,7 @@ Tcl_WrongNumArgs( len = TclScanElement(elementStr, elemLen, &flags); if (MAY_QUOTE_WORD && len != elemLen) { - char *quotedElementStr = TclStackAlloc(interp, - (unsigned) len + 1); + char *quotedElementStr = TclStackAlloc(interp, len + 1); len = TclConvertElement(elementStr, elemLen, quotedElementStr, flags); diff --git a/generic/tclInt.h b/generic/tclInt.h index b8bcbac..9861208 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4420,8 +4420,8 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, (objPtr)->bytes = &tclEmptyString; \ (objPtr)->length = 0; \ } else { \ - (objPtr)->bytes = (char *) ckalloc((unsigned) ((len) + 1)); \ - memcpy((objPtr)->bytes, (bytePtr) ? (bytePtr) : &tclEmptyString, (unsigned) (len)); \ + (objPtr)->bytes = (char *) ckalloc((len) + 1); \ + memcpy((objPtr)->bytes, (bytePtr) ? (bytePtr) : &tclEmptyString, (len)); \ (objPtr)->bytes[len] = '\0'; \ (objPtr)->length = (len); \ } @@ -4541,19 +4541,19 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, allocated = TCL_MAX_TOKENS; \ } \ newPtr = (Tcl_Token *) attemptckrealloc((char *) oldPtr, \ - (unsigned int) (allocated * sizeof(Tcl_Token))); \ + allocated * sizeof(Tcl_Token)); \ if (newPtr == NULL) { \ allocated = _needed + (append) + TCL_MIN_TOKEN_GROWTH; \ if (allocated > TCL_MAX_TOKENS) { \ allocated = TCL_MAX_TOKENS; \ } \ newPtr = (Tcl_Token *) ckrealloc((char *) oldPtr, \ - (unsigned int) (allocated * sizeof(Tcl_Token))); \ + allocated * sizeof(Tcl_Token)); \ } \ (available) = allocated; \ if (oldPtr == NULL) { \ memcpy(newPtr, staticPtr, \ - (size_t) ((used) * sizeof(Tcl_Token))); \ + (used) * sizeof(Tcl_Token)); \ } \ (tokenPtr) = newPtr; \ } \ diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 1863ea5..92c6159 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -1831,8 +1831,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 0) { - memcpy(elemPtrs, oldPtrs, (size_t) first * sizeof(Tcl_Obj *)); + memcpy(elemPtrs, oldPtrs, first * sizeof(Tcl_Obj *)); } /* diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 577c9e5..6df26bd 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -213,7 +213,7 @@ TclCreateLiteral( if ((objLength == length) && ((length == 0) || ((objBytes[0] == bytes[0]) - && (memcmp(objBytes, bytes, (unsigned) length) == 0)))) { + && (memcmp(objBytes, bytes, length) == 0)))) { /* * A literal was found: return it */ @@ -424,7 +424,7 @@ TclRegisterLiteral( objPtr = localPtr->objPtr; if ((objPtr->length == length) && ((length == 0) || ((objPtr->bytes[0] == bytes[0]) - && (memcmp(objPtr->bytes, bytes, (unsigned) length) == 0)))) { + && (memcmp(objPtr->bytes, bytes, length) == 0)))) { if ((flags & LITERAL_ON_HEAP)) { ckfree(bytes); } diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 77e6425..add4f6f 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -405,7 +405,7 @@ Tcl_LoadObjCmd( len = strlen(fullFileName) + 1; pkgPtr->fileName = ckalloc(len); memcpy(pkgPtr->fileName, fullFileName, len); - len = (unsigned) Tcl_DStringLength(&pkgName) + 1; + len = Tcl_DStringLength(&pkgName) + 1; pkgPtr->packageName = ckalloc(len); memcpy(pkgPtr->packageName, Tcl_DStringValue(&pkgName), len); pkgPtr->loadHandle = loadHandle; diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index de2222e..b553880 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -876,7 +876,7 @@ Tcl_CreateNamespace( name = Tcl_DStringValue(namePtr); nameLen = Tcl_DStringLength(namePtr); nsPtr->fullName = ckalloc(nameLen + 1); - memcpy(nsPtr->fullName, name, (unsigned) nameLen + 1); + memcpy(nsPtr->fullName, name, nameLen + 1); Tcl_DStringFree(&buffer1); Tcl_DStringFree(&buffer2); @@ -1462,7 +1462,7 @@ Tcl_Export( len = strlen(pattern); patternCpy = ckalloc(len + 1); - memcpy(patternCpy, pattern, (unsigned) len + 1); + memcpy(patternCpy, pattern, len + 1); nsPtr->exportArrayPtr[nsPtr->numExportPatterns] = patternCpy; nsPtr->numExportPatterns++; diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 908dd26..ace7fd7 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -631,7 +631,7 @@ SortMethodNames( if (i > 0) { if (i > 1) { - qsort((void *) strings, (unsigned) i, sizeof(char *), CmpStr); + qsort((void *) strings, i, sizeof(char *), CmpStr); } *stringsPtr = strings; } else { diff --git a/generic/tclParse.c b/generic/tclParse.c index a31d099..1eb4e6a 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -926,7 +926,7 @@ TclParseBackslash( } else { char utfBytes[TCL_UTF_MAX]; - memcpy(utfBytes, p, (size_t) (numBytes - 1)); + memcpy(utfBytes, p, numBytes - 1); utfBytes[numBytes - 1] = '\0'; count = TclUtfToUniChar(utfBytes, &unichar) + 1; } diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 0532b98..3703aaf 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -560,9 +560,7 @@ TclPathPart( Tcl_Obj *pathPtr, /* Path to take dirname of */ Tcl_PathPart portion) /* Requested portion of name */ { - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); - - if (irPtr) { + if (TclHasIntRep(pathPtr, &fsPathType)) { FsPath *fsPathPtr = PATHOBJ(pathPtr); if (PATHFLAGS(pathPtr) != 0) { @@ -1158,8 +1156,6 @@ Tcl_FSConvertToPathType( Tcl_Obj *pathPtr) /* Object to convert to a valid, current path * type. */ { - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); - /* * While it is bad practice to examine an object's type directly, this is * actually the best thing to do here. The reason is that if we are @@ -1170,7 +1166,7 @@ Tcl_FSConvertToPathType( * path. */ - if (irPtr) { + if (TclHasIntRep(pathPtr, &fsPathType)) { if (TclFSEpochOk(PATHOBJ(pathPtr)->filesystemEpoch)) { return TCL_OK; } @@ -1481,9 +1477,8 @@ MakePathFromNormalized( Tcl_Obj *pathPtr) /* The object to convert. */ { FsPath *fsPathPtr; - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); - if (irPtr) { + if (TclHasIntRep(pathPtr, &fsPathType)) { return TCL_OK; } @@ -1684,7 +1679,7 @@ Tcl_FSGetTranslatedStringPath( const char *orig = TclGetStringFromObj(transPtr, &len); char *result = ckalloc(len+1); - memcpy(result, orig, (size_t) len+1); + memcpy(result, orig, len+1); TclDecrRefCount(transPtr); return result; } @@ -2087,9 +2082,8 @@ TclFSEnsureEpochOk( const Tcl_Filesystem **fsPtrPtr) { FsPath *srcFsPathPtr; - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); - if (irPtr == NULL) { + if (!TclHasIntRep(pathPtr, &fsPathType)) { return TCL_OK; } @@ -2146,13 +2140,12 @@ TclFSSetPathDetails( ClientData clientData) { FsPath *srcFsPathPtr; - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);; /* * Make sure pathPtr is of the correct type. */ - if (irPtr == NULL) { + if (!TclHasIntRep(pathPtr, &fsPathType)) { if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) { return; } @@ -2250,9 +2243,8 @@ SetFsPathFromAny( FsPath *fsPathPtr; Tcl_Obj *transPtr; char *name; - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); - if (irPtr) { + if (TclHasIntRep(pathPtr, &fsPathType)) { return TCL_OK; } @@ -2558,8 +2550,6 @@ TclNativePathInFilesystem( Tcl_Obj *pathPtr, ClientData *clientDataPtr) { - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); - /* * A special case is required to handle the empty path "". This is a valid * path (i.e. the user should be able to do 'file exists ""' without @@ -2567,7 +2557,7 @@ TclNativePathInFilesystem( * semantics of Tcl (at present anyway), so we have to abide by them here. */ - if (irPtr) { + if (TclHasIntRep(pathPtr, &fsPathType)) { if (pathPtr->bytes != NULL && pathPtr->bytes[0] == '\0') { /* * We reject the empty path "". diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 2c16458..5e7d8b2 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -1112,7 +1112,7 @@ TclNRPackageObjCmd( if (availPtr == NULL) { availPtr = ckalloc(sizeof(PkgAvail)); availPtr->pkgIndex = NULL; - DupBlock(availPtr->version, argv3, (unsigned) length + 1); + DupBlock(availPtr->version, argv3, length + 1); if (prevPtr == NULL) { availPtr->nextPtr = pkgPtr->availPtr; @@ -1124,10 +1124,10 @@ TclNRPackageObjCmd( } if (iPtr->scriptFile) { argv4 = TclGetStringFromObj(iPtr->scriptFile, &length); - DupBlock(availPtr->pkgIndex, argv4, (unsigned) length + 1); + DupBlock(availPtr->pkgIndex, argv4, length + 1); } argv4 = TclGetStringFromObj(objv[4], &length); - DupBlock(availPtr->script, argv4, (unsigned) length + 1); + DupBlock(availPtr->script, argv4, length + 1); break; } case PKG_NAMES: @@ -1301,7 +1301,7 @@ TclNRPackageObjCmd( if (argv2[0] == 0) { iPtr->packageUnknown = NULL; } else { - DupBlock(iPtr->packageUnknown, argv2, (unsigned) length+1); + DupBlock(iPtr->packageUnknown, argv2, length+1); } } else { Tcl_WrongNumArgs(interp, 2, objv, "?command?"); diff --git a/generic/tclProc.c b/generic/tclProc.c index b44e54d..f24dae8 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -329,7 +329,7 @@ Tcl_ProcObjCmd( * of all procs whose argument list is just _args_ */ - if (TclFetchIntRep(objv[3], &tclProcBodyType)) { + if (TclHasIntRep(objv[3], &tclProcBodyType)) { goto done; } diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index ce53ced..804b117 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -998,7 +998,7 @@ CompileRegexp( tsdPtr->regexps[i+1] = tsdPtr->regexps[i]; } tsdPtr->patterns[0] = ckalloc(length + 1); - memcpy(tsdPtr->patterns[0], string, (unsigned) length + 1); + memcpy(tsdPtr->patterns[0], string, length + 1); tsdPtr->patLengths[0] = length; tsdPtr->regexps[0] = regexpPtr; diff --git a/generic/tclResult.c b/generic/tclResult.c index a5ec4be..5a03421 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -438,7 +438,7 @@ Tcl_SetResult( iPtr->result = iPtr->resultSpace; iPtr->freeProc = 0; } - memcpy(iPtr->result, result, (unsigned) length+1); + memcpy(iPtr->result, result, length+1); } else { iPtr->result = (char *) result; iPtr->freeProc = freeProc; diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index b6fa5fa..74ce2b5 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -3227,7 +3227,7 @@ TclStringCat( if (TclIsPureByteArray(objPtr)) { int more; unsigned char *src = Tcl_GetByteArrayFromObj(objPtr, &more); - memcpy(dst, src, (size_t) more); + memcpy(dst, src, more); dst += more; } } @@ -3326,7 +3326,7 @@ TclStringCat( int more; char *src = Tcl_GetStringFromObj(objPtr, &more); - memcpy(dst, src, (size_t) more); + memcpy(dst, src, more); dst += more; } } diff --git a/generic/tclThread.c b/generic/tclThread.c index cafd824..661ac2f 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -73,13 +73,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/tclTimer.c b/generic/tclTimer.c index ccfd179..15c87b5 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -900,7 +900,7 @@ Tcl_AfterObjCmd( tempCommand = TclGetStringFromObj(afterPtr->commandPtr, &tempLength); if ((length == tempLength) - && !memcmp(command, tempCommand, (unsigned) length)) { + && !memcmp(command, tempCommand, length)) { break; } } diff --git a/generic/tclTrace.c b/generic/tclTrace.c index db48f7a..20fa7e7 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'; /* @@ -2275,7 +2275,7 @@ StringTraceProc( */ argv = (const char **) TclStackAlloc(interp, - (unsigned) ((objc + 1) * sizeof(const char *))); + (objc + 1) * sizeof(const char *)); for (i = 0; i < objc; i++) { argv[i] = Tcl_GetString(objv[i]); } diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 10e78bd..8808bc0 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -921,7 +921,7 @@ Tcl_UtfToUpper( */ if ((bytes < TclUtfCount(upChar)) || ((upChar & 0xF800) == 0xD800)) { - memcpy(dst, src, (size_t) bytes); + memcpy(dst, src, bytes); dst += bytes; } else { dst += Tcl_UniCharToUtf(upChar, dst); @@ -984,7 +984,7 @@ Tcl_UtfToLower( */ if ((bytes < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) { - memcpy(dst, src, (size_t) bytes); + memcpy(dst, src, bytes); dst += bytes; } else { dst += Tcl_UniCharToUtf(lowChar, dst); @@ -1044,7 +1044,7 @@ Tcl_UtfToTitle( titleChar = Tcl_UniCharToTitle(titleChar); if ((bytes < TclUtfCount(titleChar)) || ((titleChar & 0xF800) == 0xD800)) { - memcpy(dst, src, (size_t) bytes); + memcpy(dst, src, bytes); dst += bytes; } else { dst += Tcl_UniCharToUtf(titleChar, dst); @@ -1068,7 +1068,7 @@ Tcl_UtfToTitle( } if ((bytes < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) { - memcpy(dst, src, (size_t) bytes); + memcpy(dst, src, bytes); dst += bytes; } else { dst += Tcl_UniCharToUtf(lowChar, dst); diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 3d4298e..120f315 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -905,7 +905,7 @@ Tcl_SplitList( } argv[i] = p; if (literal) { - memcpy(p, element, (size_t) elSize); + memcpy(p, element, elSize); p += elSize; *p = 0; p++; @@ -2049,7 +2049,7 @@ Tcl_Concat( if (needSpace) { *p++ = ' '; } - memcpy(p, element, (size_t) elemLength); + memcpy(p, element, elemLength); p += elemLength; needSpace = 1; } @@ -2751,7 +2751,7 @@ Tcl_DStringAppend( if (dsPtr->string == dsPtr->staticSpace) { char *newString = ckalloc(dsPtr->spaceAvl); - memcpy(newString, dsPtr->string, (size_t) dsPtr->length); + memcpy(newString, dsPtr->string, dsPtr->length); dsPtr->string = newString; } else { int offset = -1; @@ -2854,7 +2854,7 @@ Tcl_DStringAppendElement( if (dsPtr->string == dsPtr->staticSpace) { char *newString = ckalloc(dsPtr->spaceAvl); - memcpy(newString, dsPtr->string, (size_t) dsPtr->length); + memcpy(newString, dsPtr->string, dsPtr->length); dsPtr->string = newString; } else { int offset = -1; @@ -2948,7 +2948,7 @@ Tcl_DStringSetLength( if (dsPtr->string == dsPtr->staticSpace) { char *newString = ckalloc(dsPtr->spaceAvl); - memcpy(newString, dsPtr->string, (size_t) dsPtr->length); + memcpy(newString, dsPtr->string, dsPtr->length); dsPtr->string = newString; } else { dsPtr->string = ckrealloc(dsPtr->string, dsPtr->spaceAvl); diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index f09a441..ab9b74f 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -654,7 +654,7 @@ SetOSTypeFromAny( OSType osType; char bytes[4] = {'\0','\0','\0','\0'}; - memcpy(bytes, Tcl_DStringValue(&ds), (size_t)Tcl_DStringLength(&ds)); + memcpy(bytes, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); osType = (OSType) bytes[0] << 24 | (OSType) bytes[1] << 16 | (OSType) bytes[2] << 8 | diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 8cb93b4..bf033d2 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -1117,7 +1117,7 @@ TclNativeCreateNativeRep( } Tcl_DecrRefCount(validPathPtr); nativePathPtr = ckalloc(len); - memcpy(nativePathPtr, Tcl_DStringValue(&ds), (size_t) len); + memcpy(nativePathPtr, Tcl_DStringValue(&ds), len); Tcl_DStringFree(&ds); return nativePathPtr; diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index bd54a2e..62e4756 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -241,7 +241,7 @@ InitializeHostName( if (dot != NULL) { char *node = ckalloc(dot - u.nodename + 1); - memcpy(node, u.nodename, (size_t) (dot - u.nodename)); + memcpy(node, u.nodename, dot - u.nodename); node[dot - u.nodename] = '\0'; hp = TclpGetHostByName(node); ckfree(node); diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index f8b67a3..5f23cca 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -660,11 +660,11 @@ ConsoleInputProc( */ if (bufSize < (infoPtr->bytesRead - infoPtr->offset)) { - memcpy(buf, &infoPtr->buffer[infoPtr->offset], (size_t) bufSize); + memcpy(buf, &infoPtr->buffer[infoPtr->offset], bufSize); bytesRead = bufSize; infoPtr->offset += bufSize; } else { - memcpy(buf, &infoPtr->buffer[infoPtr->offset], (size_t) bufSize); + memcpy(buf, &infoPtr->buffer[infoPtr->offset], bufSize); bytesRead = infoPtr->bytesRead - infoPtr->offset; /* @@ -771,7 +771,7 @@ ConsoleOutputProc( infoPtr->writeBufLen = toWrite; infoPtr->writeBuf = ckalloc(toWrite); } - memcpy(infoPtr->writeBuf, buf, (size_t) toWrite); + memcpy(infoPtr->writeBuf, buf, toWrite); infoPtr->toWrite = toWrite; ResetEvent(threadInfo->readyEvent); TclPipeThreadSignal(&threadInfo->TI); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 2ce19ce..d780660 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -269,7 +269,7 @@ AppendEnvironment( for (shortlib = (char *) &lib[strlen(lib)-1]; shortlib>lib ; shortlib--) { if (*shortlib == '/') { - if ((unsigned)(shortlib - lib) == strlen(lib) - 1) { + if ((size_t)(shortlib - lib) == strlen(lib) - 1) { Tcl_Panic("last character in lib cannot be '/'"); } shortlib++; @@ -637,7 +637,7 @@ TclpFindVariable( length = strlen(name); nameUpper = ckalloc(length + 1); - memcpy(nameUpper, name, (size_t) length+1); + memcpy(nameUpper, name, length+1); Tcl_UtfToUpper(nameUpper); Tcl_DStringInit(&envString); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 83987d6..86b98f7 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -2214,7 +2214,7 @@ PipeOutputProc( infoPtr->writeBufLen = toWrite; infoPtr->writeBuf = ckalloc(toWrite); } - memcpy(infoPtr->writeBuf, buf, (size_t) toWrite); + memcpy(infoPtr->writeBuf, buf, toWrite); infoPtr->toWrite = toWrite; ResetEvent(infoPtr->writable); TclPipeThreadSignal(&infoPtr->writeTI); -- cgit v0.12