[前][次][番号順一覧][スレッド一覧]

ruby-changes:46127

From: kazu <ko1@a...>
Date: Mon, 3 Apr 2017 21:30:11 +0900 (JST)
Subject: [ruby-changes:46127] kazu:r58241 (trunk): Fix arguments order of IO#pwrite

kazu	2017-04-03 21:30:04 +0900 (Mon, 03 Apr 2017)

  New Revision: 58241

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58241

  Log:
    Fix arguments order of IO#pwrite

  Modified files:
    trunk/io.c
    trunk/test/ruby/test_io.rb
Index: io.c
===================================================================
--- io.c	(revision 58240)
+++ io.c	(revision 58241)
@@ -4945,7 +4945,7 @@ internal_pwrite_func(void *ptr) https://github.com/ruby/ruby/blob/trunk/io.c#L4945
  *     File.read("out")        #=> "\u0000\u0000\u0000ABCDEF"
  */
 static VALUE
-rb_io_pwrite(VALUE io, VALUE offset, VALUE str)
+rb_io_pwrite(VALUE io, VALUE str, VALUE offset)
 {
     rb_io_t *fptr;
     ssize_t n;
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 58240)
+++ test/ruby/test_io.rb	(revision 58241)
@@ -3541,7 +3541,7 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3541
     def test_pwrite
       make_tempfile { |t|
         open(t.path, IO::RDWR) do |f|
-          assert_equal(3, f.pwrite(4, "ooo"))
+          assert_equal(3, f.pwrite("ooo", 4))
           assert_equal("ooo", f.pread(3, 4))
         end
       }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]