diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-10-05 23:58:00 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-10-05 23:58:00 +0300 |
commit | b3692f94bf1eb991c242115fb938a47b59de43be (patch) | |
tree | 759f44df6cd9424c6f68f737e4750b2c66027236 /allchblk.c | |
parent | 8a72b0059569406bfc9dd9811f6ef48206ccc75a (diff) | |
download | bdwgc-b3692f94bf1eb991c242115fb938a47b59de43be.tar.gz |
Eliminate 'scope of variable can be reduced' cppcheck warning in allchblk
* allchblk.c [USE_MUNMAP] (GC_merge_unmapped): Move local variable
declarations to the inner scope where the variables are actually used.
Diffstat (limited to 'allchblk.c')
-rw-r--r-- | allchblk.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -419,14 +419,16 @@ GC_INNER void GC_unmap_old(void) /* fully mapped or fully unmapped. */ GC_INNER void GC_merge_unmapped(void) { - struct hblk * h, *next; - hdr * hhdr, *nexthdr; - word size, nextsize; int i; for (i = 0; i <= N_HBLK_FLS; ++i) { - h = GC_hblkfreelist[i]; + struct hblk *h = GC_hblkfreelist[i]; + while (h != 0) { + struct hblk *next; + hdr *hhdr, *nexthdr; + word size, nextsize; + GET_HDR(h, hhdr); size = hhdr->hb_sz; next = (struct hblk *)((word)h + size); |