diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-18 22:11:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-18 22:11:19 (GMT) |
commit | 213119c371559613a16fb7d3f59cb3260f548b22 (patch) | |
tree | c15c27e7c63f95941d841de7102eb928287d00b2 | |
parent | b5d450df9e1ab548134a2cde35d9a7dba69122b1 (diff) | |
download | tcl-213119c371559613a16fb7d3f59cb3260f548b22.zip tcl-213119c371559613a16fb7d3f59cb3260f548b22.tar.gz tcl-213119c371559613a16fb7d3f59cb3260f548b22.tar.bz2 |
More progress
-rw-r--r-- | generic/tclAssembly.c | 58 | ||||
-rw-r--r-- | generic/tclCompCmds.c | 34 | ||||
-rw-r--r-- | generic/tclCompCmdsGR.c | 54 | ||||
-rw-r--r-- | generic/tclCompCmdsSZ.c | 64 | ||||
-rw-r--r-- | generic/tclCompile.c | 6 | ||||
-rw-r--r-- | generic/tclEnsemble.c | 14 | ||||
-rw-r--r-- | generic/tclInt.h | 6 | ||||
-rw-r--r-- | generic/tclObj.c | 2 | ||||
-rw-r--r-- | generic/tclParse.c | 2 | ||||
-rw-r--r-- | generic/tclProc.c | 6 |
10 files changed, 123 insertions, 123 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index c53fd0b..efe3d97 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -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..dba05bf 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; } @@ -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) { @@ -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; } @@ -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; @@ -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); } @@ -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; } @@ -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; } @@ -2475,7 +2475,7 @@ TclCompileForCmd( int bodyCodeOffset, nextCodeOffset, jumpDist; int bodyRange, nextRange; - if ((int)parsePtr->numWords != 5) { + if (parsePtr->numWords != 5) { return TCL_ERROR; } diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index 92dec77..207b247 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -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); @@ -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. */ @@ -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 @@ -1711,7 +1711,7 @@ 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); @@ -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; } @@ -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; } @@ -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; } @@ -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..66b72c0 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -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; } @@ -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")) { @@ -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); @@ -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); } @@ -3767,7 +3767,7 @@ TclCompileWhileCmd( * infinite loop. */ Tcl_Obj *boolObj; - if ((int)parsePtr->numWords != 3) { + if (parsePtr->numWords != 3) { return TCL_ERROR; } @@ -3940,7 +3940,7 @@ TclCompileYieldCmd( 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 a0004dc..bcd8026 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -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 @@ -2991,7 +2991,7 @@ TclFindCompiledLocal( { CompiledLocal *localPtr; int localVar = -1; - int i; + size_t i; Proc *procPtr; /* @@ -3029,7 +3029,7 @@ TclFindCompiledLocal( } if (name != NULL) { - int localCt = procPtr->numCompiledLocals; + size_t localCt = procPtr->numCompiledLocals; localPtr = procPtr->firstLocalPtr; for (i = 0; i < localCt; i++) { diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 56dc3c1..738668f 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -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; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 29e5009..10b4137 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1090,7 +1090,7 @@ typedef struct AssocData { typedef struct LocalCache { size_t refCount; - int numVars; + size_t numVars; Tcl_Obj *varName0; } LocalCache; @@ -1292,7 +1292,7 @@ typedef struct CFWordBC { #define CLL_END (-1) typedef struct ContLineLoc { - int num; /* Number of entries in loc, not counting the + size_t num; /* Number of entries in loc, not counting the * final -1 marker entry. */ int loc[TCLFLEXARRAY];/* Table of locations, as character offsets. * The table is allocated as part of the @@ -2877,7 +2877,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd; MODULE_SCOPE Tcl_NRPostProc TclClearRootEnsemble; MODULE_SCOPE int TclCompareTwoNumbers(Tcl_Obj *valuePtr, Tcl_Obj *value2Ptr); -MODULE_SCOPE ContLineLoc *TclContinuationsEnter(Tcl_Obj *objPtr, int num, +MODULE_SCOPE ContLineLoc *TclContinuationsEnter(Tcl_Obj *objPtr, size_t num, int *loc); MODULE_SCOPE void TclContinuationsEnterDerived(Tcl_Obj *objPtr, int start, int *clNext); diff --git a/generic/tclObj.c b/generic/tclObj.c index 361d466..2351fb2 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -525,7 +525,7 @@ TclGetContLineTable(void) ContLineLoc * TclContinuationsEnter( Tcl_Obj *objPtr, - int num, + size_t num, int *loc) { int newEntry; diff --git a/generic/tclParse.c b/generic/tclParse.c index 1462fd7..5b4689f 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -1543,7 +1543,7 @@ Tcl_ParseVar( if (termPtr != NULL) { *termPtr = start + parsePtr->tokenPtr->size; } - if ((int)parsePtr->numTokens == 1) { + if (parsePtr->numTokens == 1) { /* * There isn't a variable name after all: the $ is just a $. */ diff --git a/generic/tclProc.c b/generic/tclProc.c index 7940cb1..74e6310 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1246,7 +1246,7 @@ TclFreeLocalCache( Tcl_Interp *interp, LocalCache *localCachePtr) { - int i; + size_t i; Tcl_Obj **namePtrPtr = &localCachePtr->varName0; for (i = 0; i < localCachePtr->numVars; i++, namePtrPtr++) { @@ -1266,8 +1266,8 @@ InitLocalCache( { Interp *iPtr = procPtr->iPtr; ByteCode *codePtr; - int localCt = procPtr->numCompiledLocals; - int numArgs = procPtr->numArgs, i = 0; + size_t localCt = procPtr->numCompiledLocals; + size_t numArgs = procPtr->numArgs, i = 0; Tcl_Obj **namePtr; Var *varPtr; |