ruby-changes:47319
From: nobu <ko1@a...>
Date: Thu, 27 Jul 2017 21:25:46 +0900 (JST)
Subject: [ruby-changes:47319] nobu:r59435 (trunk): fix type
nobu 2017-07-27 21:25:42 +0900 (Thu, 27 Jul 2017) New Revision: 59435 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59435 Log: fix type * spec/rubyspec/optional/capi/ext/io_spec.c (io_spec_rb_io_wait_readable): fix type of read(2). Modified files: trunk/spec/rubyspec/optional/capi/ext/io_spec.c Index: spec/rubyspec/optional/capi/ext/io_spec.c =================================================================== --- spec/rubyspec/optional/capi/ext/io_spec.c (revision 59434) +++ spec/rubyspec/optional/capi/ext/io_spec.c (revision 59435) @@ -140,7 +140,7 @@ VALUE io_spec_rb_io_taint_check(VALUE se https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/io_spec.c#L140 VALUE io_spec_rb_io_wait_readable(VALUE self, VALUE io, VALUE read_p) { int fd = io_spec_get_fd(io); char buf[RB_IO_WAIT_READABLE_BUF]; - int ret, r, saved_errno; + int ret, saved_errno; if (set_non_blocking(fd) == -1) rb_sys_fail("set_non_blocking failed"); @@ -157,10 +157,10 @@ VALUE io_spec_rb_io_wait_readable(VALUE https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/io_spec.c#L157 ret = rb_io_wait_readable(fd); if(RTEST(read_p)) { - r = read(fd, buf, RB_IO_WAIT_READABLE_BUF); + ssize_t r = read(fd, buf, RB_IO_WAIT_READABLE_BUF); if (r != RB_IO_WAIT_READABLE_BUF) { perror("read"); - return INT2FIX(r); + return SSIZET2NUM(r); } rb_ivar_set(self, rb_intern("@read_data"), rb_str_new(buf, RB_IO_WAIT_READABLE_BUF)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/