]> granicus.if.org Git - gc/commitdiff
Workaround 'checking if unsigned value is negative' cppcheck warning
authorIvan Maidanski <ivmai@mail.ru>
Mon, 17 Oct 2016 21:28:25 +0000 (00:28 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 1 Nov 2016 22:14:26 +0000 (01:14 +0300)
* allchblk.c [GC_ASSERTIONS && !USE_MUNMAP] (GC_add_to_fl): Replace
(signed_word)GC_heapsize<0 with (GC_heapsize&SIGNB)!=0.

allchblk.c

index a2299d396c54dfb8daaa98986cdf4ca58f4c9044..ed249a891359a672134ca093076b70ba57c31c1b 100644 (file)
@@ -360,10 +360,10 @@ STATIC void GC_add_to_fl(struct hblk *h, hdr *hhdr)
       struct hblk *prev = GC_free_block_ending_at(h);
       hdr * prevhdr = HDR(prev);
       GC_ASSERT(nexthdr == 0 || !HBLK_IS_FREE(nexthdr)
-                || (signed_word)GC_heapsize < 0);
+                || (GC_heapsize & SIGNB) != 0);
                 /* In the last case, blocks may be too large to merge. */
       GC_ASSERT(prev == 0 || !HBLK_IS_FREE(prevhdr)
-                || (signed_word)GC_heapsize < 0);
+                || (GC_heapsize & SIGNB) != 0);
 #   endif
 
     GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0);