Eliminate 'comparing signed and unsigned values' compiler warnings (bcc)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 29 May 2018 17:51:48 +0000 (20:51 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 29 May 2018 17:51:48 +0000 (20:51 +0300)
* 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.

allchblk.c
reclaim.c

index 010fb8a..a4dbc05 100644 (file)
@@ -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;
index 85591a3..3c3583e 100644 (file)
--- 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.                */