diff options
-rw-r--r-- | generic/tclAssembly.c | 60 | ||||
-rw-r--r-- | generic/tclCompCmds.c | 78 | ||||
-rw-r--r-- | generic/tclCompCmdsGR.c | 100 | ||||
-rw-r--r-- | generic/tclCompCmdsSZ.c | 104 | ||||
-rw-r--r-- | generic/tclCompile.c | 40 | ||||
-rw-r--r-- | generic/tclCompile.h | 16 | ||||
-rw-r--r-- | generic/tclDisassemble.c | 12 | ||||
-rw-r--r-- | generic/tclEnsemble.c | 24 | ||||
-rw-r--r-- | generic/tclExecute.c | 14 |
9 files changed, 224 insertions, 224 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index b8a4606..3351104 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -1074,7 +1074,7 @@ TclAssembleCode( * Process the line of code. */ - if ((int)parsePtr->numWords > 0) { + if (parsePtr->numWords + 1 > 1) { size_t instLen = (int)parsePtr->commandSize; /* Length in bytes of the current command */ @@ -1304,7 +1304,7 @@ AssembleOneLine( switch (instType) { case ASSEM_PUSH: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "value"); goto cleanup; } @@ -1317,7 +1317,7 @@ AssembleOneLine( break; case ASSEM_1BYTE: - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { Tcl_WrongNumArgs(interp, 1, &instNameObj, ""); goto cleanup; } @@ -1332,7 +1332,7 @@ AssembleOneLine( * are being resolved. */ - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "label"); goto cleanup; } @@ -1347,7 +1347,7 @@ AssembleOneLine( break; case ASSEM_BOOL: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "boolean"); goto cleanup; } @@ -1358,7 +1358,7 @@ AssembleOneLine( break; case ASSEM_BOOL_LVT4: - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "boolean varName"); goto cleanup; } @@ -1374,7 +1374,7 @@ AssembleOneLine( break; case ASSEM_CLOCK_READ: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "imm8"); goto cleanup; } @@ -1391,7 +1391,7 @@ AssembleOneLine( break; case ASSEM_CONCAT1: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "imm8"); goto cleanup; } @@ -1405,7 +1405,7 @@ AssembleOneLine( case ASSEM_DICT_GET: case ASSEM_DICT_GET_DEF: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1417,7 +1417,7 @@ AssembleOneLine( break; case ASSEM_DICT_SET: - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count varName"); goto cleanup; } @@ -1434,7 +1434,7 @@ AssembleOneLine( break; case ASSEM_DICT_UNSET: - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count varName"); goto cleanup; } @@ -1451,7 +1451,7 @@ AssembleOneLine( break; case ASSEM_END_CATCH: - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { Tcl_WrongNumArgs(interp, 1, &instNameObj, ""); goto cleanup; } @@ -1465,7 +1465,7 @@ AssembleOneLine( * code, the message ("script" or "expression") and an evaluator * callback that calls TclCompileScript or TclCompileExpr. */ - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, ((TalInstructionTable[tblIdx].tclInstCode == INST_EVAL_STK) ? "script" : "expression")); @@ -1491,7 +1491,7 @@ AssembleOneLine( break; case ASSEM_INVOKE: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1505,7 +1505,7 @@ AssembleOneLine( case ASSEM_JUMP: case ASSEM_JUMP4: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "label"); goto cleanup; } @@ -1533,7 +1533,7 @@ AssembleOneLine( break; case ASSEM_JUMPTABLE: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "table"); goto cleanup; } @@ -1561,7 +1561,7 @@ AssembleOneLine( break; case ASSEM_LABEL: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "name"); goto cleanup; } @@ -1579,7 +1579,7 @@ AssembleOneLine( break; case ASSEM_LINDEX_MULTI: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1591,7 +1591,7 @@ AssembleOneLine( break; case ASSEM_LIST: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1603,7 +1603,7 @@ AssembleOneLine( break; case ASSEM_INDEX: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1614,7 +1614,7 @@ AssembleOneLine( break; case ASSEM_LSET_FLAT: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1633,7 +1633,7 @@ AssembleOneLine( break; case ASSEM_LVT: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "varname"); goto cleanup; } @@ -1645,7 +1645,7 @@ AssembleOneLine( break; case ASSEM_LVT1: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "varname"); goto cleanup; } @@ -1657,7 +1657,7 @@ AssembleOneLine( break; case ASSEM_LVT1_SINT1: - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "varName imm8"); goto cleanup; } @@ -1672,7 +1672,7 @@ AssembleOneLine( break; case ASSEM_LVT4: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "varname"); goto cleanup; } @@ -1684,7 +1684,7 @@ AssembleOneLine( break; case ASSEM_OVER: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1696,7 +1696,7 @@ AssembleOneLine( break; case ASSEM_REGEXP: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "boolean"); goto cleanup; } @@ -1709,7 +1709,7 @@ AssembleOneLine( break; case ASSEM_REVERSE: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count"); goto cleanup; } @@ -1721,7 +1721,7 @@ AssembleOneLine( break; case ASSEM_SINT1: - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "imm8"); goto cleanup; } @@ -1733,7 +1733,7 @@ AssembleOneLine( break; case ASSEM_SINT4_LVT4: - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { Tcl_WrongNumArgs(interp, 1, &instNameObj, "count varName"); goto cleanup; } diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index c9a5724..1da0b90 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -255,7 +255,7 @@ TclCompileArrayExistsCmd( Tcl_Token *tokenPtr; int isScalar, localIndex; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } @@ -293,7 +293,7 @@ TclCompileArraySetCmd( Tcl_Obj *literalObj; ForeachInfo *infoPtr; - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -461,7 +461,7 @@ TclCompileArrayUnsetCmd( Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); int isScalar, localIndex; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr); } @@ -519,7 +519,7 @@ TclCompileBreakCmd( ExceptionRange *rangePtr; ExceptionAux *auxPtr; - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -584,7 +584,7 @@ TclCompileCatchCmd( * Let runtime checks determine if syntax has changed. */ - if (((int)parsePtr->numWords < 2) || ((int)parsePtr->numWords > 4)) { + if ((parsePtr->numWords < 2) || (parsePtr->numWords > 4)) { return TCL_ERROR; } @@ -613,7 +613,7 @@ TclCompileCatchCmd( } /* DKF */ - if ((int)parsePtr->numWords == 4) { + if (parsePtr->numWords == 4) { optsNameTokenPtr = TokenAfter(resultNameTokenPtr); optsIndex = LocalScalarFromToken(optsNameTokenPtr, envPtr); if (optsIndex < 0) { @@ -687,7 +687,7 @@ TclCompileCatchCmd( /* Stack at this point on both branches: result returnCode */ if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) { - Tcl_Panic("TclCompileCatchCmd: bad jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileCatchCmd: bad jump distance %" TCL_Z_MODIFIER "u", (CurrentOffset(envPtr) - jumpFixup.codeOffset)); } @@ -821,7 +821,7 @@ TclCompileClockReadingCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -862,7 +862,7 @@ TclCompileConcatCmd( int i; /* TODO: Consider compiling expansion case. */ - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { /* * [concat] without arguments just pushes an empty object. */ @@ -949,7 +949,7 @@ TclCompileContinueCmd( * There should be no argument after the "continue". */ - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -1043,7 +1043,7 @@ TclCompileDictSetCmd( * Now emit the instruction to do the dict manipulation. */ - TclEmitInstInt4( INST_DICT_SET, (int)parsePtr->numWords-3, envPtr); + TclEmitInstInt4( INST_DICT_SET, parsePtr->numWords-3, envPtr); TclEmitInt4( dictVarIndex, envPtr); TclAdjustStackDepth(-1, envPtr); return TCL_OK; @@ -1066,7 +1066,7 @@ TclCompileDictIncrCmd( * There must be at least two arguments after the command. */ - if ((int)parsePtr->numWords < 3 || (int)parsePtr->numWords > 4) { + if (parsePtr->numWords < 3 || parsePtr->numWords > 4) { return TCL_ERROR; } varTokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -1076,7 +1076,7 @@ TclCompileDictIncrCmd( * Parse the increment amount, if present. */ - if ((int)parsePtr->numWords == 4) { + if (parsePtr->numWords == 4) { const char *word; size_t numBytes; int code; @@ -1153,7 +1153,7 @@ TclCompileDictGetCmd( CompileWord(envPtr, tokenPtr, interp, i); tokenPtr = TokenAfter(tokenPtr); } - TclEmitInstInt4(INST_DICT_GET, (int)parsePtr->numWords-2, envPtr); + TclEmitInstInt4(INST_DICT_GET, parsePtr->numWords-2, envPtr); TclAdjustStackDepth(-1, envPtr); return TCL_OK; } @@ -1184,7 +1184,7 @@ TclCompileDictGetWithDefaultCmd( CompileWord(envPtr, tokenPtr, interp, i); tokenPtr = TokenAfter(tokenPtr); } - TclEmitInstInt4(INST_DICT_GET_DEF, (int)parsePtr->numWords-3, envPtr); + TclEmitInstInt4(INST_DICT_GET_DEF, parsePtr->numWords-3, envPtr); TclAdjustStackDepth(-2, envPtr); return TCL_OK; } @@ -1220,7 +1220,7 @@ TclCompileDictExistsCmd( CompileWord(envPtr, tokenPtr, interp, i); tokenPtr = TokenAfter(tokenPtr); } - TclEmitInstInt4(INST_DICT_EXISTS, (int)parsePtr->numWords-2, envPtr); + TclEmitInstInt4(INST_DICT_EXISTS, parsePtr->numWords-2, envPtr); TclAdjustStackDepth(-1, envPtr); return TCL_OK; } @@ -1273,7 +1273,7 @@ TclCompileDictUnsetCmd( * Now emit the instruction to do the dict manipulation. */ - TclEmitInstInt4( INST_DICT_UNSET, (int)parsePtr->numWords-2, envPtr); + TclEmitInstInt4( INST_DICT_UNSET, parsePtr->numWords-2, envPtr); TclEmitInt4( dictVarIndex, envPtr); return TCL_OK; } @@ -1295,7 +1295,7 @@ TclCompileDictCreateCmd( int i; size_t len; - if (((int)parsePtr->numWords & 1) == 0) { + if ((parsePtr->numWords & 1) == 0) { return TCL_ERROR; } @@ -1394,7 +1394,7 @@ TclCompileDictMergeCmd( if ((int)parsePtr->numWords < 2) { PushStringLiteral(envPtr, ""); return TCL_OK; - } else if ((int)parsePtr->numWords == 2) { + } else if (parsePtr->numWords == 2) { tokenPtr = TokenAfter(parsePtr->tokenPtr); CompileWord(envPtr, tokenPtr, interp, 1); TclEmitOpcode( INST_DUP, envPtr); @@ -1539,7 +1539,7 @@ CompileDictEachCmd( * There must be three arguments after the command. */ - if ((int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 4) { return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr); } @@ -1770,10 +1770,10 @@ TclCompileDictUpdateCmd( * dict update <lit(eral)> <any> <lit> ?<any> <lit> ...? <lit> */ - if (((int)parsePtr->numWords - 1) & 1) { + if ((parsePtr->numWords - 1) & 1) { return TCL_ERROR; } - numVars = ((int)parsePtr->numWords - 3) / 2; + numVars = (parsePtr->numWords - 3) / 2; /* * The dictionary variable must be a local scalar that is knowable at @@ -1840,7 +1840,7 @@ TclCompileDictUpdateCmd( TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr); ExceptionRangeStarts(envPtr, range); - BODY(bodyTokenPtr, (int)parsePtr->numWords - 1); + BODY(bodyTokenPtr, parsePtr->numWords - 1); ExceptionRangeEnds(envPtr, range); /* @@ -1876,7 +1876,7 @@ TclCompileDictUpdateCmd( TclEmitInvoke(envPtr,INST_RETURN_STK); if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) { - Tcl_Panic("TclCompileDictCmd(update): bad jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileDictCmd(update): bad jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - jumpFixup.codeOffset); } TclStackFree(interp, keyTokenPtrs); @@ -1937,7 +1937,7 @@ TclCompileDictAppendCmd( tokenPtr = TokenAfter(tokenPtr); } if ((int)parsePtr->numWords > 4) { - TclEmitInstInt1(INST_STR_CONCAT1, (int)parsePtr->numWords-3, envPtr); + TclEmitInstInt1(INST_STR_CONCAT1, parsePtr->numWords-3, envPtr); } /* @@ -1967,7 +1967,7 @@ TclCompileDictLappendCmd( /* TODO: Consider support for compiling expanded args. */ /* Probably not. Why is INST_DICT_LAPPEND limited to one value? */ - if ((int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 4) { return TCL_ERROR; } @@ -2076,7 +2076,7 @@ TclCompileDictWithCmd( CompileWord(envPtr, tokenPtr, interp, i); tokenPtr = TokenAfter(tokenPtr); } - TclEmitInstInt4(INST_LIST, (int)parsePtr->numWords-3,envPtr); + TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr); Emit14Inst( INST_LOAD_SCALAR, dictVar, envPtr); TclEmitInstInt4(INST_OVER, 1, envPtr); TclEmitOpcode( INST_DICT_EXPAND, envPtr); @@ -2103,7 +2103,7 @@ TclCompileDictWithCmd( CompileWord(envPtr, tokenPtr, interp, i); tokenPtr = TokenAfter(tokenPtr); } - TclEmitInstInt4(INST_LIST, (int)parsePtr->numWords-3,envPtr); + TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr); TclEmitInstInt4(INST_OVER, 1, envPtr); TclEmitOpcode( INST_LOAD_STK, envPtr); TclEmitInstInt4(INST_OVER, 1, envPtr); @@ -2158,7 +2158,7 @@ TclCompileDictWithCmd( CompileWord(envPtr, tokenPtr, interp, i); tokenPtr = TokenAfter(tokenPtr); } - TclEmitInstInt4( INST_LIST, (int)parsePtr->numWords-3,envPtr); + TclEmitInstInt4( INST_LIST, parsePtr->numWords-3,envPtr); Emit14Inst( INST_STORE_SCALAR, pathTmp, envPtr); TclEmitOpcode( INST_POP, envPtr); } @@ -2184,7 +2184,7 @@ TclCompileDictWithCmd( TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr); ExceptionRangeStarts(envPtr, range); - BODY(tokenPtr, (int)parsePtr->numWords - 1); + BODY(tokenPtr, parsePtr->numWords - 1); ExceptionRangeEnds(envPtr, range); /* @@ -2238,7 +2238,7 @@ TclCompileDictWithCmd( */ if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) { - Tcl_Panic("TclCompileDictCmd(update): bad jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileDictCmd(update): bad jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - jumpFixup.codeOffset); } return TCL_OK; @@ -2374,13 +2374,13 @@ TclCompileErrorCmd( * Construct the options. Note that -code and -level are not here. */ - if ((int)parsePtr->numWords == 2) { + if (parsePtr->numWords == 2) { PushStringLiteral(envPtr, ""); } else { PushStringLiteral(envPtr, "-errorinfo"); tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 2); - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { TclEmitInstInt4( INST_LIST, 2, envPtr); } else { PushStringLiteral(envPtr, "-errorcode"); @@ -2427,7 +2427,7 @@ TclCompileExprCmd( { Tcl_Token *firstWordPtr; - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { return TCL_ERROR; } @@ -2439,7 +2439,7 @@ TclCompileExprCmd( envPtr->extCmdMapPtr->nuloc-1].line[1]; firstWordPtr = TokenAfter(parsePtr->tokenPtr); - TclCompileExprWords(interp, firstWordPtr, (int)parsePtr->numWords-1, envPtr); + TclCompileExprWords(interp, firstWordPtr, parsePtr->numWords-1, envPtr); return TCL_OK; } @@ -2475,7 +2475,7 @@ TclCompileForCmd( int bodyCodeOffset, nextCodeOffset, jumpDist; int bodyRange, nextRange; - if ((int)parsePtr->numWords != 5) { + if (parsePtr->numWords != 5) { return TCL_ERROR; } @@ -2702,7 +2702,7 @@ CompileEachloopCmd( return TCL_ERROR; } - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if ((numWords < 4) || (numWords%2 != 0)) { return TCL_ERROR; } @@ -3179,7 +3179,7 @@ TclCompileFormatCmd( return TCL_ERROR; } - objv = (Tcl_Obj **)Tcl_Alloc(((int)parsePtr->numWords-2) * sizeof(Tcl_Obj *)); + objv = (Tcl_Obj **)Tcl_Alloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *)); for (i=0 ; i+2 < (int)parsePtr->numWords ; i++) { tokenPtr = TokenAfter(tokenPtr); TclNewObj(objv[i]); @@ -3195,7 +3195,7 @@ TclCompileFormatCmd( */ tmpObj = Tcl_Format(interp, TclGetString(formatObj), - (int)parsePtr->numWords-2, objv); + parsePtr->numWords-2, objv); for (; --i>=0 ;) { Tcl_DecrRefCount(objv[i]); } diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index 6486b21..133e58f 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -95,7 +95,7 @@ TclCompileGlobalCmd( int localIndex, numWords, i; /* TODO: Consider support for compiling expanded args. */ - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if (numWords < 2) { return TCL_ERROR; } @@ -196,7 +196,7 @@ TclCompileIfCmd( tokenPtr = parsePtr->tokenPtr; wordIdx = 0; - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; for (wordIdx = 0; wordIdx < numWords; wordIdx++) { if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { @@ -478,7 +478,7 @@ TclCompileIncrCmd( Tcl_Token *varTokenPtr, *incrTokenPtr; int isScalar, localIndex, haveImmValue, immValue; - if (((int)parsePtr->numWords != 2) && ((int)parsePtr->numWords != 3)) { + if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) { return TCL_ERROR; } @@ -494,7 +494,7 @@ TclCompileIncrCmd( haveImmValue = 0; immValue = 1; - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { incrTokenPtr = TokenAfter(varTokenPtr); if (incrTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { const char *word = incrTokenPtr[1].start; @@ -594,9 +594,9 @@ TclCompileInfoCommandsCmd( * We require one compile-time known argument for the case we can compile. */ - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { return TclCompileBasic0ArgCmd(interp, parsePtr, cmdPtr, envPtr); - } else if ((int)parsePtr->numWords != 2) { + } else if (parsePtr->numWords != 2) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -649,7 +649,7 @@ TclCompileInfoCoroutineCmd( * Only compile [info coroutine] without arguments. */ - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -673,7 +673,7 @@ TclCompileInfoExistsCmd( Tcl_Token *tokenPtr; int isScalar, localIndex; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } @@ -721,13 +721,13 @@ TclCompileInfoLevelCmd( * Only compile [info level] without arguments or with a single argument. */ - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { /* * Not much to do; we compile to a single instruction... */ TclEmitOpcode( INST_INFO_LEVEL_NUM, envPtr); - } else if ((int)parsePtr->numWords != 2) { + } else if (parsePtr->numWords != 2) { return TCL_ERROR; } else { DefineLineInformation; /* TIP #280 */ @@ -754,7 +754,7 @@ TclCompileInfoObjectClassCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } CompileWord(envPtr, tokenPtr, interp, 1); @@ -779,7 +779,7 @@ TclCompileInfoObjectIsACmd( * engine. */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD || tokenPtr[1].size < 1 @@ -808,7 +808,7 @@ TclCompileInfoObjectNamespaceCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } CompileWord(envPtr, tokenPtr, interp, 1); @@ -847,7 +847,7 @@ TclCompileLappendCmd( int isScalar, localIndex, numWords, i; /* TODO: Consider support for compiling expanded args. */ - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if (numWords < 3) { return TCL_ERROR; } @@ -961,7 +961,7 @@ TclCompileLassignCmd( Tcl_Token *tokenPtr; int isScalar, localIndex, numWords, idx; - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; /* * Check for command syntax error, but we'll punt that to runtime. @@ -1062,7 +1062,7 @@ TclCompileLindexCmd( { DefineLineInformation; /* TIP #280 */ Tcl_Token *idxTokenPtr, *valTokenPtr; - int i, idx, numWords = (int)parsePtr->numWords; + int i, idx, numWords = parsePtr->numWords; /* * Quit if not enough args. @@ -1155,7 +1155,7 @@ TclCompileListCmd( int i, numWords, concat, build; Tcl_Obj *listObj, *objPtr; - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { /* * [list] without arguments just pushes an empty object. */ @@ -1169,7 +1169,7 @@ TclCompileListCmd( * implement with a simple push. */ - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; valueTokenPtr = TokenAfter(parsePtr->tokenPtr); TclNewObj(listObj); for (i = 1; i < numWords && listObj != NULL; i++) { @@ -1192,7 +1192,7 @@ TclCompileListCmd( * Push the all values onto the stack. */ - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; valueTokenPtr = TokenAfter(parsePtr->tokenPtr); concat = build = 0; for (i = 1; i < numWords; i++) { @@ -1266,7 +1266,7 @@ TclCompileLlengthCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *varTokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } varTokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -1299,7 +1299,7 @@ TclCompileLrangeCmd( Tcl_Token *tokenPtr, *listTokenPtr; int idx1, idx2; - if ((int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 4) { return TCL_ERROR; } listTokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -1392,7 +1392,7 @@ TclCompileLinsertCmd( */ CompileWord(envPtr, listTokenPtr, interp, 1); - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr); TclEmitInt4( (int)TCL_INDEX_END, envPtr); return TCL_OK; @@ -1524,7 +1524,7 @@ TclCompileLreplaceCmd( emptyPrefix = 0; } - if ((idx1 == suffixStart) && ((int)parsePtr->numWords == 4)) { + if ((idx1 == suffixStart) && (parsePtr->numWords == 4)) { /* * This is a "no-op". Example: [lreplace {a b c} 2 0] * We still do a list operation to get list-verification @@ -1669,9 +1669,9 @@ TclCompileLsetCmd( if (localIndex < 0) { if (isScalar) { - tempDepth = (int)parsePtr->numWords - 2; + tempDepth = parsePtr->numWords - 2; } else { - tempDepth = (int)parsePtr->numWords - 1; + tempDepth = parsePtr->numWords - 1; } TclEmitInstInt4( INST_OVER, tempDepth, envPtr); } @@ -1682,9 +1682,9 @@ TclCompileLsetCmd( if (!isScalar) { if (localIndex < 0) { - tempDepth = (int)parsePtr->numWords - 1; + tempDepth = parsePtr->numWords - 1; } else { - tempDepth = (int)parsePtr->numWords - 2; + tempDepth = parsePtr->numWords - 2; } TclEmitInstInt4( INST_OVER, tempDepth, envPtr); } @@ -1711,10 +1711,10 @@ TclCompileLsetCmd( * Emit the correct variety of 'lset' instruction. */ - if ((int)parsePtr->numWords == 4) { + if (parsePtr->numWords == 4) { TclEmitOpcode( INST_LSET_LIST, envPtr); } else { - TclEmitInstInt4( INST_LSET_FLAT, (int)parsePtr->numWords-1, envPtr); + TclEmitInstInt4( INST_LSET_FLAT, parsePtr->numWords-1, envPtr); } /* @@ -1770,7 +1770,7 @@ TclCompileNamespaceCurrentCmd( * Only compile [namespace current] without arguments. */ - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -1793,7 +1793,7 @@ TclCompileNamespaceCodeCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -1842,7 +1842,7 @@ TclCompileNamespaceOriginCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -1864,7 +1864,7 @@ TclCompileNamespaceQualifiersCmd( Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); int off; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } @@ -1899,7 +1899,7 @@ TclCompileNamespaceTailCmd( Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); JumpFixup jumpFixup; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } @@ -1943,7 +1943,7 @@ TclCompileNamespaceUpvarCmd( * Only compile [namespace upvar ...]: needs an even number of args, >=4 */ - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if ((numWords % 2) || (numWords < 4)) { return TCL_ERROR; } @@ -1995,7 +1995,7 @@ TclCompileNamespaceWhichCmd( Tcl_Token *tokenPtr, *opt; int idx; - if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 3) { + if (parsePtr->numWords < 2 || parsePtr->numWords > 3) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -2006,7 +2006,7 @@ TclCompileNamespaceWhichCmd( * "-variable" (currently) and anything else is an error. */ - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { return TCL_ERROR; } @@ -2109,7 +2109,7 @@ TclCompileRegexpCmd( } } - if (((int)parsePtr->numWords - i) != 2) { + if ((parsePtr->numWords - i) != 2) { /* * We don't support capturing to variables. */ @@ -2162,7 +2162,7 @@ TclCompileRegexpCmd( } if (!simple) { - CompileWord(envPtr, varTokenPtr, interp, (int)parsePtr->numWords - 2); + CompileWord(envPtr, varTokenPtr, interp, parsePtr->numWords - 2); } /* @@ -2170,7 +2170,7 @@ TclCompileRegexpCmd( */ varTokenPtr = TokenAfter(varTokenPtr); - CompileWord(envPtr, varTokenPtr, interp, (int)parsePtr->numWords - 1); + CompileWord(envPtr, varTokenPtr, interp, parsePtr->numWords - 1); if (simple) { if (exact && !nocase) { @@ -2247,7 +2247,7 @@ TclCompileRegsubCmd( int exact, quantified, result = TCL_ERROR; size_t len; - if ((int)parsePtr->numWords < 5 || (int)parsePtr->numWords > 6) { + if (parsePtr->numWords < 5 || parsePtr->numWords > 6) { return TCL_ERROR; } @@ -2274,7 +2274,7 @@ TclCompileRegsubCmd( } if (TclGetString(patternObj)[0] == '-') { if (strcmp(TclGetString(patternObj), "--") != 0 - || (int)parsePtr->numWords == 5) { + || parsePtr->numWords == 5) { goto done; } tokenPtr = TokenAfter(tokenPtr); @@ -2283,7 +2283,7 @@ TclCompileRegsubCmd( if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) { goto done; } - } else if ((int)parsePtr->numWords == 6) { + } else if (parsePtr->numWords == 6) { goto done; } @@ -2354,7 +2354,7 @@ TclCompileRegsubCmd( PushLiteral(envPtr, bytes, len); bytes = Tcl_GetStringFromObj(replacementObj, &len); PushLiteral(envPtr, bytes, len); - CompileWord(envPtr, stringTokenPtr, interp, (int)parsePtr->numWords - 2); + CompileWord(envPtr, stringTokenPtr, interp, parsePtr->numWords - 2); TclEmitOpcode( INST_STR_MAP, envPtr); done: @@ -2401,7 +2401,7 @@ TclCompileReturnCmd( */ int level, code, objc, status = TCL_OK; size_t size; - int numWords = (int)parsePtr->numWords; + int numWords = parsePtr->numWords; int explicitResult = (0 == (numWords % 2)); int numOptionWords = numWords - 1 - explicitResult; Tcl_Obj *returnOpts, **objv; @@ -2655,7 +2655,7 @@ TclCompileUpvarCmd( return TCL_ERROR; } - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if (numWords < 3) { return TCL_ERROR; } @@ -2756,7 +2756,7 @@ TclCompileVariableCmd( Tcl_Token *varTokenPtr, *valueTokenPtr; int localIndex, numWords, i; - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if (numWords < 2) { return TCL_ERROR; } @@ -2954,7 +2954,7 @@ TclCompileObjectNextToCmd( Tcl_Token *tokenPtr = parsePtr->tokenPtr; int i; - if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 255) { + if (parsePtr->numWords < 2 || parsePtr->numWords > 255) { return TCL_ERROR; } @@ -2980,9 +2980,9 @@ TclCompileObjectSelfCmd( * bytecoding is at all reasonable. */ - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { goto compileSelfObject; - } else if ((int)parsePtr->numWords == 2) { + } else if (parsePtr->numWords == 2) { Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr), *subcmd; if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD || tokenPtr[1].size==0) { diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 0e782ac..581df02 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -133,7 +133,7 @@ TclCompileSetCmd( Tcl_Token *varTokenPtr, *valueTokenPtr; int isAssignment, isScalar, localIndex, numWords; - numWords = (int)parsePtr->numWords; + numWords = parsePtr->numWords; if ((numWords != 2) && (numWords != 3)) { return TCL_ERROR; } @@ -223,7 +223,7 @@ TclCompileStringCatCmd( CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ - int i, numWords = (int)parsePtr->numWords, numArgs; + int i, numWords = parsePtr->numWords, numArgs; Tcl_Token *wordTokenPtr; Tcl_Obj *obj, *folded; @@ -300,7 +300,7 @@ TclCompileStringCmpCmd( * We don't support any flags; the bytecode isn't that sophisticated. */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -331,7 +331,7 @@ TclCompileStringEqualCmd( * We don't support any flags; the bytecode isn't that sophisticated. */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -362,7 +362,7 @@ TclCompileStringFirstCmd( * We don't support any flags; the bytecode isn't that sophisticated. */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -393,7 +393,7 @@ TclCompileStringLastCmd( * We don't support any flags; the bytecode isn't that sophisticated. */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -420,7 +420,7 @@ TclCompileStringIndexCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -448,7 +448,7 @@ TclCompileStringInsertCmd( Tcl_Token *tokenPtr; int idx; - if ((int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 4) { return TCL_ERROR; } @@ -523,7 +523,7 @@ TclCompileStringIsCmd( InstStringClassType strClassType; Tcl_Obj *isClass; - if ((int)parsePtr->numWords < 3 || (int)parsePtr->numWords > 6) { + if (parsePtr->numWords < 3 || parsePtr->numWords > 6) { return TCL_ERROR; } TclNewObj(isClass); @@ -549,12 +549,12 @@ TclCompileStringIsCmd( * way to have more than 4 arguments. */ - if ((int)parsePtr->numWords != 3 && (int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 3 && parsePtr->numWords != 4) { return TCL_ERROR; } tokenPtr = TokenAfter(tokenPtr); - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { allowEmpty = 1; } else { if (!GotLiteral(tokenPtr, "-strict")) { @@ -573,7 +573,7 @@ TclCompileStringIsCmd( * 5. Lists */ - CompileWord(envPtr, tokenPtr, interp, (int)parsePtr->numWords-1); + CompileWord(envPtr, tokenPtr, interp, parsePtr->numWords-1); switch ((enum isClassesEnum) t) { case STR_IS_ALNUM: @@ -798,7 +798,7 @@ TclCompileStringMatchCmd( int i, exactMatch = 0, nocase = 0; const char *str; - if ((int)parsePtr->numWords < 3 || (int)parsePtr->numWords > 4) { + if (parsePtr->numWords < 3 || parsePtr->numWords > 4) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -807,7 +807,7 @@ TclCompileStringMatchCmd( * Check if we have a -nocase flag. */ - if ((int)parsePtr->numWords == 4) { + if (parsePtr->numWords == 4) { if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr); } @@ -877,7 +877,7 @@ TclCompileStringLenCmd( Tcl_Token *tokenPtr; Tcl_Obj *objPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } @@ -929,7 +929,7 @@ TclCompileStringMapCmd( * thing to map). */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } mapTokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -979,7 +979,7 @@ TclCompileStringRangeCmd( Tcl_Token *stringTokenPtr, *fromTokenPtr, *toTokenPtr; int idx1, idx2; - if ((int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 4) { return TCL_ERROR; } stringTokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -1054,7 +1054,7 @@ TclCompileStringReplaceCmd( Tcl_Token *tokenPtr, *valueTokenPtr; int first, last; - if ((int)parsePtr->numWords < 4 || (int)parsePtr->numWords > 5) { + if (parsePtr->numWords < 4 || parsePtr->numWords > 5) { return TCL_ERROR; } @@ -1119,7 +1119,7 @@ TclCompileStringReplaceCmd( */ || ((first >= (int)TCL_INDEX_START) && (last >= (int)TCL_INDEX_START) && (last < first))) { /* Know (last < first) */ - if ((int)parsePtr->numWords == 5) { + if (parsePtr->numWords == 5) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 4); OP( POP); /* Pop newString */ @@ -1128,7 +1128,7 @@ TclCompileStringReplaceCmd( return TCL_OK; } - if ((int)parsePtr->numWords == 5) { + if (parsePtr->numWords == 5) { /* * When we have a string replacement, we have to take care about * not replacing empty substrings that [string replace] promises @@ -1230,7 +1230,7 @@ TclCompileStringReplaceCmd( CompileWord(envPtr, tokenPtr, interp, 2); tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 3); - if ((int)parsePtr->numWords == 5) { + if (parsePtr->numWords == 5) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 4); } else { @@ -1251,13 +1251,13 @@ TclCompileStringTrimLCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2 && (int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); CompileWord(envPtr, tokenPtr, interp, 1); - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 2); } else { @@ -1278,13 +1278,13 @@ TclCompileStringTrimRCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2 && (int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); CompileWord(envPtr, tokenPtr, interp, 1); - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 2); } else { @@ -1305,13 +1305,13 @@ TclCompileStringTrimCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2 && (int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); CompileWord(envPtr, tokenPtr, interp, 1); - if ((int)parsePtr->numWords == 3) { + if (parsePtr->numWords == 3) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, 2); } else { @@ -1333,7 +1333,7 @@ TclCompileStringToUpperCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TclCompileBasic1To3ArgCmd(interp, parsePtr, cmdPtr, envPtr); } @@ -1355,7 +1355,7 @@ TclCompileStringToLowerCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TclCompileBasic1To3ArgCmd(interp, parsePtr, cmdPtr, envPtr); } @@ -1377,7 +1377,7 @@ TclCompileStringToTitleCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TclCompileBasic1To3ArgCmd(interp, parsePtr, cmdPtr, envPtr); } @@ -1452,7 +1452,7 @@ TclCompileSubstCmd( CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ - int numArgs = (int)parsePtr->numWords - 1; + int numArgs = parsePtr->numWords - 1; int numOpts = numArgs - 1; int objc, flags = TCL_SUBST_ALL; Tcl_Obj **objv/*, *toSubst = NULL*/; @@ -1616,7 +1616,7 @@ TclSubstCompile( /* Start */ if (TclFixupForwardJumpToHere(envPtr, &startFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad start jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad start jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - startFixup.codeOffset); } } @@ -1675,7 +1675,7 @@ TclSubstCompile( TclAdjustStackDepth(1, envPtr); /* BREAK destination */ if (TclFixupForwardJumpToHere(envPtr, &breakFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad break jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad break jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - breakFixup.codeOffset); } OP( POP); @@ -1691,7 +1691,7 @@ TclSubstCompile( TclAdjustStackDepth(2, envPtr); /* CONTINUE destination */ if (TclFixupForwardJumpToHere(envPtr, &continueFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad continue jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad continue jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - continueFixup.codeOffset); } OP( POP); @@ -1701,11 +1701,11 @@ TclSubstCompile( TclAdjustStackDepth(2, envPtr); /* RETURN + other destination */ if (TclFixupForwardJumpToHere(envPtr, &returnFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad return jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad return jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - returnFixup.codeOffset); } if (TclFixupForwardJumpToHere(envPtr, &otherFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad other jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad other jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - otherFixup.codeOffset); } @@ -1718,7 +1718,7 @@ TclSubstCompile( /* OK destination */ if (TclFixupForwardJumpToHere(envPtr, &okFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad ok jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad ok jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - okFixup.codeOffset); } if (count > 1) { @@ -1728,7 +1728,7 @@ TclSubstCompile( /* CONTINUE jump to here */ if (TclFixupForwardJumpToHere(envPtr, &endFixup, 127)) { - Tcl_Panic("TclCompileSubstCmd: bad end jump distance %" TCL_Z_MODIFIER "d", + Tcl_Panic("TclCompileSubstCmd: bad end jump distance %" TCL_Z_MODIFIER "u", CurrentOffset(envPtr) - endFixup.codeOffset); } bline = envPtr->line; @@ -1822,7 +1822,7 @@ TclCompileSwitchCmd( tokenPtr = TokenAfter(parsePtr->tokenPtr); valueIndex = 1; - numWords = (int)parsePtr->numWords-1; + numWords = parsePtr->numWords-1; /* * Check for options. @@ -2664,7 +2664,7 @@ TclCompileTailcallCmd( Tcl_Token *tokenPtr = parsePtr->tokenPtr; int i; - if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 256 + if (parsePtr->numWords < 2 || parsePtr->numWords > 256 || envPtr->procPtr == NULL) { return TCL_ERROR; } @@ -2676,7 +2676,7 @@ TclCompileTailcallCmd( tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, i); } - TclEmitInstInt1( INST_TAILCALL, (int)parsePtr->numWords, envPtr); + TclEmitInstInt1( INST_TAILCALL, parsePtr->numWords, envPtr); return TCL_OK; } @@ -2707,7 +2707,7 @@ TclCompileThrowCmd( CompileEnv *envPtr) /* Holds resulting instructions. */ { DefineLineInformation; /* TIP #280 */ - int numWords = (int)parsePtr->numWords; + int numWords = parsePtr->numWords; Tcl_Token *codeToken, *msgToken; Tcl_Obj *objPtr; int codeKnown, codeIsList, codeIsValid; @@ -2810,7 +2810,7 @@ TclCompileTryCmd( TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - int numWords = (int)parsePtr->numWords, numHandlers, result = TCL_ERROR; + int numWords = parsePtr->numWords, numHandlers, result = TCL_ERROR; Tcl_Token *bodyToken, *finallyToken, *tokenPtr; Tcl_Token **handlerTokens = NULL; Tcl_Obj **matchClauses = NULL; @@ -3767,7 +3767,7 @@ TclCompileWhileCmd( * infinite loop. */ Tcl_Obj *boolObj; - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -3936,11 +3936,11 @@ TclCompileYieldCmd( TCL_UNUSED(Command *), CompileEnv *envPtr) /* Holds resulting instructions. */ { - if ((int)parsePtr->numWords < 1 || (int)parsePtr->numWords > 2) { + if (parsePtr->numWords < 1 || parsePtr->numWords > 2) { return TCL_ERROR; } - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { PUSH(""); } else { DefineLineInformation; /* TIP #280 */ @@ -4024,7 +4024,7 @@ CompileUnaryOpCmd( DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } tokenPtr = TokenAfter(parsePtr->tokenPtr); @@ -4116,7 +4116,7 @@ CompileStrictlyBinaryOpCmd( int instruction, CompileEnv *envPtr) { - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } return CompileAssociativeBinaryOpCmd(interp, parsePtr, @@ -4154,7 +4154,7 @@ CompileComparisonOpCmd( /* TODO: Consider support for compiling expanded args. */ if ((int)parsePtr->numWords < 3) { PUSH("1"); - } else if ((int)parsePtr->numWords == 3) { + } else if (parsePtr->numWords == 3) { tokenPtr = TokenAfter(parsePtr->tokenPtr); CompileWord(envPtr, tokenPtr, interp, 1); tokenPtr = TokenAfter(tokenPtr); @@ -4508,7 +4508,7 @@ TclCompileMinusOpCmd( int words; /* TODO: Consider support for compiling expanded args. */ - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { /* * Fallback to direct eval to report syntax error. */ @@ -4553,14 +4553,14 @@ TclCompileDivOpCmd( int words; /* TODO: Consider support for compiling expanded args. */ - if ((int)parsePtr->numWords == 1) { + if (parsePtr->numWords == 1) { /* * Fallback to direct eval to report syntax error. */ return TCL_ERROR; } - if ((int)parsePtr->numWords == 2) { + if (parsePtr->numWords == 2) { PUSH("1.0"); } for (words=1 ; words<(int)parsePtr->numWords ; words++) { diff --git a/generic/tclCompile.c b/generic/tclCompile.c index e86a363..a34ce82 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2044,7 +2044,7 @@ CompileCommandTokens( EnterCmdWordData(eclPtr, parsePtr->commandStart - envPtr->source, parsePtr->tokenPtr, parsePtr->commandStart, - (int)parsePtr->numWords, cmdLine, + parsePtr->numWords, cmdLine, clNext, &wlines, envPtr); wlineat = eclPtr->nuloc - 1; @@ -2071,7 +2071,7 @@ CompileCommandTokens( } } if (cmdPtr && !(cmdPtr->flags & CMD_COMPILES_EXPANDED)) { - expand = ExpandRequested(parsePtr->tokenPtr, (int)parsePtr->numWords); + expand = ExpandRequested(parsePtr->tokenPtr, parsePtr->numWords); if (expand) { /* We need to expand, but compileProc cannot. */ cmdPtr = NULL; @@ -2086,15 +2086,15 @@ CompileCommandTokens( if (code == TCL_ERROR) { if (expand < 0) { - expand = ExpandRequested(parsePtr->tokenPtr, (int)parsePtr->numWords); + expand = ExpandRequested(parsePtr->tokenPtr, parsePtr->numWords); } if (expand) { CompileExpanded(interp, parsePtr->tokenPtr, - cmdKnown ? cmdObj : NULL, (int)parsePtr->numWords, envPtr); + cmdKnown ? cmdObj : NULL, parsePtr->numWords, envPtr); } else { TclCompileInvocation(interp, parsePtr->tokenPtr, - cmdKnown ? cmdObj : NULL, (int)parsePtr->numWords, envPtr); + cmdKnown ? cmdObj : NULL, parsePtr->numWords, envPtr); } } @@ -2215,7 +2215,7 @@ TclCompileScript( numBytes -= next - p; p = next; - if ((int)parsePtr->numWords == 0) { + if (parsePtr->numWords == 0) { /* * The "command" parsed has no words. In this case we can skip * the rest of the loop body. With no words, clearly @@ -3198,7 +3198,7 @@ EnterCmdStartData( } if (cmdIndex > 0) { - if (codeOffset < envPtr->cmdMapPtr[cmdIndex-1].codeOffset) { + if (codeOffset < (int)envPtr->cmdMapPtr[cmdIndex-1].codeOffset) { Tcl_Panic("EnterCmdStartData: cmd map not sorted by code offset"); } } @@ -3207,7 +3207,7 @@ EnterCmdStartData( cmdLocPtr->codeOffset = codeOffset; cmdLocPtr->srcOffset = srcOffset; cmdLocPtr->numSrcBytes = -1; - cmdLocPtr->numCodeBytes = -1; + cmdLocPtr->numCodeBytes = TCL_INDEX_NONE; } /* @@ -3378,7 +3378,7 @@ TclCreateExceptRange( size_t currBytes = envPtr->exceptArrayNext * sizeof(ExceptionRange); size_t currBytes2 = envPtr->exceptArrayNext * sizeof(ExceptionAux); - int newElems = 2*envPtr->exceptArrayEnd; + size_t newElems = 2*envPtr->exceptArrayEnd; size_t newBytes = newElems * sizeof(ExceptionRange); size_t newBytes2 = newElems * sizeof(ExceptionAux); @@ -3409,8 +3409,8 @@ TclCreateExceptRange( rangePtr = &envPtr->exceptArrayPtr[index]; rangePtr->type = type; rangePtr->nestingLevel = envPtr->exceptDepth; - rangePtr->codeOffset = -1; - rangePtr->numCodeBytes = -1; + rangePtr->codeOffset = TCL_INDEX_NONE; + rangePtr->numCodeBytes = TCL_INDEX_NONE; rangePtr->breakOffset = -1; rangePtr->continueOffset = -1; rangePtr->catchOffset = -1; @@ -3435,9 +3435,9 @@ TclCreateExceptRange( * * Returns the innermost exception range that covers the current code * creation point, and optionally the stack depth that is expected at - * that point. Relies on the fact that the range has a numCodeBytes = -1 - * when it is being populated and that inner ranges come after outer - * ranges. + * that point. Relies on the fact that the range has a numCodeBytes = + * TCL_INDEX_NONE when it is being populated and that inner ranges + * come after outer ranges. * * --------------------------------------------------------------------- */ @@ -3448,15 +3448,15 @@ TclGetInnermostExceptionRange( int returnCode, ExceptionAux **auxPtrPtr) { - int i = envPtr->exceptArrayNext; + size_t i = envPtr->exceptArrayNext; ExceptionRange *rangePtr = envPtr->exceptArrayPtr + i; while (i > 0) { rangePtr--; i--; - if (CurrentOffset(envPtr) >= rangePtr->codeOffset && - (rangePtr->numCodeBytes == -1 || CurrentOffset(envPtr) < - rangePtr->codeOffset+rangePtr->numCodeBytes) && + if (CurrentOffset(envPtr) >= (int)rangePtr->codeOffset && + (rangePtr->numCodeBytes == TCL_INDEX_NONE || CurrentOffset(envPtr) < + (int)rangePtr->codeOffset+(int)rangePtr->numCodeBytes) && (returnCode != TCL_CONTINUE || envPtr->exceptAuxArrayPtr[i].supportsContinue)) { @@ -3603,10 +3603,10 @@ StartExpanding( * Ignore loops unless they're still being built. */ - if (rangePtr->codeOffset > CurrentOffset(envPtr)) { + if ((int)rangePtr->codeOffset > CurrentOffset(envPtr)) { continue; } - if (rangePtr->numCodeBytes != -1) { + if (rangePtr->numCodeBytes != TCL_INDEX_NONE) { continue; } diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 9f47a03..0ec34dc 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -92,9 +92,9 @@ typedef struct { int nestingLevel; /* Static depth of the exception range. Used * to find the most deeply-nested range * surrounding a PC at runtime. */ - int codeOffset; /* Offset of the first instruction byte of the + size_t codeOffset; /* Offset of the first instruction byte of the * code range. */ - int numCodeBytes; /* Number of bytes in the code range. */ + size_t numCodeBytes; /* Number of bytes in the code range. */ int breakOffset; /* If LOOP_EXCEPTION_RANGE, the target PC * offset for a break command in the range. */ int continueOffset; /* If LOOP_EXCEPTION_RANGE and not -1, the @@ -163,8 +163,8 @@ typedef struct ExceptionAux { */ typedef struct { - int codeOffset; /* Offset of first byte of command code. */ - int numCodeBytes; /* Number of bytes for command's code. */ + size_t codeOffset; /* Offset of first byte of command code. */ + size_t numCodeBytes; /* Number of bytes for command's code. */ int srcOffset; /* Offset of first char of the command. */ int numSrcBytes; /* Number of command source chars. */ } CmdLocation; @@ -297,7 +297,7 @@ typedef struct CompileEnv { * information provided by ObjInterpProc in * tclProc.c. */ size_t numCommands; /* Number of commands compiled. */ - int exceptDepth; /* Current exception range nesting level; -1 + size_t exceptDepth; /* Current exception range nesting level; -1 * if not in any range currently. */ int maxExceptDepth; /* Max nesting level of exception ranges; -1 * if no ranges have been compiled. */ @@ -461,7 +461,7 @@ typedef struct ByteCode { * by AuxData entries. */ int numCommands; /* Number of commands compiled. */ int numSrcBytes; /* Number of source bytes compiled. */ - int numCodeBytes; /* Number of code bytes. */ + size_t numCodeBytes; /* Number of code bytes. */ int numLitObjects; /* Number of objects in literal array. */ int numExceptRanges; /* Number of ExceptionRange array elems. */ int numAuxDataItems; /* Number of AuxData items. */ @@ -944,7 +944,7 @@ typedef enum { typedef struct JumpFixup { TclJumpType jumpType; /* Indicates the kind of jump. */ - unsigned int codeOffset; /* Offset of the first byte of the one-byte + TCL_HASH_TYPE codeOffset; /* Offset of the first byte of the one-byte * forward jump's code. */ int cmdIndex; /* Index of the first command after the one * for which the jump was emitted. Used to @@ -1584,7 +1584,7 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData, #define ExceptionRangeStarts(envPtr, index) \ (((envPtr)->exceptDepth++), \ ((envPtr)->maxExceptDepth = \ - TclMax((envPtr)->exceptDepth, (envPtr)->maxExceptDepth)), \ + TclMax((int)(envPtr)->exceptDepth, (envPtr)->maxExceptDepth)), \ ((envPtr)->exceptArrayPtr[(index)].codeOffset = CurrentOffset(envPtr))) #define ExceptionRangeEnds(envPtr, index) \ (((envPtr)->exceptDepth--), \ diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 1cdee5c..7138b92 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -288,7 +288,7 @@ DisassembleByteCodeObj( TclGetString(fileObj), line); } Tcl_AppendPrintfToObj(bufferObj, - "\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", + "\n Cmds %d, src %d, inst %" TCL_Z_MODIFIER "u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes, codePtr->numLitObjects, codePtr->numAuxDataItems, codePtr->maxStackDepth, @@ -300,7 +300,7 @@ DisassembleByteCodeObj( #ifdef TCL_COMPILE_STATS Tcl_AppendPrintfToObj(bufferObj, - " Code %lu = header %lu+inst %d+litObj %lu+exc %lu+aux %lu+cmdMap %d\n", + " Code %lu = header %lu+inst %" TCL_Z_MODIFIER "u+litObj %lu+exc %lu+aux %lu+cmdMap %d\n", (unsigned long) codePtr->structureSize, (unsigned long) (sizeof(ByteCode) - sizeof(size_t) - sizeof(Tcl_Time)), codePtr->numCodeBytes, @@ -358,7 +358,7 @@ DisassembleByteCodeObj( ExceptionRange *rangePtr = &codePtr->exceptArrayPtr[i]; Tcl_AppendPrintfToObj(bufferObj, - " %d: level %d, %s, pc %d-%d, ", + " %d: level %d, %s, pc %" TCL_Z_MODIFIER "u-%" TCL_Z_MODIFIER "u, ", i, rangePtr->nestingLevel, (rangePtr->type==LOOP_EXCEPTION_RANGE ? "loop" : "catch"), rangePtr->codeOffset, @@ -1008,7 +1008,7 @@ DisassembleByteCodeAsDicts( */ TclNewObj(instructions); - for (pc=codePtr->codeStart; pc<codePtr->codeStart+codePtr->numCodeBytes;){ + for (pc=codePtr->codeStart; pc<codePtr->codeStart+(int)codePtr->numCodeBytes;){ const InstructionDesc *instDesc = &tclInstructionTable[*pc]; int address = pc - codePtr->codeStart; @@ -1144,14 +1144,14 @@ DisassembleByteCodeAsDicts( switch (rangePtr->type) { case LOOP_EXCEPTION_RANGE: Tcl_ListObjAppendElement(NULL, exn, Tcl_ObjPrintf( - "type %s level %d from %d to %d break %d continue %d", + "type %s level %d from %" TCL_Z_MODIFIER "u to %" TCL_Z_MODIFIER "u break %d continue %d", "loop", rangePtr->nestingLevel, rangePtr->codeOffset, rangePtr->codeOffset + rangePtr->numCodeBytes - 1, rangePtr->breakOffset, rangePtr->continueOffset)); break; case CATCH_EXCEPTION_RANGE: Tcl_ListObjAppendElement(NULL, exn, Tcl_ObjPrintf( - "type %s level %d from %d to %d catch %d", + "type %s level %d from %" TCL_Z_MODIFIER "u to %" TCL_Z_MODIFIER "u catch %d", "catch", rangePtr->nestingLevel, rangePtr->codeOffset, rangePtr->codeOffset + rangePtr->numCodeBytes - 1, rangePtr->catchOffset)); diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 56dc3c1..509dd17 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3254,7 +3254,7 @@ TclAttemptCompileProc( int savedAuxDataArrayNext = envPtr->auxDataArrayNext; int savedExceptArrayNext = envPtr->exceptArrayNext; #ifdef TCL_COMPILE_DEBUG - int savedExceptDepth = envPtr->exceptDepth; + size_t savedExceptDepth = envPtr->exceptDepth; #endif int depth = depth1; @@ -3439,7 +3439,7 @@ CompileToInvokedCommand( * Do the replacing dispatch. */ - TclEmitInvoke(envPtr, INST_INVOKE_REPLACE, (int)parsePtr->numWords,numWords+1); + TclEmitInvoke(envPtr, INST_INVOKE_REPLACE, parsePtr->numWords,numWords+1); } /* @@ -3469,7 +3469,7 @@ CompileBasicNArgCommand( Tcl_IncrRefCount(objPtr); Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr); TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr, - (int)parsePtr->numWords, envPtr); + parsePtr->numWords, envPtr); Tcl_DecrRefCount(objPtr); return TCL_OK; } @@ -3489,7 +3489,7 @@ TclCompileBasic0ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 1) { + if (parsePtr->numWords != 1) { return TCL_ERROR; } @@ -3511,7 +3511,7 @@ TclCompileBasic1ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 2) { return TCL_ERROR; } @@ -3533,7 +3533,7 @@ TclCompileBasic2ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -3555,7 +3555,7 @@ TclCompileBasic3ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 4) { return TCL_ERROR; } @@ -3577,7 +3577,7 @@ TclCompileBasic0Or1ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 1 && (int)parsePtr->numWords != 2) { + if (parsePtr->numWords != 1 && parsePtr->numWords != 2) { return TCL_ERROR; } @@ -3599,7 +3599,7 @@ TclCompileBasic1Or2ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 2 && (int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 2 && parsePtr->numWords != 3) { return TCL_ERROR; } @@ -3621,7 +3621,7 @@ TclCompileBasic2Or3ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords != 3 && (int)parsePtr->numWords != 4) { + if (parsePtr->numWords != 3 && parsePtr->numWords != 4) { return TCL_ERROR; } @@ -3643,7 +3643,7 @@ TclCompileBasic0To2ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords < 1 || (int)parsePtr->numWords > 3) { + if (parsePtr->numWords < 1 || parsePtr->numWords > 3) { return TCL_ERROR; } @@ -3665,7 +3665,7 @@ TclCompileBasic1To3ArgCmd( * which is the only code that sees the shenanigans of ensemble dispatch. */ - if ((int)parsePtr->numWords < 2 || (int)parsePtr->numWords > 4) { + if (parsePtr->numWords < 2 || parsePtr->numWords > 4) { return TCL_ERROR; } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 925fcdd..6ca8ede 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -7230,7 +7230,7 @@ TEBCresume( if (result == TCL_BREAK) { result = TCL_OK; pc = (codePtr->codeStart + rangePtr->breakOffset); - TRACE_APPEND(("%s, range at %d, new pc %d\n", + TRACE_APPEND(("%s, range at %" TCL_Z_MODIFIER "u, new pc %d\n", StringForResultCode(result), rangePtr->codeOffset, rangePtr->breakOffset)); NEXT_INST_F(0, 0, 0); @@ -7242,7 +7242,7 @@ TEBCresume( } result = TCL_OK; pc = (codePtr->codeStart + rangePtr->continueOffset); - TRACE_APPEND(("%s, range at %d, new pc %d\n", + TRACE_APPEND(("%s, range at %" TCL_Z_MODIFIER "u, new pc %d\n", StringForResultCode(result), rangePtr->codeOffset, rangePtr->continueOffset)); NEXT_INST_F(0, 0, 0); @@ -7414,7 +7414,7 @@ TEBCresume( } #ifdef TCL_COMPILE_DEBUG if (traceInstructions) { - fprintf(stdout, " ... found catch at %d, catchTop=%d, " + fprintf(stdout, " ... found catch at %" TCL_Z_MODIFIER "u, catchTop=%d, " "unwound to %ld, new pc %" TCL_Z_MODIFIER "u\n", rangePtr->codeOffset, (int) (catchTop - initCatchTop - 1), (long)*catchTop, (size_t) rangePtr->catchOffset); @@ -8682,7 +8682,7 @@ PrintByteCodeInfo( fprintf(stdout, " Source: "); TclPrintSource(stdout, codePtr->source, 60); - fprintf(stdout, "\n Cmds %d, src %d, inst %u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", + fprintf(stdout, "\n Cmds %d, src %d, inst %" TCL_Z_MODIFIER "u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", codePtr->numCommands, codePtr->numSrcBytes, codePtr->numCodeBytes, codePtr->numLitObjects, codePtr->numAuxDataItems, codePtr->maxStackDepth, @@ -8693,7 +8693,7 @@ PrintByteCodeInfo( 0.0); #ifdef TCL_COMPILE_STATS - fprintf(stdout, " Code %lu = header %lu+inst %d+litObj %lu+exc %lu+aux %lu+cmdMap %d\n", + fprintf(stdout, " Code %lu = header %lu+inst %" TCL_Z_MODIFIER "u+litObj %lu+exc %lu+aux %lu+cmdMap %d\n", (unsigned long) codePtr->structureSize, (unsigned long) (sizeof(ByteCode)-sizeof(size_t)-sizeof(Tcl_Time)), codePtr->numCodeBytes, @@ -8980,7 +8980,7 @@ GetSrcInfoForPc( int bestCmdIdx = -1; /* The pc must point within the bytecode */ - assert (pcOffset < (size_t)codePtr->numCodeBytes); + assert (pcOffset < codePtr->numCodeBytes); /* * Decode the code and source offset and length for each command. The @@ -9141,7 +9141,7 @@ GetExceptRangeForPc( while (--rangePtr >= rangeArrayPtr) { start = rangePtr->codeOffset; if ((start <= pcOffset) && - (pcOffset < (start + rangePtr->numCodeBytes))) { + (pcOffset < (start + (int)rangePtr->numCodeBytes))) { if (rangePtr->type == CATCH_EXCEPTION_RANGE) { return rangePtr; } |