aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 03:23:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 03:23:24 +0000
commitaab987fdc40171215912e3ce14f0d293f2be4221 (patch)
treeb7fe198ff8dbdc8396a2525fe97c4b6afbb60be1 /array.c
parent03170d2c186735ccb915cf12913f7814ec6c4057 (diff)
downloadruby-aab987fdc40171215912e3ce14f0d293f2be4221.tar.gz
* 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 11fba55029..6f1d65a88e 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;