From 9fd216db06cd8150d5d859aa06fb9f7571d66548 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 13 Aug 2013 13:12:59 -0400 Subject: [PATCH] Fixed some compiler warnings in libgc --- libgc/alloc.c | 2 +- libgc/obj_map.c | 2 +- libgc/ptr_chck.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libgc/alloc.c b/libgc/alloc.c index 9ec6992352ad..b6bc1832c994 100644 --- a/libgc/alloc.c +++ b/libgc/alloc.c @@ -969,7 +969,7 @@ word n; } # endif expansion_slop = WORDS_TO_BYTES(min_words_allocd()) + 4*MAXHINCR*HBLKSIZE; - if (GC_last_heap_addr == 0 && !((word)space & SIGNB) + if ((GC_last_heap_addr == 0 && !((word)space & SIGNB)) || (GC_last_heap_addr != 0 && GC_last_heap_addr < (ptr_t)space)) { /* Assume the heap is growing up */ GC_greatest_plausible_heap_addr = diff --git a/libgc/obj_map.c b/libgc/obj_map.c index 39993451cc71..49f6add1553d 100644 --- a/libgc/obj_map.c +++ b/libgc/obj_map.c @@ -22,7 +22,7 @@ # include "private/gc_priv.h" map_entry_type * GC_invalid_map = 0; -static max_valid_offset = 0; +static word max_valid_offset = 0; /* Invalidate the object map associated with a block. Free blocks */ /* are identified by invalid maps. */ diff --git a/libgc/ptr_chck.c b/libgc/ptr_chck.c index d83d730d3433..621a45f0346f 100644 --- a/libgc/ptr_chck.c +++ b/libgc/ptr_chck.c @@ -165,7 +165,7 @@ void (*GC_is_valid_displacement_print_proc) GC_PROTO((GC_PTR)) = pdispl = HBLKDISPL(p); map_entry = MAP_ENTRY((hhdr -> hb_map), pdispl); if (map_entry == OBJ_INVALID - || sz > MAXOBJBYTES && (ptr_t)p >= (ptr_t)h + sz) { + || (sz > MAXOBJBYTES && (ptr_t)p >= (ptr_t)h + sz)) { goto fail; } return(p);