summaryrefslogtreecommitdiff
path: root/typd_mlc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-08-21 09:45:57 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-09-12 10:41:47 +0200
commitbec60375e750fb413118ea50e388a3b0f076fdcb (patch)
tree02e3c26ae94b504d671f00a6badbb67b59a77a6c /typd_mlc.c
parent83d1405f500cbb941148dee3f316aaaeb2bf5fab (diff)
Resolve "comparison of signed and unsigned values" compiler warnings.
* allchblk.c (GC_allochblk_nth): Cast MAX_BLACK_LIST_ALLOC and HBLKSIZE to signed_word. * mallocx.c (GC_generic_malloc_many): Cast my_bytes_allocd to word. * mark.c (GC_do_local_mark): Cast the result of local_top minus local_mark_stack to word (since is non-negative). * misc.c (GC_base): Declare sz as unsigned word. * misc.c (GC_enable_incremental): Cast bytes_written to size_t in comparison to len. * obj_map.c (GC_initialize_offsets): Declare 'i' as unsigned. * os_dep.c (GC_or_pages): Ditto. * typd_mlc.c (GC_init_explicit_typing): Ditto. * ptr_chck.c (GC_is_visible): Cast the result of p minus base to word. * typd_mlc.c (GC_make_descriptor): Cast last_set_bit to word (since non-negative) when compared to BITMAP_BITS.
Diffstat (limited to 'typd_mlc.c')
-rw-r--r--typd_mlc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/typd_mlc.c b/typd_mlc.c
index b031f61..32a9b0f 100644
--- a/typd_mlc.c
+++ b/typd_mlc.c
@@ -346,7 +346,7 @@ STATIC mse * GC_array_mark_proc(word * addr, mse * mark_stack_ptr,
/* Caller does not hold allocation lock. */
STATIC void GC_init_explicit_typing(void)
{
- register int i;
+ register unsigned i;
DCL_LOCK_STATE;
GC_STATIC_ASSERT(sizeof(struct LeafDescriptor) % sizeof(word) == 0);
@@ -540,7 +540,8 @@ GC_API GC_descr GC_CALL GC_make_descriptor(GC_bitmap bm, size_t len)
# define HIGH_BIT (((word)1) << (WORDSZ - 1))
if (!GC_explicit_typing_initialized) GC_init_explicit_typing();
- while (last_set_bit >= 0 && !GC_get_bit(bm, last_set_bit)) last_set_bit --;
+ while (last_set_bit >= 0 && !GC_get_bit(bm, last_set_bit))
+ last_set_bit--;
if (last_set_bit < 0) return(0 /* no pointers */);
# if ALIGNMENT == CPP_WORDSZ/8
{
@@ -557,7 +558,7 @@ GC_API GC_descr GC_CALL GC_make_descriptor(GC_bitmap bm, size_t len)
}
}
# endif
- if (last_set_bit < BITMAP_BITS) {
+ if ((word)last_set_bit < BITMAP_BITS) {
/* Hopefully the common case. */
/* Build bitmap descriptor (with bits reversed) */
result = HIGH_BIT;