diff options
-rw-r--r-- | generic/tclAssembly.c | 10 | ||||
-rw-r--r-- | generic/tclBasic.c | 14 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 2 | ||||
-rw-r--r-- | generic/tclCompCmdsSZ.c | 33 | ||||
-rw-r--r-- | generic/tclCompile.c | 10 | ||||
-rw-r--r-- | generic/tclCompile.h | 4 | ||||
-rw-r--r-- | generic/tclIOCmd.c | 16 | ||||
-rw-r--r-- | generic/tclInt.h | 12 | ||||
-rw-r--r-- | generic/tclOODefineCmds.c | 36 | ||||
-rw-r--r-- | generic/tclParse.c | 18 | ||||
-rw-r--r-- | generic/tclRegexp.c | 2 | ||||
-rw-r--r-- | generic/tclTestObj.c | 2 |
12 files changed, 80 insertions, 79 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 91abd9f..b7bfd2d 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -222,7 +222,7 @@ typedef struct AssemblyEnv { Tcl_HashTable labelHash; /* Hash table whose keys are labels and whose * values are 'label' objects storing the code * offsets of the labels. */ - int cmdLine; /* Current line number within the assembly + size_t cmdLine; /* Current line number within the assembly * code */ int* clNext; /* Invisible continuation line for * [info frame] */ @@ -1074,7 +1074,7 @@ TclAssembleCode( * Process the line of code. */ - if ((int)parsePtr->numWords > 0) { + if (parsePtr->numWords > 0) { size_t instLen = parsePtr->commandSize; /* Length in bytes of the current command */ @@ -3317,7 +3317,7 @@ CheckStack( { CompileEnv* envPtr = assemEnvPtr->envPtr; /* Compilation environment */ - int maxDepth; /* Maximum stack depth overall */ + size_t maxDepth; /* Maximum stack depth overall */ /* * Checking the head block will check all the other blocks recursively. @@ -3334,7 +3334,7 @@ CheckStack( */ maxDepth = assemEnvPtr->maxDepth + envPtr->currStackDepth; - if (maxDepth > (int)envPtr->maxStackDepth) { + if (maxDepth > envPtr->maxStackDepth) { envPtr->maxStackDepth = maxDepth; } @@ -4190,7 +4190,7 @@ RestoreEmbeddedExceptionRanges( range->nestingLevel += envPtr->exceptDepth + bbPtr->catchDepth; memcpy(envPtr->exceptArrayPtr + rangeIndex, range, sizeof(ExceptionRange)); - if ((int)range->nestingLevel >= (int)envPtr->maxExceptDepth) { + if (range->nestingLevel + 1 >= envPtr->maxExceptDepth + 1) { envPtr->maxExceptDepth = range->nestingLevel + 1; } } diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 1e369a9..422445c 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -1782,7 +1782,7 @@ DeleteInterpProc( Tcl_HashSearch search; Tcl_HashTable *hTablePtr; ResolverScheme *resPtr, *nextResPtr; - int i; + size_t i; /* * Punt if there is an error in the Tcl_Release/Tcl_Preserve matchup, @@ -2012,7 +2012,7 @@ DeleteInterpProc( if (eclPtr->type == TCL_LOCATION_SOURCE) { Tcl_DecrRefCount(eclPtr->path); } - for (i=0; i< (int)eclPtr->nuloc; i++) { + for (i=0; i<eclPtr->nuloc; i++) { Tcl_Free(eclPtr->loc[i].line); } @@ -4994,7 +4994,7 @@ TclEvalEx( int flags, /* Collection of OR-ed bits that control the * evaluation of the script. Only * TCL_EVAL_GLOBAL is currently supported. */ - int line, /* The line the script starts on. */ + size_t line, /* The line the script starts on. */ int *clNextOuter, /* Information about an outer context for */ const char *outerScript) /* continuation line data. This is set only in * TclSubstTokens(), to properly handle @@ -5152,7 +5152,7 @@ TclEvalEx( parsePtr->commandStart - outerScript); gotParse = 1; - if ((int)parsePtr->numWords > 0) { + if (parsePtr->numWords > 0) { /* * TIP #280. Track lines within the words of the current * command. We use a separate pointer into the table of @@ -5160,7 +5160,7 @@ TclEvalEx( * per-command parsing. */ - int wordLine = line; + size_t wordLine = line; const char *wordStart = parsePtr->commandStart; int *wordCLNext = clNext; unsigned int objectsNeeded = 0; @@ -5459,7 +5459,7 @@ TclEvalEx( void TclAdvanceLines( - int *line, + size_t *line, const char *start, const char *end) { @@ -5494,7 +5494,7 @@ TclAdvanceLines( void TclAdvanceContinuations( - int *line, + size_t *line, int **clNextPtrPtr, int loc) { diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 7b8e92a..41cf3f9 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -5289,7 +5289,7 @@ TclListLines( Tcl_Obj *listObj, /* Pointer to obj holding a string with list * structure. Assumed to be valid. Assumed to * contain n elements. */ - int line, /* Line the list as a whole starts on. */ + size_t line, /* Line the list as a whole starts on. */ int n, /* #elements in lines */ int *lines, /* Array of line numbers, to fill. */ Tcl_Obj *const *elems) /* The list elems as Tcl_Obj*, in need of diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 7c9b26f..cd1ca22 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -1519,11 +1519,12 @@ TclSubstCompile( const char *bytes, size_t numBytes, int flags, - int line, + size_t line, CompileEnv *envPtr) { Tcl_Token *endTokenPtr, *tokenPtr; - int breakOffset = 0, count = 0, bline = line; + int breakOffset = 0, count = 0; + size_t bline = line; Tcl_Parse parse; Tcl_InterpState state = NULL; @@ -1945,7 +1946,7 @@ TclCompileSwitchCmd( if (numWords == 1) { const char *bytes; size_t maxLen, numBytes; - int bline; /* TIP #280: line of the pattern/action list, + size_t bline; /* TIP #280: line of the pattern/action list, * and start of list for when tracking the * location. This list comes immediately after * the value we switch on. */ @@ -4072,14 +4073,14 @@ CompileAssociativeBinaryOpCmd( { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; - int words; + size_t words; /* TODO: Consider support for compiling expanded args. */ - for (words=1 ; words<(int)parsePtr->numWords ; words++) { + for (words=1 ; words<parsePtr->numWords ; words++) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, words); } - if ((int)parsePtr->numWords <= 2) { + if (parsePtr->numWords <= 2) { PushLiteral(envPtr, identity, -1); words++; } @@ -4175,7 +4176,7 @@ CompileComparisonOpCmd( return TCL_ERROR; } else { int tmpIndex = AnonymousLocal(envPtr); - int words; + size_t words; tokenPtr = TokenAfter(parsePtr->tokenPtr); CompileWord(envPtr, tokenPtr, interp, 1); @@ -4183,11 +4184,11 @@ CompileComparisonOpCmd( CompileWord(envPtr, tokenPtr, interp, 2); STORE(tmpIndex); TclEmitOpcode(instruction, envPtr); - for (words=3 ; words<(int)parsePtr->numWords ;) { + for (words=3 ; words<parsePtr->numWords ;) { LOAD(tmpIndex); tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, words); - if (++words < (int)parsePtr->numWords) { + if (++words < parsePtr->numWords) { STORE(tmpIndex); } TclEmitOpcode(instruction, envPtr); @@ -4311,18 +4312,18 @@ TclCompilePowOpCmd( { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; - int words; + size_t words; /* * This one has its own implementation because the ** operator is the only * one with right associativity. */ - for (words=1 ; words<(int)parsePtr->numWords ; words++) { + for (words=1 ; words<parsePtr->numWords ; words++) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, words); } - if ((int)parsePtr->numWords <= 2) { + if (parsePtr->numWords <= 2) { PUSH("1"); words++; } @@ -4512,7 +4513,7 @@ TclCompileMinusOpCmd( { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; - int words; + size_t words; /* TODO: Consider support for compiling expanded args. */ if (parsePtr->numWords == 1) { @@ -4522,7 +4523,7 @@ TclCompileMinusOpCmd( return TCL_ERROR; } - for (words=1 ; words<(int)parsePtr->numWords ; words++) { + for (words=1 ; words<parsePtr->numWords ; words++) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, words); } @@ -4557,7 +4558,7 @@ TclCompileDivOpCmd( { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr = parsePtr->tokenPtr; - int words; + size_t words; /* TODO: Consider support for compiling expanded args. */ if (parsePtr->numWords == 1) { @@ -4570,7 +4571,7 @@ TclCompileDivOpCmd( if (parsePtr->numWords == 2) { PUSH("1.0"); } - for (words=1 ; words<(int)parsePtr->numWords ; words++) { + for (words=1 ; words<parsePtr->numWords ; words++) { tokenPtr = TokenAfter(tokenPtr); CompileWord(envPtr, tokenPtr, interp, words); } diff --git a/generic/tclCompile.c b/generic/tclCompile.c index b0bf37c..77181ed 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -694,7 +694,7 @@ static void StartExpanding(CompileEnv *envPtr); */ static void EnterCmdWordData(ExtCmdLoc *eclPtr, size_t srcOffset, Tcl_Token *tokenPtr, const char *cmd, - size_t numWords, int line, int *clNext, int **lines, + size_t numWords, size_t line, int *clNext, int **lines, CompileEnv *envPtr); static void ReleaseCmdWordData(ExtCmdLoc *eclPtr); @@ -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; @@ -3287,15 +3287,15 @@ EnterCmdWordData( Tcl_Token *tokenPtr, const char *cmd, size_t numWords, - int line, + size_t line, int *clNext, int **wlines, CompileEnv *envPtr) { ECL *ePtr; const char *last; - size_t wordIdx; - int wordLine, *wwlines, *wordNext; + size_t wordIdx, wordLine; + int *wwlines, *wordNext; if (eclPtr->nuloc >= eclPtr->nloc) { /* diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 1b967cc..f9e6b17 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -379,7 +379,7 @@ typedef struct CompileEnv { /* TIP #280 */ ExtCmdLoc *extCmdMapPtr; /* Extended command location information for * 'info frame'. */ - int line; /* First line of the script, based on the + size_t line; /* First line of the script, based on the * invoking context, then the line of the * command currently compiled. */ int atCmdStart; /* Flag to say whether an INST_START_CMD @@ -468,7 +468,7 @@ typedef struct ByteCode { size_t numCmdLocBytes; /* Number of bytes needed for encoded command * location information. */ size_t maxExceptDepth; /* Maximum nesting level of ExceptionRanges; - * -1 if no ranges were compiled. */ + * TCL_INDEX_NONE if no ranges were compiled. */ size_t maxStackDepth; /* Maximum number of stack elements needed to * execute the code. */ unsigned char *codeStart; /* Points to the first byte of the code. This diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 4859178..d479813 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -280,7 +280,7 @@ Tcl_GetsObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Channel chan; /* The channel to read from. */ - int lineLen; /* Length of line just read. */ + size_t lineLen; /* Length of line just read. */ int mode; /* Mode in which channel is opened. */ Tcl_Obj *linePtr, *chanObjPtr; int code = TCL_OK; @@ -303,7 +303,7 @@ Tcl_GetsObjCmd( TclChannelPreserve(chan); TclNewObj(linePtr); lineLen = Tcl_GetsObj(chan, linePtr); - if (lineLen < 0) { + if (lineLen == TCL_IO_FAILURE) { if (!Tcl_Eof(chan) && !Tcl_InputBlocked(chan)) { Tcl_DecrRefCount(linePtr); @@ -322,7 +322,7 @@ Tcl_GetsObjCmd( code = TCL_ERROR; goto done; } - lineLen = -1; + lineLen = TCL_IO_FAILURE; } if (objc == 3) { if (Tcl_ObjSetVar2(interp, objv[2], NULL, linePtr, @@ -330,7 +330,7 @@ Tcl_GetsObjCmd( code = TCL_ERROR; goto done; } - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(lineLen)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt)((Tcl_WideUInt)(lineLen + 1U)) - 1)); } else { Tcl_SetObjResult(interp, linePtr); } @@ -365,8 +365,8 @@ Tcl_ReadObjCmd( { Tcl_Channel chan; /* The channel to read from. */ int newline, i; /* Discard newline at end? */ - int toRead; /* How many bytes to read? */ - int charactersRead; /* How many characters were read? */ + Tcl_WideInt toRead; /* How many bytes to read? */ + size_t charactersRead; /* How many characters were read? */ int mode; /* Mode in which channel is opened. */ Tcl_Obj *resultPtr, *chanObjPtr; @@ -416,7 +416,7 @@ Tcl_ReadObjCmd( toRead = -1; if (i < objc) { - if ((TclGetIntFromObj(interp, objv[i], &toRead) != TCL_OK) + if ((TclGetWideIntFromObj(NULL, objv[i], &toRead) != TCL_OK) || (toRead < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected non-negative integer but got \"%s\"", @@ -430,7 +430,7 @@ Tcl_ReadObjCmd( Tcl_IncrRefCount(resultPtr); TclChannelPreserve(chan); charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0); - if (charactersRead < 0) { + if (charactersRead == TCL_IO_FAILURE) { /* * TIP #219. * Capture error messages put by the driver into the bypass area and diff --git a/generic/tclInt.h b/generic/tclInt.h index 6dac3ca..9caef63 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2828,9 +2828,9 @@ MODULE_SCOPE void TclAppendBytesToByteArray(Tcl_Obj *objPtr, const unsigned char *bytes, size_t len); MODULE_SCOPE int TclNREvalCmd(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); -MODULE_SCOPE void TclAdvanceContinuations(int *line, int **next, +MODULE_SCOPE void TclAdvanceContinuations(size_t *line, int **next, int loc); -MODULE_SCOPE void TclAdvanceLines(int *line, const char *start, +MODULE_SCOPE void TclAdvanceLines(size_t *line, const char *start, const char *end); MODULE_SCOPE void TclArgumentEnter(Tcl_Interp *interp, Tcl_Obj *objv[], int objc, CmdFrame *cf); @@ -2886,7 +2886,7 @@ MODULE_SCOPE int TclFindDictElement(Tcl_Interp *interp, size_t *sizePtr, int *literalPtr); /* TIP #280 - Modified token based evaluation, with line information. */ MODULE_SCOPE int TclEvalEx(Tcl_Interp *interp, const char *script, - size_t numBytes, int flags, int line, + size_t numBytes, int flags, size_t line, int *clNextOuter, const char *outerScript); MODULE_SCOPE Tcl_ObjCmdProc TclFileAttrsCmd; MODULE_SCOPE Tcl_ObjCmdProc TclFileCopyCmd; @@ -3012,7 +3012,7 @@ MODULE_SCOPE Tcl_Obj * TclLindexList(Tcl_Interp *interp, MODULE_SCOPE Tcl_Obj * TclLindexFlat(Tcl_Interp *interp, Tcl_Obj *listPtr, size_t indexCount, Tcl_Obj *const indexArray[]); /* TIP #280 */ -MODULE_SCOPE void TclListLines(Tcl_Obj *listObj, int line, int n, +MODULE_SCOPE void TclListLines(Tcl_Obj *listObj, size_t line, int n, int *lines, Tcl_Obj *const *elems); MODULE_SCOPE Tcl_Obj * TclListObjCopy(Tcl_Interp *interp, Tcl_Obj *listPtr); MODULE_SCOPE Tcl_Obj * TclListObjRange(Tcl_Obj *listPtr, size_t fromIdx, @@ -3161,7 +3161,7 @@ MODULE_SCOPE int TclStringMatch(const char *str, size_t strLen, MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, Tcl_Obj *patternObj, int flags); MODULE_SCOPE void TclSubstCompile(Tcl_Interp *interp, const char *bytes, - size_t numBytes, int flags, int line, + size_t numBytes, int flags, size_t line, struct CompileEnv *envPtr); MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, size_t numOpts, Tcl_Obj *const opts[], int *flagPtr); @@ -3169,7 +3169,7 @@ MODULE_SCOPE void TclSubstParse(Tcl_Interp *interp, const char *bytes, size_t numBytes, int flags, Tcl_Parse *parsePtr, Tcl_InterpState *statePtr); MODULE_SCOPE int TclSubstTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, - size_t count, int *tokensLeftPtr, int line, + size_t count, int *tokensLeftPtr, size_t line, int *clNextOuter, const char *outerScript); MODULE_SCOPE size_t TclTrim(const char *bytes, size_t numBytes, const char *trim, size_t numTrim, size_t *trimRight); diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index cb66206..42c9796 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -2326,7 +2326,7 @@ ClassFilterGet( Tcl_Obj *resultObj, *filterObj; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2360,7 +2360,7 @@ ClassFilterSet( size_t filterc; Tcl_Obj **filterv; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "filterList"); return TCL_ERROR; @@ -2407,7 +2407,7 @@ ClassMixinGet( Class *mixinPtr; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2444,7 +2444,7 @@ ClassMixinSet( Tcl_Obj **mixinv; Class **mixins; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "mixinList"); return TCL_ERROR; @@ -2513,7 +2513,7 @@ ClassSuperGet( Class *superPtr; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2550,7 +2550,7 @@ ClassSuperSet( Tcl_Obj **superv; Class **superclasses, *superPtr; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "superclassList"); return TCL_ERROR; @@ -2680,7 +2680,7 @@ ClassVarsGet( Tcl_Obj *resultObj; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2721,11 +2721,11 @@ ClassVarsSet( Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); - int i; + size_t i; size_t varc; Tcl_Obj **varv; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "filterList"); return TCL_ERROR; @@ -2744,7 +2744,7 @@ ClassVarsSet( return TCL_ERROR; } - for (i = 0; i < (int)varc; i++) { + for (i = 0; i < varc; i++) { const char *varName = TclGetString(varv[i]); if (strstr(varName, "::") != NULL) { @@ -2795,7 +2795,7 @@ ObjFilterGet( Tcl_Obj *resultObj, *filterObj; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2823,7 +2823,7 @@ ObjFilterSet( size_t filterc; Tcl_Obj **filterv; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "filterList"); return TCL_ERROR; @@ -2864,7 +2864,7 @@ ObjMixinGet( Class *mixinPtr; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2892,12 +2892,12 @@ ObjMixinSet( Tcl_Obj *const *objv) { Object *oPtr = (Object *) TclOOGetDefineCmdContext(interp); - int i; + size_t i; size_t mixinc; Tcl_Obj **mixinv; Class **mixins; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "mixinList"); return TCL_ERROR; @@ -2912,7 +2912,7 @@ ObjMixinSet( mixins = (Class **)TclStackAlloc(interp, sizeof(Class *) * mixinc); - for (i = 0; i < (int)mixinc; i++) { + for (i = 0; i < mixinc; i++) { mixins[i] = GetClassInOuterContext(interp, mixinv[i], "may only mix in classes"); if (mixins[i] == NULL) { @@ -2949,7 +2949,7 @@ ObjVarsGet( Tcl_Obj *resultObj; size_t i; - if ((int)Tcl_ObjectContextSkippedArgs(context) != objc) { + if (Tcl_ObjectContextSkippedArgs(context) != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, NULL); return TCL_ERROR; @@ -2987,7 +2987,7 @@ ObjVarsSet( size_t varc, i; Tcl_Obj **varv; - if ((int)Tcl_ObjectContextSkippedArgs(context) + 1 != objc) { + if (Tcl_ObjectContextSkippedArgs(context) + 1 != (size_t)objc) { Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv, "variableList"); return TCL_ERROR; diff --git a/generic/tclParse.c b/generic/tclParse.c index dc5ecac..bca1b0b 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -1707,7 +1707,7 @@ Tcl_ParseBraces( parsePtr->numTokens++; } TclGrowParseTokenArray(parsePtr, 2); - tokenPtr = &parsePtr->tokenPtr[(int)parsePtr->numTokens]; + tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; tokenPtr->type = TCL_TOKEN_BS; tokenPtr->start = src; tokenPtr->size = length; @@ -1978,7 +1978,7 @@ TclSubstParse( */ Tcl_Token *varTokenPtr = - parsePtr->tokenPtr + (int)parsePtr->numTokens - 2; + parsePtr->tokenPtr + parsePtr->numTokens - 2; if (varTokenPtr->type != TCL_TOKEN_VARIABLE) { Tcl_Panic("TclSubstParse: programming error"); @@ -2048,7 +2048,7 @@ TclSubstParse( */ TclGrowParseTokenArray(parsePtr, 1); - tokenPtr = &(parsePtr->tokenPtr[(int)parsePtr->numTokens]); + tokenPtr = &(parsePtr->tokenPtr[parsePtr->numTokens]); tokenPtr->start = parsePtr->term; tokenPtr->numComponents = 0; tokenPtr->type = TCL_TOKEN_COMMAND; @@ -2092,12 +2092,12 @@ TclSubstTokens( * errors. */ Tcl_Token *tokenPtr, /* Pointer to first in an array of tokens to * evaluate and concatenate. */ - size_t count1, /* Number of tokens to consider at tokenPtr. + size_t count, /* Number of tokens to consider at tokenPtr. * Must be at least 1. */ int *tokensLeftPtr, /* If not NULL, points to memory where an * integer representing the number of tokens * left to be substituted will be written */ - int line, /* The line the script starts on. */ + size_t line, /* The line the script starts on. */ int *clNextOuter, /* Information about an outer context for */ const char *outerScript) /* continuation line data. This is set by * EvalEx() to properly handle [...]-nested @@ -2119,11 +2119,11 @@ TclSubstTokens( Tcl_Obj *result; int code = TCL_OK; #define NUM_STATIC_POS 20 - int isLiteral, maxNumCL, numCL, i, adjust; + int isLiteral; + size_t i, maxNumCL, numCL, adjust; int *clPosition = NULL; Interp *iPtr = (Interp *) interp; int inFile = iPtr->evalFlags & TCL_EVAL_FILE; - int count = count1; /* * Each pass through this loop will substitute one token, and its @@ -2225,7 +2225,7 @@ TclSubstTokens( * Test cases: info-30.{6,8,9} */ - int theline; + size_t theline; TclAdvanceContinuations(&line, &clNextOuter, tokenPtr->start - outerScript); @@ -2450,7 +2450,7 @@ int Tcl_CommandComplete( const char *script) /* Script to check. */ { - return CommandComplete(script, (int) strlen(script)); + return CommandComplete(script, strlen(script)); } /* diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index afe96d9..5fe5412 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -155,7 +155,7 @@ Tcl_RegExpCompile( const char *pattern) /* String for which to produce compiled * regular expression. */ { - return (Tcl_RegExp) CompileRegexp(interp, pattern, (int) strlen(pattern), + return (Tcl_RegExp) CompileRegexp(interp, pattern, strlen(pattern), REG_ADVANCED); } diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index a85a002..68be8c7 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1258,7 +1258,7 @@ TeststringobjCmd( Tcl_ConvertToType(NULL, varPtr[varIndex], Tcl_GetObjType("string")); strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1; - length = (int) strPtr->allocated; + length = strPtr->allocated; } else { length = -1; } |