diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-08-27 08:48:02 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-08-27 08:52:28 +0300 |
commit | 224ecfa5ed62b575376267c4168c3f5e6daf69cf (patch) | |
tree | 8425dee46ab6285affd2c5ded4d4a11bb138b652 /dbg_mlc.c | |
parent | fc339c65ad0fffc2e5bc8332bab9c1c70329c04e (diff) | |
download | bdwgc-224ecfa5ed62b575376267c4168c3f5e6daf69cf.tar.gz |
Eliminate 'scope of variable can be reduced' cppcheck warnings
* cord/cordbscs.c (CORD_cat_char_star, CORD_from_fn,
CORD_substr_checked, CORD_riter4, CORD_init_min_len): Move local
variable declaration to the inner scope where the variable is used.
* cord/cordxtra.c (CORD_cmp, CORD_ncmp, CORD_from_file_eager): Likewise.
* cord/tests/cordtest.c (test_basics): Likewise.
* cord/tests/de.c (line_pos, replace_line): Likewise.
* dbg_mlc.c (GC_generate_random_heap_address): Likewise.
* mark.c (GC_print_trace_inner): Likewise.
* misc.c (GC_printf): Likewise.
* cord/cordbscs.c (CORD_cat_char_star, CORD_from_fn,
CORD_substr_checked, CORD_riter4, CORD_init_min_len): Remove "register"
keyword for the moved variable.
* cord/cordxtra.c (CORD_cmp, CORD_ncmp, CORD_from_file_eager): Likewise.
* cord/tests/de.c (replace_line): Likewise.
Diffstat (limited to 'dbg_mlc.c')
-rw-r--r-- | dbg_mlc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -142,7 +142,6 @@ GC_API void * GC_CALL GC_generate_random_heap_address(void) { size_t i; - size_t size; word heap_offset = RANDOM(); if (GC_heapsize > RAND_MAX) { @@ -154,6 +153,8 @@ /* e.g. RAND_MAX = 1.5* GC_heapsize. But for typical cases, */ /* it's not too bad. */ for (i = 0;; ++i) { + size_t size; + if (i >= GC_n_heap_sects) ABORT("GC_generate_random_heap_address: size inconsistency"); |