summaryrefslogtreecommitdiff
path: root/obj_map.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-02-16 23:34:43 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-02-16 23:34:43 +0300
commit3883587204afd0415ee78a49da2e79de34ea05ac (patch)
treeec4ddfc608838fb7a2ad810af594c17d9823cb9c /obj_map.c
parentaee1c54b3b42d507b4413806b6b0c9fe28ebb18e (diff)
downloadbdwgc-3883587204afd0415ee78a49da2e79de34ea05ac.tar.gz
Fix 'signed-to-bigger-unsigned value assignment' warning for hb_map
* include/private/gc_priv.h (hblkhdr): Change type of hb_map from short to unsigned short. * include/private/gc_priv.h (_GC_arrays): Change type of _obj_map from short to unsigned short. * obj_map.c (GC_add_map_entry): Change type of new_map local variable from short to unsigned short.
Diffstat (limited to 'obj_map.c')
-rw-r--r--obj_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/obj_map.c b/obj_map.c
index c935bf3f..9fdeb0af 100644
--- a/obj_map.c
+++ b/obj_map.c
@@ -51,13 +51,13 @@ GC_INNER void GC_register_displacement_inner(size_t offset)
GC_INNER GC_bool GC_add_map_entry(size_t granules)
{
unsigned displ;
- short * new_map;
+ unsigned short * new_map;
if (granules > BYTES_TO_GRANULES(MAXOBJBYTES)) granules = 0;
if (GC_obj_map[granules] != 0) {
return(TRUE);
}
- new_map = (short *)GC_scratch_alloc(MAP_LEN * sizeof(short));
+ new_map = (unsigned short *)GC_scratch_alloc(MAP_LEN * sizeof(short));
if (new_map == 0) return(FALSE);
GC_COND_LOG_PRINTF(
"Adding block map for size of %u granules (%u bytes)\n",
@@ -68,7 +68,7 @@ GC_INNER void GC_register_displacement_inner(size_t offset)
}
} else {
for (displ = 0; displ < BYTES_TO_GRANULES(HBLKSIZE); displ++) {
- new_map[displ] = (short)(displ % granules);
+ new_map[displ] = (unsigned short)(displ % granules);
}
}
GC_obj_map[granules] = new_map;