diff --git a/allchblk.c b/allchblk.c index 8cb6e4792..5d2b1e7d8 100644 --- a/allchblk.c +++ b/allchblk.c @@ -187,7 +187,7 @@ STATIC int GC_hblk_fl_from_blocks(size_t blocks_needed) GC_API void GC_CALL GC_dump_regions(void) { - unsigned i; + size_t i; for (i = 0; i < GC_n_heap_sects; ++i) { ptr_t start = GC_heap_sects[i].hs_start; diff --git a/alloc.c b/alloc.c index e3519c139..4a3093f6a 100644 --- a/alloc.c +++ b/alloc.c @@ -1403,7 +1403,7 @@ STATIC void GC_add_to_heap(struct hblk *h, size_t sz) size_t old_capacity = 0; void *old_heap_sects = NULL; # ifdef GC_ASSERTIONS - unsigned i; + size_t i; # endif GC_ASSERT(I_HOLD_LOCK()); @@ -1417,14 +1417,14 @@ STATIC void GC_add_to_heap(struct hblk *h, size_t sz) # ifndef INITIAL_HEAP_SECTS # define INITIAL_HEAP_SECTS 32 # endif - size_t new_capacity = GC_n_heap_sects > 0 ? - (size_t)GC_n_heap_sects * 2 : INITIAL_HEAP_SECTS; + size_t new_capacity = GC_n_heap_sects > 0 + ? GC_n_heap_sects * 2 : INITIAL_HEAP_SECTS; void *new_heap_sects = GC_scratch_alloc(new_capacity * sizeof(struct HeapSect)); if (NULL == new_heap_sects) { /* Retry with smaller yet sufficient capacity. */ - new_capacity = (size_t)GC_n_heap_sects + INITIAL_HEAP_SECTS; + new_capacity = GC_n_heap_sects + INITIAL_HEAP_SECTS; new_heap_sects = GC_scratch_alloc(new_capacity * sizeof(struct HeapSect)); if (NULL == new_heap_sects) @@ -1521,7 +1521,7 @@ STATIC void GC_add_to_heap(struct hblk *h, size_t sz) #if !defined(NO_DEBUGGING) void GC_print_heap_sects(void) { - unsigned i; + size_t i; GC_printf("Total heap size: %lu" IF_USE_MUNMAP(" (%lu unmapped)") "\n", (unsigned long)GC_heapsize /*, */ diff --git a/blacklst.c b/blacklst.c index df1271988..73f001fd2 100644 --- a/blacklst.c +++ b/blacklst.c @@ -290,7 +290,7 @@ STATIC word GC_number_stack_black_listed(struct hblk *start, /* Return the total number of (stack) black-listed bytes. */ static word total_stack_black_listed(void) { - unsigned i; + size_t i; word total = 0; for (i = 0; i < GC_n_heap_sects; i++) { diff --git a/checksums.c b/checksums.c index 9c728fc15..0c130a9eb 100644 --- a/checksums.c +++ b/checksums.c @@ -58,7 +58,7 @@ STATIC GC_bool GC_was_faulted(struct hblk *h) STATIC word GC_checksum(struct hblk *h) { word *p; - word *lim = (word *)(h+1); + word *lim = (word *)(h + 1); word result = 0; for (p = (word *)h; ADDR_LT((ptr_t)p, (ptr_t)lim); p++) { @@ -138,7 +138,7 @@ STATIC void GC_check_blocks(void) void GC_check_dirty(void) { int index; - unsigned i; + size_t i; GC_check_blocks(); GC_n_dirty_errors = 0; diff --git a/extra/MacOS.c b/extra/MacOS.c index a2a978a64..87a68a437 100644 --- a/extra/MacOS.c +++ b/extra/MacOS.c @@ -100,7 +100,7 @@ Ptr GC_MacTemporaryNewPtr(size_t size, Boolean clearMemory) static void perform_final_collection(void) { unsigned i; - word last_fo_entries = 0; + size_t last_fo_entries = 0; /* adjust the stack bottom, because CFM calls us from another stack location. */ diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 606652d98..9855305ff 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1533,7 +1533,7 @@ struct _GC_arrays { # define GC_capacity_heap_sects GC_arrays._capacity_heap_sects size_t _capacity_heap_sects; # define GC_n_heap_sects GC_arrays._n_heap_sects - word _n_heap_sects; /* Number of separately added heap sections. */ + size_t _n_heap_sects; /* number of separately added heap sections */ # ifdef ANY_MSWIN # define GC_n_heap_bases GC_arrays._n_heap_bases size_t _n_heap_bases; /* see GC_heap_bases[] */ @@ -1547,7 +1547,7 @@ struct _GC_arrays { ptr_t *_gcjobjfreelist; # endif # define GC_fo_entries GC_arrays._fo_entries - word _fo_entries; + size_t _fo_entries; # ifndef GC_NO_FINALIZATION # define GC_dl_hashtbl GC_arrays._dl_hashtbl # define GC_fnlz_roots GC_arrays._fnlz_roots