From 08545b98c621ca2303108db79154046f360451eb Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Wed, 9 Jan 2002 23:07:34 +0000 Subject: Cleanups (Tim Beckmann) --- src/win95/huffman.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/win95/huffman.cpp') diff --git a/src/win95/huffman.cpp b/src/win95/huffman.cpp index b9523d9..f641071 100644 --- a/src/win95/huffman.cpp +++ b/src/win95/huffman.cpp @@ -236,7 +236,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth) unsigned int promotions, excess, hi; goal = 1 << maxdepth; - for (n = 0, sum = 0, items = 0; n <= maxdepth; n++) + for (n = 0, sum = 0, items = 0; n <= (unsigned int)maxdepth; n++) { items += depth[n]; sum += (goal >> n) * depth[n]; @@ -249,7 +249,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth) { gain = (1 << (maxdepth - n)) - 1; busts = (sum - goal + gain - 1) / gain; - busts = depth[n] < busts ? depth[n] : busts; + busts = (unsigned int)depth[n] < busts ? depth[n] : busts; depth[n] -= busts; depth[maxdepth] += busts; sum -= busts * gain; @@ -259,7 +259,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth) for (n = 0; excess; n++) { hi = 1 << (maxdepth - n); - for (m = n + 1; m <= maxdepth; m++) + for (m = n + 1; m <= (unsigned int)maxdepth; m++) { gain = hi - (1 << (maxdepth - m)); if (excess < gain) @@ -267,7 +267,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth) if (depth[m]) { promotions = excess / gain; - promotions = depth[m] > promotions ? promotions : depth[m]; + promotions = (unsigned int)depth[m] > promotions ? promotions : depth[m]; depth[n] += promotions; depth[m] -= promotions; excess -= promotions * gain; -- cgit v1.3