From 01d30994c3ddbf13d1ab211bf563d60f0aff659b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 21 Aug 2011 11:45:57 +0400 Subject: [PATCH] /cygdrive/c/temp/log --- allchblk.c | 10 +++++----- mallocx.c | 2 +- mark.c | 3 ++- misc.c | 4 ++-- obj_map.c | 2 +- os_dep.c | 2 +- ptr_chck.c | 2 +- typd_mlc.c | 7 ++++--- 8 files changed, 17 insertions(+), 15 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 diff --git a/mallocx.c b/mallocx.c index d92014c..e592835 100644 --- a/mallocx.c +++ b/mallocx.c @@ -377,7 +377,7 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t lb, int k, void **result) my_bytes_allocd = 0; for (p = op; p != 0; p = obj_link(p)) { my_bytes_allocd += lb; - if (my_bytes_allocd >= HBLKSIZE) { + if ((word)my_bytes_allocd >= HBLKSIZE) { *opp = obj_link(p); obj_link(p) = 0; break; diff --git a/mark.c b/mark.c index 9a34082..434bec7 100644 --- a/mark.c +++ b/mark.c @@ -986,7 +986,8 @@ STATIC void GC_do_local_mark(mse *local_mark_stack, mse *local_top) local_top = GC_mark_from(local_top, local_mark_stack, local_mark_stack + LOCAL_MARK_STACK_SIZE); if (local_top < local_mark_stack) return; - if (local_top - local_mark_stack >= LOCAL_MARK_STACK_SIZE/2) { + if ((word)(local_top - local_mark_stack) + >= LOCAL_MARK_STACK_SIZE / 2) { GC_return_mark_stack(local_mark_stack, local_top); return; } diff --git a/misc.c b/misc.c index ab3fef9..2ea209f 100644 --- a/misc.c +++ b/misc.c @@ -375,7 +375,7 @@ GC_API void * GC_CALL GC_base(void * p) r = (ptr_t)((word)r & ~(WORDS_TO_BYTES(1) - 1)); { size_t offset = HBLKDISPL(r); - signed_word sz = candidate_hdr -> hb_sz; + word sz = candidate_hdr -> hb_sz; size_t obj_displ = offset % sz; r -= obj_displ; @@ -1257,7 +1257,7 @@ GC_API void GC_CALL GC_enable_incremental(void) IF_CANCEL(int cancel_state;) DISABLE_CANCEL(cancel_state); - while (bytes_written < len) { + while ((size_t)bytes_written < len) { # ifdef GC_SOLARIS_THREADS result = syscall(SYS_write, fd, buf + bytes_written, len - bytes_written); diff --git a/obj_map.c b/obj_map.c index 082a0aa..ed75ef1 100644 --- a/obj_map.c +++ b/obj_map.c @@ -78,7 +78,7 @@ GC_INNER void GC_register_displacement_inner(size_t offset) GC_INNER void GC_initialize_offsets(void) { - int i; + unsigned i; if (GC_all_interior_pointers) { for (i = 0; i < VALID_OFFSET_SZ; ++i) GC_valid_offsets[i] = TRUE; diff --git a/os_dep.c b/os_dep.c index 3cc6fff..82223e9 100644 --- a/os_dep.c +++ b/os_dep.c @@ -2627,7 +2627,7 @@ STATIC void GC_default_push_other_roots(void) /* Add all pages in pht2 to pht1 */ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2) { - register int i; + register unsigned i; for (i = 0; i < PHT_SIZE; i++) pht1[i] |= pht2[i]; } diff --git a/ptr_chck.c b/ptr_chck.c index d8076e8..5b3cc0a 100644 --- a/ptr_chck.c +++ b/ptr_chck.c @@ -226,7 +226,7 @@ GC_API void * GC_CALL GC_is_visible(void *p) if ((word)((ptr_t)p - (ptr_t)base) > (word)descr) goto fail; break; case GC_DS_BITMAP: - if ((ptr_t)p - (ptr_t)base + if ((word)((ptr_t)p - (ptr_t)base) >= WORDS_TO_BYTES(BITMAP_BITS) || ((word)p & (sizeof(word) - 1))) goto fail; if (!(((word)1 << (WORDSZ - ((ptr_t)p - (ptr_t)base) - 1)) 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; -- 2.7.4