summaryrefslogtreecommitdiff
path: root/allchblk.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 /allchblk.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 'allchblk.c')
-rw-r--r--allchblk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/allchblk.c b/allchblk.c
index efcc00a..dc35bc2 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -680,14 +680,14 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n,
}
}
}
- if ( !IS_UNCOLLECTABLE(kind) &&
- (kind != PTRFREE || size_needed > MAX_BLACK_LIST_ALLOC)) {
+ if ( !IS_UNCOLLECTABLE(kind) && (kind != PTRFREE
+ || size_needed > (signed_word)MAX_BLACK_LIST_ALLOC)) {
struct hblk * lasthbp = hbp;
ptr_t search_end = (ptr_t)hbp + size_avail - size_needed;
signed_word orig_avail = size_avail;
- signed_word eff_size_needed = ((flags & IGNORE_OFF_PAGE)?
- HBLKSIZE
- : size_needed);
+ signed_word eff_size_needed = (flags & IGNORE_OFF_PAGE) != 0 ?
+ (signed_word)HBLKSIZE
+ : size_needed;
while ((ptr_t)lasthbp <= search_end