diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-10-04 23:27:53 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-10-04 23:27:53 +0300 |
commit | 03bb5fb61138482085be2330c4da9491a081ec52 (patch) | |
tree | 35e44a0858e5532f68b7609ced2e3bc14f865558 /headers.c | |
parent | e248d685833a498e7dc0938bca47f08dfa611cd5 (diff) | |
download | bdwgc-03bb5fb61138482085be2330c4da9491a081ec52.tar.gz |
Eliminate more 'scope of variable can be reduced' cppcheck style warnings
* allchblk.c (GC_compute_large_free_bytes, GC_print_hblkfreelist,
free_list_index_of, GC_dump_regions, GC_add_to_fl, GC_unmap_old,
GC_allochblk_nth): Move local variable declaration to the inner scope
where the variable is actually used.
* alloc.c (GC_maybe_gc, GC_collect_a_little_inner, GC_set_fl_marks,
GC_clear_fl_marks): Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* finalize.c (GC_ignore_self_finalize_mark_proc,
GC_register_finalizer_inner, GC_dump_finalization_links,
GC_dump_finalization, GC_make_disappearing_links_disappear,
GC_remove_dangling_disappearing_links, GC_invoke_finalizers): Likewise.
* headers.c (GC_install_counts): Likewise.
* malloc.c (GC_malloc_kind_global, GC_generic_malloc_uncollectable,
GC_free): Likewise.
* mark.c (GC_push_all_eager, GC_push_marked1, GC_push_marked2,
GC_push_marked4): Likewise.
* mark_rts.c (GC_next_exclusion, GC_exclude_static_roots_inner,
GC_push_conditional_with_exclusions): Likewise.
* misc.c (GC_base, GC_parse_mem_size_arg, GC_write): Likewise.
* os_dep.c (GC_repeat_read, GC_get_maps, GC_least_described_address,
GC_register_root_section, GC_register_data_segments): Likewise.
* reclaim.c (GC_reclaim_block, GC_start_reclaim): Likewise.
* finalize.c (ITERATE_DL_HASHTBL_BEGIN): Declare prev_dl local variable.
Diffstat (limited to 'headers.c')
-rw-r--r-- | headers.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -277,14 +277,14 @@ GC_INNER struct hblkhdr * GC_install_header(struct hblk *h) GC_INNER GC_bool GC_install_counts(struct hblk *h, size_t sz/* bytes */) { struct hblk * hbp; - word i; for (hbp = h; (word)hbp < (word)h + sz; hbp += BOTTOM_SZ) { if (!get_index((word) hbp)) return(FALSE); } if (!get_index((word)h + sz - 1)) return(FALSE); for (hbp = h + 1; (word)hbp < (word)h + sz; hbp += 1) { - i = HBLK_PTR_DIFF(hbp, h); + word i = HBLK_PTR_DIFF(hbp, h); + SET_HDR(hbp, (hdr *)(i > MAX_JUMP? MAX_JUMP : i)); } return(TRUE); |