diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-12-17 22:09:28 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-12-17 22:09:28 +0000 |
commit | 7bf8a1976148b0292d4ac560fd0ae67057fe98e2 (patch) | |
tree | 51fb5042edb65854784f1c33f11513b7fab2f43c /other | |
parent | 5cd8c6a920340925e0ddf5d2b6474cda66ff2378 (diff) | |
download | netpbm-mirror-7bf8a1976148b0292d4ac560fd0ae67057fe98e2.tar.gz netpbm-mirror-7bf8a1976148b0292d4ac560fd0ae67057fe98e2.tar.xz netpbm-mirror-7bf8a1976148b0292d4ac560fd0ae67057fe98e2.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4478 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other')
-rw-r--r-- | other/pnmcolormap.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c index 477b0377..f10cc15c 100644 --- a/other/pnmcolormap.c +++ b/other/pnmcolormap.c @@ -436,13 +436,13 @@ computeBoxSpread(const struct Box * const boxP, static unsigned int -freqTotal(tupletable2 const freqtable) { +freqTotal(tupletable2 const freqTable) { unsigned int i; unsigned int sum; - for (i = 0, sum = 0; i < freqtable.size; ++i) - sum += freqtable.table[i]->value; + for (i = 0, sum = 0; i < freqTable.size; ++i) + sum += freqTable.table[i]->value; return sum; } @@ -669,7 +669,7 @@ splitBox(struct BoxVector * const boxVectorP, unsigned int const sum = boxVectorP->box[boxIdx].sum; unsigned int medianIndex; - int lowersum; + unsigned int lowerSum; /* Number of pixels whose value is "less than" the median */ @@ -692,9 +692,9 @@ splitBox(struct BoxVector * const boxVectorP, */ unsigned int i; - lowersum = colorFreqTable.table[boxStart]->value; /* initial value */ - for (i = 1; i < boxSize - 1 && lowersum < sum/2; ++i) { - lowersum += colorFreqTable.table[boxStart + i]->value; + lowerSum = colorFreqTable.table[boxStart]->value; /* initial value */ + for (i = 1; i < boxSize - 1 && lowerSum < sum/2; ++i) { + lowerSum += colorFreqTable.table[boxStart + i]->value; } medianIndex = i; } @@ -703,7 +703,7 @@ splitBox(struct BoxVector * const boxVectorP, struct Box * const oldBoxP = &boxVectorP->box[boxIdx]; oldBoxP->colorCt = medianIndex; - oldBoxP->sum = lowersum; + oldBoxP->sum = lowerSum; computeBoxSpread(oldBoxP, colorFreqTable, depth, methodForLargest, &oldBoxP->maxdim, &oldBoxP->spread); } @@ -712,7 +712,7 @@ splitBox(struct BoxVector * const boxVectorP, newBoxP->index = boxStart + medianIndex; newBoxP->colorCt = boxSize - medianIndex; - newBoxP->sum = sum - lowersum; + newBoxP->sum = sum - lowerSum; computeBoxSpread(newBoxP, colorFreqTable, depth, methodForLargest, &newBoxP->maxdim, &newBoxP->spread); ++boxVectorP->boxCt; |