From: Nathan Moinvaziri Date: Wed, 27 May 2020 00:21:13 +0000 (-0700) Subject: Fixed casting warnings in trees.c with count being int and freq being uint16_t. X-Git-Tag: 1.9.9-b1~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75da91b7ed68def36e4a76ed694691d8963e63ed;p=thirdparty%2Fzlib-ng.git Fixed casting warnings in trees.c with count being int and freq being uint16_t. Changed to use uint16_t for all counting variable types. trees.c(431,45): warning C4244: '+=': conversion from 'int' to 'uint16_t', possible loss of data trees.c(431,45): warning C4244: '+=': conversion from 'int' to 'uint16_t', possible loss of data --- diff --git a/trees.c b/trees.c index dc7757e8..cfa04120 100644 --- a/trees.c +++ b/trees.c @@ -413,9 +413,9 @@ static void scan_tree(deflate_state *s, ct_data *tree, int max_code) { int prevlen = -1; /* last emitted length */ int curlen; /* length of current code */ int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ + uint16_t count = 0; /* repeat count of the current code */ + uint16_t max_count = 7; /* max repeat count */ + uint16_t min_count = 4; /* min repeat count */ if (nextlen == 0) max_count = 138, min_count = 3;