Get rid of shadowing local variables

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-10-18 04:35:25 +00:00
Родитель 593d978646
Коммит 20685cdc85
7 изменённых файлов: 22 добавлений и 19 удалений

Просмотреть файл

@ -903,8 +903,6 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
if ((flags & INTEGER_PACK_2COMP) && (sign < 0 && numwords != 0)) {
unsigned char *buf;
int word_num_partialbits;
size_t word_num_fullbytes;

Просмотреть файл

@ -876,10 +876,13 @@ AS_IF([test "$GCC:${warnflags+set}:no" = yes::no], [
-Werror=implicit-function-declaration \
-Werror=division-by-zero \
-Werror=deprecated-declarations \
-Werror=misleading-indentation \
-Wno-packed-bitfield-compat \
-Wsuggest-attribute=noreturn \
-Wsuggest-attribute=format \
-Wimplicit-fallthrough=0 \
-Werror=duplicated-cond \
-Werror=restrict \
$extra_warning \
; do
AS_IF([test "$particular_werror_flags" != yes], [

4
dir.c
Просмотреть файл

@ -2154,8 +2154,8 @@ glob_helper(
}
#if USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME
if ((*cur)->type == ALPHA) {
long base = pathlen + (dirsep != 0);
buf = replace_real_basename(buf, base, enc, IF_NORMALIZE_UTF8PATH(1)+0,
buf = replace_real_basename(buf, pathlen + (dirsep != 0), enc,
IF_NORMALIZE_UTF8PATH(1)+0,
flags, &new_pathtype);
if (!buf) break;
}

Просмотреть файл

@ -1119,11 +1119,11 @@ enumerator_size(VALUE obj)
for (i = 0; i < RARRAY_LEN(e->procs); i++) {
VALUE proc = RARRAY_AREF(e->procs, i);
struct proc_entry *entry = proc_entry_ptr(proc);
lazyenum_size_func *size = entry->fn->size;
if (!size) {
lazyenum_size_func *size_fn = entry->fn->size;
if (!size_fn) {
return Qnil;
}
receiver = (*size)(proc, receiver);
receiver = (*size_fn)(proc, receiver);
}
return receiver;
}

6
file.c
Просмотреть файл

@ -3946,11 +3946,11 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved,
link_names = skipprefixroot(link_prefix, link_prefix + RSTRING_LEN(link), rb_enc_get(link));
link_prefixlen = link_names - link_prefix;
if (link_prefixlen > 0) {
rb_encoding *enc, *linkenc = rb_enc_get(link);
rb_encoding *tmpenc, *linkenc = rb_enc_get(link);
link_orig = link;
link = rb_str_subseq(link, 0, link_prefixlen);
enc = rb_enc_check(*resolvedp, link);
if (enc != linkenc) link = rb_str_conv_enc(link, linkenc, enc);
tmpenc = rb_enc_check(*resolvedp, link);
if (tmpenc != linkenc) link = rb_str_conv_enc(link, linkenc, tmpenc);
*resolvedp = link;
*prefixlenp = link_prefixlen;
}

18
gc.c
Просмотреть файл

@ -5202,11 +5202,13 @@ gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
int zombie_objects = 0;
for (i=0; i<page->total_slots; i++) {
VALUE obj = (VALUE)&page->start[i];
if (RBASIC(obj) == 0) free_objects++;
if (BUILTIN_TYPE(obj) == T_ZOMBIE) zombie_objects++;
if (RVALUE_PAGE_UNCOLLECTIBLE(page, obj) && RVALUE_PAGE_WB_UNPROTECTED(page, obj)) has_remembered_shady = TRUE;
if (RVALUE_PAGE_MARKING(page, obj)) {
VALUE val = (VALUE)&page->start[i];
if (RBASIC(val) == 0) free_objects++;
if (BUILTIN_TYPE(val) == T_ZOMBIE) zombie_objects++;
if (RVALUE_PAGE_UNCOLLECTIBLE(page, val) && RVALUE_PAGE_WB_UNPROTECTED(page, val)) {
has_remembered_shady = TRUE;
}
if (RVALUE_PAGE_MARKING(page, val)) {
has_remembered_old = TRUE;
rememberd_old_objects++;
}
@ -5216,9 +5218,9 @@ gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
page->flags.has_remembered_objects == FALSE && has_remembered_old == TRUE) {
for (i=0; i<page->total_slots; i++) {
VALUE obj = (VALUE)&page->start[i];
if (RVALUE_PAGE_MARKING(page, obj)) {
fprintf(stderr, "marking -> %s\n", obj_info(obj));
VALUE val = (VALUE)&page->start[i];
if (RVALUE_PAGE_MARKING(page, val)) {
fprintf(stderr, "marking -> %s\n", obj_info(val));
}
}
rb_bug("page %p's has_remembered_objects should be false, but there are remembered old objects (%d). %s",

2
io.c
Просмотреть файл

@ -3575,9 +3575,9 @@ io_getc(rb_io_t *fptr, rb_encoding *enc)
VALUE str;
if (NEED_READCONV(fptr)) {
VALUE str = Qnil;
rb_encoding *read_enc = io_read_encoding(fptr);
str = Qnil;
SET_BINARY_MODE(fptr);
make_readconv(fptr, 0);