]> 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>
Wed, 17 Feb 2016 07:42:57 +0000 (10:42 +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 d28d3d818bf75974ea6fc59dafa44f4d7b220169..b4550e1694137f90b4c2ad5445f09743beae5de3 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -236,7 +236,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 */