From 5f7628019d2481e58ddee7d42ade95085cf69687 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Mar 2022 23:09:03 +0000 Subject: Further , --- generic/tclCompile.c | 8 ++++---- generic/tclCompile.h | 4 ++-- generic/tclDisassemble.c | 14 +++++++------- generic/tclExecute.c | 6 +++--- generic/tclInt.h | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/generic/tclCompile.c b/generic/tclCompile.c index bcd8026..e23b0e6 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1036,7 +1036,7 @@ CleanupByteCode( statsPtr = &iPtr->stats; statsPtr->numByteCodesFreed++; - statsPtr->currentSrcBytes -= (double) codePtr->numSrcBytes; + statsPtr->currentSrcBytes -= (double) (int)codePtr->numSrcBytes; statsPtr->currentByteCodeBytes -= (double) codePtr->structureSize; statsPtr->currentInstBytes -= (double) codePtr->numCodeBytes; @@ -4527,12 +4527,12 @@ RecordByteCodeStats( statsPtr = &(iPtr->stats); statsPtr->numCompilations++; - statsPtr->totalSrcBytes += (double) codePtr->numSrcBytes; + statsPtr->totalSrcBytes += (double) (int)codePtr->numSrcBytes; statsPtr->totalByteCodeBytes += (double) codePtr->structureSize; - statsPtr->currentSrcBytes += (double) codePtr->numSrcBytes; + statsPtr->currentSrcBytes += (double) (int)codePtr->numSrcBytes; statsPtr->currentByteCodeBytes += (double) codePtr->structureSize; - statsPtr->srcCount[TclLog2(codePtr->numSrcBytes)]++; + statsPtr->srcCount[TclLog2((int)codePtr->numSrcBytes)]++; statsPtr->byteCodeCount[TclLog2((int) codePtr->structureSize)]++; statsPtr->currentInstBytes += (double) codePtr->numCodeBytes; diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 439122b..669e11d 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -459,8 +459,8 @@ typedef struct ByteCode { * itself. Does not include heap space for * literal Tcl objects or storage referenced * by AuxData entries. */ - int numCommands; /* Number of commands compiled. */ - int numSrcBytes; /* Number of source bytes compiled. */ + size_t numCommands; /* Number of commands compiled. */ + size_t numSrcBytes; /* Number of source bytes compiled. */ int numCodeBytes; /* Number of code bytes. */ int numLitObjects; /* Number of objects in literal array. */ int numExceptRanges; /* Number of ExceptionRange array elems. */ diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index f0dd908..a8a9606 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -270,7 +270,7 @@ DisassembleByteCodeObj( codeStart = codePtr->codeStart; codeLimit = codeStart + codePtr->numCodeBytes; - numCmds = codePtr->numCommands; + numCmds = (int)codePtr->numCommands; /* * Print header lines describing the ByteCode. @@ -281,7 +281,7 @@ DisassembleByteCodeObj( codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr, iPtr->compileEpoch); Tcl_AppendToObj(bufferObj, " Source ", -1); PrintSourceToObj(bufferObj, codePtr->source, - TclMin(codePtr->numSrcBytes, 55)); + TclMin((int)codePtr->numSrcBytes, 55)); GetLocationInformation(codePtr->procPtr, &fileObj, &line); if (line >= 0 && fileObj != NULL) { Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d", @@ -289,12 +289,12 @@ DisassembleByteCodeObj( } Tcl_AppendPrintfToObj(bufferObj, "\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", - numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes, + numCmds, (int)codePtr->numSrcBytes, codePtr->numCodeBytes, codePtr->numLitObjects, codePtr->numAuxDataItems, codePtr->maxStackDepth, #ifdef TCL_COMPILE_STATS - codePtr->numSrcBytes? - codePtr->structureSize/(float)codePtr->numSrcBytes : + (int)codePtr->numSrcBytes? + codePtr->structureSize/(float)(int)codePtr->numSrcBytes : #endif 0.0); @@ -1178,7 +1178,7 @@ DisassembleByteCodeAsDicts( srcOffPtr = codePtr->srcDeltaStart; srcLenPtr = codePtr->srcLengthStart; codeOffset = sourceOffset = 0; - for (i=0 ; inumCommands ; i++) { + for (i=0 ; i<(int)codePtr->numCommands ; i++) { Tcl_Obj *cmd; codeOffset += Decode(codeOffPtr); @@ -1232,7 +1232,7 @@ DisassembleByteCodeAsDicts( Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("commands", -1), commands); Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("script", -1), - Tcl_NewStringObj(codePtr->source, codePtr->numSrcBytes)); + Tcl_NewStringObj(codePtr->source, (int)codePtr->numSrcBytes)); Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("namespace", -1), Tcl_NewStringObj(codePtr->nsPtr->fullName, -1)); Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("stackdepth", -1), diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 2db63da..56dbc0d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -8682,12 +8682,12 @@ PrintByteCodeInfo( TclPrintSource(stdout, codePtr->source, 60); fprintf(stdout, "\n Cmds %d, src %d, inst %u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", - codePtr->numCommands, codePtr->numSrcBytes, + (int)codePtr->numCommands, (int)codePtr->numSrcBytes, codePtr->numCodeBytes, codePtr->numLitObjects, codePtr->numAuxDataItems, codePtr->maxStackDepth, #ifdef TCL_COMPILE_STATS - codePtr->numSrcBytes? - ((float)codePtr->structureSize)/codePtr->numSrcBytes : + (int)codePtr->numSrcBytes? + ((float)codePtr->structureSize)/(int)codePtr->numSrcBytes : #endif 0.0); diff --git a/generic/tclInt.h b/generic/tclInt.h index 10b4137..99f80c2 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4652,7 +4652,7 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[]; * of counting along a string of all one-byte characters. The ANSI C * "prototype" for this macro is: * - * MODULE_SCOPE void TclNumUtfChars(int numChars, const char *bytes, + * MODULE_SCOPE void TclNumUtfChars(size_t numChars, const char *bytes, * size_t numBytes); *---------------------------------------------------------------- */ -- cgit v0.12