summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 03:23:24 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 03:23:24 (GMT)
commitcb2a99822e3260fa664a24d96841e21767b9f50b (patch)
treeb7fe198ff8dbdc8396a2525fe97c4b6afbb60be1 /array.c
parentf00ec4fb386f44d84d750e841f2c240d0a14e968 (diff)
* array.c (rb_ary_fill): suppress warnings: 'item' may be used
uninitialized in this function git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/array.c b/array.c
index 11fba55..6f1d65a 100644
--- a/array.c
+++ b/array.c
@@ -3520,12 +3520,10 @@ rb_ary_clear(VALUE ary)
static VALUE
rb_ary_fill(int argc, VALUE *argv, VALUE ary)
{
- VALUE item, arg1, arg2;
+ VALUE item = Qundef, arg1, arg2;
long beg = 0, end = 0, len = 0;
- int block_p = FALSE;
if (rb_block_given_p()) {
- block_p = TRUE;
rb_scan_args(argc, argv, "02", &arg1, &arg2);
argc += 1; /* hackish */
}
@@ -3567,7 +3565,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
ARY_SET_LEN(ary, end);
}
- if (block_p) {
+ if (item == Qundef) {
VALUE v;
long i;