From: Ivan Maidanski Date: Mon, 17 Oct 2016 21:28:25 +0000 (+0300) Subject: Workaround 'checking if unsigned value is negative' cppcheck warning X-Git-Tag: v8.0.0~1107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3964267d6b18ec66f72aedba0993535303fe8066;p=gc Workaround 'checking if unsigned value is negative' cppcheck warning * allchblk.c [GC_ASSERTIONS && !USE_MUNMAP] (GC_add_to_fl): Replace (signed_word)GC_heapsize<0 with (GC_heapsize&SIGNB)!=0. --- diff --git a/allchblk.c b/allchblk.c index 16e82b78..56ee86ef 100644 --- a/allchblk.c +++ b/allchblk.c @@ -362,10 +362,10 @@ STATIC void GC_add_to_fl(struct hblk *h, hdr *hhdr) 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); GC_hblkfreelist[index] = h;