aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-08-26 15:20:15 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-27 15:52:26 +0900
commit703783324c16b8b2b50210d1a7d1119902abbb8b (patch)
treed594ba9029a1ddcee223fcb2f39be07ef20daca1 /io.c
parent5c7c2d9951f2512ca10ea38fecc48d8ac67502e6 (diff)
downloadruby-703783324c16b8b2b50210d1a7d1119902abbb8b.tar.gz
rb_ensure now free from ANYARGS
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_ensure, which also revealed many arity / type mismatches.
Diffstat (limited to 'io.c')
-rw-r--r--io.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/io.c b/io.c
index 8f48ba1dd6..1b37723b26 100644
--- a/io.c
+++ b/io.c
@@ -10379,8 +10379,9 @@ open_key_args(VALUE klass, int argc, VALUE *argv, VALUE opt, struct foreach_arg
}
static VALUE
-io_s_foreach(struct getline_arg *arg)
+io_s_foreach(VALUE v)
{
+ struct getline_arg *arg = (void *)v;
VALUE str;
while (!NIL_P(str = rb_io_getline_1(arg->rs, arg->limit, arg->chomp, arg->io))) {
@@ -10437,8 +10438,9 @@ rb_io_s_foreach(int argc, VALUE *argv, VALUE self)
}
static VALUE
-io_s_readlines(struct getline_arg *arg)
+io_s_readlines(VALUE v)
{
+ struct getline_arg *arg = (void *)v;
return io_readlines(arg, arg->io);
}
@@ -10489,8 +10491,9 @@ rb_io_s_readlines(int argc, VALUE *argv, VALUE io)
}
static VALUE
-io_s_read(struct foreach_arg *arg)
+io_s_read(VALUE v)
{
+ struct foreach_arg *arg = (void *)v;
return io_read(arg->argc, arg->argv, arg->io);
}
@@ -10626,8 +10629,9 @@ rb_io_s_binread(int argc, VALUE *argv, VALUE io)
}
static VALUE
-io_s_write0(struct write_arg *arg)
+io_s_write0(VALUE v)
{
+ struct write_arg *arg = (void * )v;
return io_write(arg->io,arg->str,arg->nosync);
}