diff options
author | dgp <dgp@users.sourceforge.net> | 2016-03-22 17:21:03 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-03-22 17:21:03 (GMT) |
commit | 69d4a9d89e969992abde2118b6ba7836b35277a4 (patch) | |
tree | cebf6d4800cb288d091015cf17a9a56adfcd1189 | |
parent | 740454d17abd5e8a134601126ac05d0988dbc13f (diff) | |
parent | 43697f3b2178f95e0e0d803a186c5081b4743d3a (diff) | |
download | tcl-69d4a9d89e969992abde2118b6ba7836b35277a4.zip tcl-69d4a9d89e969992abde2118b6ba7836b35277a4.tar.gz tcl-69d4a9d89e969992abde2118b6ba7836b35277a4.tar.bz2 |
Revised fix for signed/unsigned mismatch. "get types right" > "add more casts"
-rw-r--r-- | generic/tclCompCmdsSZ.c | 2 | ||||
-rw-r--r-- | generic/tclCompExpr.c | 8 | ||||
-rw-r--r-- | generic/tclCompile.h | 6 | ||||
-rw-r--r-- | generic/tclEnsemble.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index ef9340e..101edbd 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -2028,7 +2028,7 @@ IssueSwitchChainedTests( int foundDefault; /* Flag to indicate whether a "default" clause * is present. */ JumpFixup *fixupArray; /* Array of forward-jump fixup records. */ - int *fixupTargetArray; /* Array of places for fixups to point at. */ + unsigned int *fixupTargetArray; /* Array of places for fixups to point at. */ int fixupCount; /* Number of places to fix up. */ int contFixIndex; /* Where the first of the jumps due to a group * of continuation bodies starts, or -1 if diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 2ffcc68..4390282 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -564,13 +564,13 @@ ParseExpr( { OpNode *nodes = NULL; /* Pointer to the OpNode storage array where * we build the parse tree. */ - int nodesAvailable = 64; /* Initial size of the storage array. This + unsigned int nodesAvailable = 64; /* Initial size of the storage array. This * value establishes a minimum tree memory * cost of only about 1 kibyte, and is large * enough for most expressions to parse with * no need for array growth and * reallocation. */ - int nodesUsed = 0; /* Number of OpNodes filled. */ + unsigned int nodesUsed = 0; /* Number of OpNodes filled. */ int scanned = 0; /* Capture number of byte scanned by parsing * routines. */ int lastParsed; /* Stores info about what the lexeme parsed @@ -662,11 +662,11 @@ ParseExpr( */ if (nodesUsed >= nodesAvailable) { - int size = nodesUsed * 2; + unsigned int size = nodesUsed * 2; OpNode *newPtr = NULL; do { - if (size <= (int)(UINT_MAX/sizeof(OpNode))) { + if (size <= UINT_MAX/sizeof(OpNode)) { newPtr = attemptckrealloc(nodes, size * sizeof(OpNode)); } } while ((newPtr == NULL) diff --git a/generic/tclCompile.h b/generic/tclCompile.h index b5bfab1..d5bc86b 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -135,7 +135,7 @@ typedef struct ExceptionAux { int numBreakTargets; /* The number of [break]s that want to be * targeted to the place where this loop * exception will be bound to. */ - int *breakTargets; /* The offsets of the INST_JUMP4 instructions + unsigned int *breakTargets; /* The offsets of the INST_JUMP4 instructions * issued by the [break]s that we must * update. Note that resizing a jump (via * TclFixupForwardJump) can cause the contents @@ -145,7 +145,7 @@ typedef struct ExceptionAux { int numContinueTargets; /* The number of [continue]s that want to be * targeted to the place where this loop * exception will be bound to. */ - int *continueTargets; /* The offsets of the INST_JUMP4 instructions + unsigned int *continueTargets; /* The offsets of the INST_JUMP4 instructions * issued by the [continue]s that we must * update. Note that resizing a jump (via * TclFixupForwardJump) can cause the contents @@ -928,7 +928,7 @@ typedef enum { typedef struct JumpFixup { TclJumpType jumpType; /* Indicates the kind of jump. */ - int codeOffset; /* Offset of the first byte of the one-byte + unsigned int 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 diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 6b6a156..986a553 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3081,7 +3081,7 @@ TclAttemptCompileProc( int result, i; Tcl_Token *saveTokenPtr = parsePtr->tokenPtr; int savedStackDepth = envPtr->currStackDepth; - int savedCodeNext = envPtr->codeNext - envPtr->codeStart; + unsigned savedCodeNext = envPtr->codeNext - envPtr->codeStart; int savedAuxDataArrayNext = envPtr->auxDataArrayNext; int savedExceptArrayNext = envPtr->exceptArrayNext; #ifdef TCL_COMPILE_DEBUG |