ruby-changes:63242
From: Nobuyoshi <ko1@a...>
Date: Thu, 1 Oct 2020 13:53:31 +0900 (JST)
Subject: [ruby-changes:63242] 0e98a9c854 (master): break around function definition [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=0e98a9c854 From 0e98a9c8546c99ccf74fbe176a46429dedde8f93 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 1 Oct 2020 13:44:29 +0900 Subject: break around function definition [ci skip] diff --git a/scheduler.c b/scheduler.c index f0bb5ee..03caec8 100644 --- a/scheduler.c +++ b/scheduler.c @@ -37,7 +37,8 @@ Init_Scheduler(void) https://github.com/ruby/ruby/blob/trunk/scheduler.c#L37 id_io_wait = rb_intern_const("io_wait"); } -VALUE rb_scheduler_close(VALUE scheduler) +VALUE +rb_scheduler_close(VALUE scheduler) { if (rb_respond_to(scheduler, id_close)) { return rb_funcall(scheduler, id_close, 0); @@ -45,7 +46,8 @@ VALUE rb_scheduler_close(VALUE scheduler) https://github.com/ruby/ruby/blob/trunk/scheduler.c#L46 } VALUE -rb_scheduler_timeout(struct timeval *timeout) { +rb_scheduler_timeout(struct timeval *timeout) +{ if (timeout) { return rb_float_new((double)timeout->tv_sec + (0.000001f * timeout->tv_usec)); } @@ -53,57 +55,68 @@ rb_scheduler_timeout(struct timeval *timeout) { https://github.com/ruby/ruby/blob/trunk/scheduler.c#L55 return Qnil; } -VALUE rb_scheduler_kernel_sleep(VALUE scheduler, VALUE timeout) +VALUE +rb_scheduler_kernel_sleep(VALUE scheduler, VALUE timeout) { return rb_funcall(scheduler, id_kernel_sleep, 1, timeout); } -VALUE rb_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv) +VALUE +rb_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv) { return rb_funcallv(scheduler, id_kernel_sleep, argc, argv); } -VALUE rb_scheduler_block(VALUE scheduler, VALUE blocker, VALUE timeout) +VALUE +rb_scheduler_block(VALUE scheduler, VALUE blocker, VALUE timeout) { return rb_funcall(scheduler, id_block, 2, blocker, timeout); } -VALUE rb_scheduler_unblock(VALUE scheduler, VALUE blocker, VALUE fiber) +VALUE +rb_scheduler_unblock(VALUE scheduler, VALUE blocker, VALUE fiber) { return rb_funcall(scheduler, id_unblock, 2, blocker, fiber); } -VALUE rb_scheduler_io_wait(VALUE scheduler, VALUE io, VALUE events, VALUE timeout) +VALUE +rb_scheduler_io_wait(VALUE scheduler, VALUE io, VALUE events, VALUE timeout) { return rb_funcall(scheduler, id_io_wait, 3, io, events, timeout); } -VALUE rb_scheduler_io_wait_readable(VALUE scheduler, VALUE io) +VALUE +rb_scheduler_io_wait_readable(VALUE scheduler, VALUE io) { return rb_scheduler_io_wait(scheduler, io, RB_UINT2NUM(RUBY_IO_READABLE), Qnil); } -VALUE rb_scheduler_io_wait_writable(VALUE scheduler, VALUE io) +VALUE +rb_scheduler_io_wait_writable(VALUE scheduler, VALUE io) { return rb_scheduler_io_wait(scheduler, io, RB_UINT2NUM(RUBY_IO_WRITABLE), Qnil); } -int rb_scheduler_supports_io_read(VALUE scheduler) +int +rb_scheduler_supports_io_read(VALUE scheduler) { return rb_respond_to(scheduler, id_io_read); } -VALUE rb_scheduler_io_read(VALUE scheduler, VALUE io, VALUE buffer, size_t offset, size_t length) +VALUE +rb_scheduler_io_read(VALUE scheduler, VALUE io, VALUE buffer, size_t offset, size_t length) { return rb_funcall(scheduler, id_io_read, 4, io, buffer, SIZET2NUM(offset), SIZET2NUM(length)); } -int rb_scheduler_supports_io_write(VALUE scheduler) +int +rb_scheduler_supports_io_write(VALUE scheduler) { return rb_respond_to(scheduler, id_io_write); } -VALUE rb_scheduler_io_write(VALUE scheduler, VALUE io, VALUE buffer, size_t offset, size_t length) +VALUE +rb_scheduler_io_write(VALUE scheduler, VALUE io, VALUE buffer, size_t offset, size_t length) { // We should ensure string has capacity to receive data, and then resize it afterwards. return rb_funcall(scheduler, id_io_write, 4, io, buffer, SIZET2NUM(offset), SIZET2NUM(length)); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/