From: Ivan Maidanski Date: Tue, 29 May 2018 17:51:48 +0000 (+0300) Subject: Eliminate 'comparing signed and unsigned values' compiler warnings (bcc) X-Git-Tag: v8.0.0~156 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=387a566a204af010496260113e2311bb04a6a529;p=gc Eliminate 'comparing signed and unsigned values' compiler warnings (bcc) * allchblk.c (GC_allochblk_nth): Cast HBLKSIZE to signed_word in comparison to size_needed. * reclaim.c (GC_reclaim_all): Cast hhdr->hb_last_reclaimed to word in comparison to GC_gc_no-1. --- diff --git a/allchblk.c b/allchblk.c index 010fb8a5..a4dbc051 100644 --- a/allchblk.c +++ b/allchblk.c @@ -754,7 +754,8 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split) GC_large_alloc_warn_suppressed = 0; } size_avail = orig_avail; - } else if (size_avail == 0 && size_needed == HBLKSIZE + } else if (size_avail == 0 + && size_needed == (signed_word)HBLKSIZE && IS_MAPPED(hhdr)) { if (!GC_find_leak) { static unsigned count = 0; diff --git a/reclaim.c b/reclaim.c index 85591a30..3c3583e1 100644 --- a/reclaim.c +++ b/reclaim.c @@ -738,7 +738,8 @@ GC_INNER GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old) } hhdr = HDR(hbp); *rlh = hhdr -> hb_next; - if (!ignore_old || hhdr -> hb_last_reclaimed == GC_gc_no - 1) { + if (!ignore_old + || (word)hhdr->hb_last_reclaimed == GC_gc_no - 1) { /* It's likely we'll need it this time, too */ /* It's been touched recently, so this */ /* shouldn't trigger paging. */