]> granicus.if.org Git - gc/commitdiff
Fix 'signed-to-bigger-unsigned value assignment' in GC_init_size_map
authorIvan Maidanski <ivmai@mail.ru>
Wed, 17 Feb 2016 07:42:57 +0000 (10:42 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 11 Mar 2016 21:05:30 +0000 (00:05 +0300)
* misc.c (GC_init_size_map): Cast ROUNDED_UP_GRANULES() result to
unsigned int explicitly (which is, in turn, cast to size_t implicitly).

misc.c

diff --git a/misc.c b/misc.c
index 73c4e21ec3a83f3d8aca576b93c92e167c6b371d..cf4763b801bac29cf4b0ce360e6e0ba2d8e9e8f4 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -232,7 +232,7 @@ STATIC void GC_init_size_map(void)
     /* This avoids problems at lower levels.            */
       GC_size_map[0] = 1;
     for (i = 1; i <= GRANULES_TO_BYTES(TINY_FREELISTS-1) - EXTRA_BYTES; i++) {
-        GC_size_map[i] = ROUNDED_UP_GRANULES(i);
+        GC_size_map[i] = (unsigned)ROUNDED_UP_GRANULES(i);
 #       ifndef _MSC_VER
           GC_ASSERT(GC_size_map[i] < TINY_FREELISTS);
           /* Seems to tickle bug in VC++ 2008 for AMD64 */