diff options
author | bch <brad.harder@gmail.com> | 2020-11-26 03:49:18 (GMT) |
---|---|---|
committer | bch <brad.harder@gmail.com> | 2020-11-26 03:49:18 (GMT) |
commit | c53412abcf8c4ce4eb65bde9e5c72d5d5611b5ad (patch) | |
tree | 946c62ed9ecf05e38f216b3d2557531ca252a7f5 /generic | |
parent | 4a6876c53700885e4b6c5b9613d59784387c0b82 (diff) | |
download | tcl-c53412abcf8c4ce4eb65bde9e5c72d5d5611b5ad.zip tcl-c53412abcf8c4ce4eb65bde9e5c72d5d5611b5ad.tar.gz tcl-c53412abcf8c4ce4eb65bde9e5c72d5d5611b5ad.tar.bz2 |
adjust for() loop controls to squelch sign-compare warning, move maxSizeDecade assignment to maintain identical functionality
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 466e89e..91bcb91 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -9612,12 +9612,13 @@ EvalStatsCmd( break; } } - for (i = 31; i >= 0; i--) { + for (i = 31; i; i--) { if (statsPtr->srcCount[i] > 0) { - maxSizeDecade = i; - break; + break; /* maxSizeDecade to consume 'i' value + * below... */ } } + maxSizeDecade = i; sum = 0; for (i = minSizeDecade; i <= maxSizeDecade; i++) { decadeHigh = (1 << (i+1)) - 1; @@ -9635,12 +9636,13 @@ EvalStatsCmd( break; } } - for (i = 31; i >= 0; i--) { + for (i = 31; i; i--) { if (statsPtr->byteCodeCount[i] > 0) { - maxSizeDecade = i; - break; + break; /* maxSizeDecade to consume 'i' value + * below... */ } } + maxSizeDecade = i; sum = 0; for (i = minSizeDecade; i <= maxSizeDecade; i++) { decadeHigh = (1 << (i+1)) - 1; @@ -9658,12 +9660,13 @@ EvalStatsCmd( break; } } - for (i = 31; i >= 0; i--) { + for (i = 31; i; i--) { if (statsPtr->lifetimeCount[i] > 0) { - maxSizeDecade = i; - break; + break; /* maxSizeDecade to consume 'i' value + * below... */ } } + maxSizeDecade = i; sum = 0; for (i = minSizeDecade; i <= maxSizeDecade; i++) { decadeHigh = (1 << (i+1)) - 1; |