From f4d2374b45bf893b5adf34470e9f20d55143c5ac Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 27 Jun 2012 05:37:15 +0000 Subject: [PATCH] adjust style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 20 +++++++++++++------- process.c | 30 ++++++++++++++++++++---------- sparc.c | 3 ++- thread.c | 11 +++++++---- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/io.c b/io.c index f8d3040fce..d218e8ce22 100644 --- a/io.c +++ b/io.c @@ -1351,7 +1351,8 @@ rb_io_addstr(VALUE io, VALUE str) } #ifdef HAVE_FSYNC -static VALUE nogvl_fsync(void *ptr) +static VALUE +nogvl_fsync(void *ptr) { rb_io_t *fptr = ptr; @@ -1722,14 +1723,17 @@ rb_io_fsync(VALUE io) #else # define rb_io_fsync rb_f_notimplement # define rb_io_sync rb_f_notimplement -static VALUE rb_io_set_sync(VALUE io, VALUE sync) { - rb_notimplement(); - /* NEVER REACHED */ return Qundef; +static VALUE +rb_io_set_sync(VALUE io, VALUE sync) +{ + rb_notimplement(); + UNREACHABLE; } #endif #ifdef HAVE_FDATASYNC -static VALUE nogvl_fdatasync(void *ptr) +static VALUE +nogvl_fdatasync(void *ptr) { rb_io_t *fptr = ptr; @@ -8224,7 +8228,8 @@ struct ioctl_arg { long narg; }; -static VALUE nogvl_ioctl(void *ptr) +static VALUE +nogvl_ioctl(void *ptr) { struct ioctl_arg *arg = ptr; @@ -8521,7 +8526,8 @@ struct fcntl_arg { long narg; }; -static VALUE nogvl_fcntl(void *ptr) +static VALUE +nogvl_fcntl(void *ptr) { struct fcntl_arg *arg = ptr; diff --git a/process.c b/process.c index 1546969dbd..5acb2af7f4 100644 --- a/process.c +++ b/process.c @@ -991,13 +991,15 @@ static RETSIGTYPE (*saved_sigpipe_handler)(int) = 0; #endif #ifdef SIGPIPE -static RETSIGTYPE sig_do_nothing(int sig) +static RETSIGTYPE +sig_do_nothing(int sig) { } #endif /* This function should be async-signal-safe. Actually it is. */ -static void before_exec_async_signal_safe(void) +static void +before_exec_async_signal_safe(void) { #ifdef SIGPIPE /* @@ -1010,7 +1012,8 @@ static void before_exec_async_signal_safe(void) #endif } -static void before_exec_non_async_signal_safe(void) +static void +before_exec_non_async_signal_safe(void) { if (!forked_child) { /* @@ -1022,21 +1025,24 @@ static void before_exec_non_async_signal_safe(void) } } -static void before_exec(void) +static void +before_exec(void) { before_exec_non_async_signal_safe(); before_exec_async_signal_safe(); } /* This function should be async-signal-safe. Actually it is. */ -static void after_exec_async_signal_safe(void) +static void +after_exec_async_signal_safe(void) { #ifdef SIGPIPE signal(SIGPIPE, saved_sigpipe_handler); /* async-signal-safe */ #endif } -static void after_exec_non_async_signal_safe(void) +static void +after_exec_non_async_signal_safe(void) { rb_thread_reset_timer_thread(); rb_thread_start_timer_thread(); @@ -1044,7 +1050,8 @@ static void after_exec_non_async_signal_safe(void) forked_child = 0; } -static void after_exec(void) +static void +after_exec(void) { after_exec_async_signal_safe(); after_exec_non_async_signal_safe(); @@ -2099,7 +2106,8 @@ rb_execarg_new(int argc, VALUE *argv, int accept_shell) return execarg_obj; } -struct rb_execarg *rb_execarg_get(VALUE execarg_obj) +struct rb_execarg +*rb_execarg_get(VALUE execarg_obj) { struct rb_execarg *eargp; TypedData_Get_Struct(execarg_obj, struct rb_execarg, &exec_arg_data_type, eargp); @@ -5305,7 +5313,8 @@ proc_setgid(VALUE obj, VALUE id) */ #define RB_MAX_GROUPS (65536) static int _maxgroups = -1; -static int get_sc_ngroups_max(void) +static int +get_sc_ngroups_max(void) { #ifdef _SC_NGROUPS_MAX return (int)sysconf(_SC_NGROUPS_MAX); @@ -5315,7 +5324,8 @@ static int get_sc_ngroups_max(void) return -1; #endif } -static int maxgroups(void) +static int +maxgroups(void) { if (_maxgroups < 0) { _maxgroups = get_sc_ngroups_max(); diff --git a/sparc.c b/sparc.c index e5f7985e19..5c5dc8ef8e 100644 --- a/sparc.c +++ b/sparc.c @@ -9,7 +9,8 @@ See http://bugs.ruby-lang.org/issues/5244 for discussion. *********************************************************************/ -void rb_sparc_flush_register_windows(void) +void +rb_sparc_flush_register_windows(void) { asm #ifdef __GNUC__ diff --git a/thread.c b/thread.c index 6ad4503470..279dc81aea 100644 --- a/thread.c +++ b/thread.c @@ -2725,8 +2725,9 @@ rb_thread_fd_select(int max, rb_fdset_t * read, rb_fdset_t * write, rb_fdset_t * #ifndef HAVE_PPOLL /* TODO: don't ignore sigmask */ -int ppoll(struct pollfd *fds, nfds_t nfds, - const struct timespec *ts, const sigset_t *sigmask) +int +ppoll(struct pollfd *fds, nfds_t nfds, + const struct timespec *ts, const sigset_t *sigmask) { int timeout_ms; @@ -2743,7 +2744,8 @@ int ppoll(struct pollfd *fds, nfds_t nfds, else timeout_ms = tmp + tmp2; } - } else + } + else timeout_ms = -1; return poll(fds, nfds, timeout_ms); @@ -2822,7 +2824,8 @@ retry: return result; } #else /* ! USE_POLL - implement rb_io_poll_fd() using select() */ -static rb_fdset_t *init_set_fd(int fd, rb_fdset_t *fds) +static rb_fdset_t * +init_set_fd(int fd, rb_fdset_t *fds) { rb_fd_init(fds); rb_fd_set(fd, fds);