]> granicus.if.org Git - gc/commitdiff
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 010fb8a56dd2509dc2b5ee5f9a60bfe2b4b9bcf9..a4dbc0517f27706976221a3d900510bf4be72f31 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 85591a30e32a9023157b67adecda8c8bc8117ba4..3c3583e1b3ad1a330ec6b6503358466e5efe2c44 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.                */