ruby-changes:33113
From: nobu <ko1@a...>
Date: Thu, 27 Feb 2014 16:10:24 +0900 (JST)
Subject: [ruby-changes:33113] nobu:r45192 (trunk): adjust indent and style
nobu 2014-02-27 16:10:14 +0900 (Thu, 27 Feb 2014) New Revision: 45192 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45192 Log: adjust indent and style Modified files: trunk/bignum.c trunk/dln.c trunk/gc.c trunk/io.c trunk/signal.c trunk/string.c trunk/thread.c trunk/time.c trunk/vm.c Index: time.c =================================================================== --- time.c (revision 45191) +++ time.c (revision 45192) @@ -2561,7 +2561,8 @@ obj2subsecx(VALUE obj, VALUE *subsecx) https://github.com/ruby/ruby/blob/trunk/time.c#L2561 if (RB_TYPE_P(obj, T_STRING)) { obj = rb_str_to_inum(obj, 10, FALSE); *subsecx = INT2FIX(0); - } else { + } + else { divmodv(num_exact(obj), INT2FIX(1), &obj, &subsec); *subsecx = w2v(rb_time_magnify(v2w(subsec))); } Index: string.c =================================================================== --- string.c (revision 45191) +++ string.c (revision 45192) @@ -5823,7 +5823,8 @@ rb_str_squeeze_bang(int argc, VALUE *arg https://github.com/ruby/ruby/blob/trunk/string.c#L5823 *t++ = save = c; } } - } else { + } + else { while (s < send) { unsigned int c; int clen; Index: io.c =================================================================== --- io.c (revision 45191) +++ io.c (revision 45192) @@ -264,9 +264,11 @@ rb_cloexec_open(const char *pathname, in https://github.com/ruby/ruby/blob/trunk/io.c#L264 if (ret == -1) return -1; if (ret <= 2 || o_cloexec_state == 0) { rb_maygvl_fd_fix_cloexec(ret); - } else if (o_cloexec_state > 0) { + } + else if (o_cloexec_state > 0) { return ret; - } else { + } + else { o_cloexec_state = rb_fix_detect_o_cloexec(ret); } return ret; @@ -1074,10 +1076,11 @@ io_flush_buffer_async2(VALUE arg) https://github.com/ruby/ruby/blob/trunk/io.c#L1076 /* pending async interrupt is there. */ errno = EAGAIN; return -1; - } else if (ret == 1) { + } + else if (ret == 1) { return 0; - } else - return ret; + } + return ret; } static inline int @@ -2716,7 +2719,8 @@ io_write_nonblock(VALUE io, VALUE str, i https://github.com/ruby/ruby/blob/trunk/io.c#L2719 if (errno == EWOULDBLOCK || errno == EAGAIN) { if (no_exception) { return ID2SYM(rb_intern("wait_writable")); - } else { + } + else { rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "write would block"); } } Index: thread.c =================================================================== --- thread.c (revision 45191) +++ thread.c (revision 45192) @@ -1013,7 +1013,8 @@ getclockofday(struct timeval *tp) https://github.com/ruby/ruby/blob/trunk/thread.c#L1013 if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { tp->tv_sec = ts.tv_sec; tp->tv_usec = ts.tv_nsec / 1000; - } else + } + else #endif { gettimeofday(tp, NULL); @@ -1084,7 +1085,8 @@ timeofday(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L1085 if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { return (double)tp.tv_sec + (double)tp.tv_nsec * 1e-9; - } else + } + else #endif { struct timeval tv; Index: gc.c =================================================================== --- gc.c (revision 45191) +++ gc.c (revision 45192) @@ -5562,7 +5562,8 @@ gc_stat(int argc, VALUE *argv, VALUE sel https://github.com/ruby/ruby/blob/trunk/gc.c#L5562 size_t value = 0; gc_stat_internal(arg, &value); return SIZET2NUM(value); - } else if (!RB_TYPE_P(arg, T_HASH)) { + } + else if (!RB_TYPE_P(arg, T_HASH)) { rb_raise(rb_eTypeError, "non-hash or symbol given"); } } @@ -5581,7 +5582,8 @@ rb_gc_stat(VALUE key) https://github.com/ruby/ruby/blob/trunk/gc.c#L5582 size_t value = 0; gc_stat_internal(key, &value); return value; - } else { + } + else { gc_stat_internal(key, 0); return 0; } Index: dln.c =================================================================== --- dln.c (revision 45191) +++ dln.c (revision 45192) @@ -1178,25 +1178,26 @@ dln_strerror(void) https://github.com/ruby/ruby/blob/trunk/dln.c#L1178 static void aix_loaderror(const char *pathname) { - char *message[1024], errbuf[1024]; - int i; + char *message[1024], errbuf[1024]; + int i; #define ERRBUF_APPEND(s) strlcat(errbuf, (s), sizeof(errbuf)) - snprintf(errbuf, sizeof(errbuf), "load failed - %s. ", pathname); + snprintf(errbuf, sizeof(errbuf), "load failed - %s. ", pathname); - if (loadquery(L_GETMESSAGES, &message[0], sizeof(message)) != -1) { - ERRBUF_APPEND("Please issue below command for detailed reasons:\n\t"); - ERRBUF_APPEND("/usr/sbin/execerror ruby "); - for (i=0; message[i]; i++) { - ERRBUF_APPEND("\""); - ERRBUF_APPEND(message[i]); - ERRBUF_APPEND("\" "); + if (loadquery(L_GETMESSAGES, &message[0], sizeof(message)) != -1) { + ERRBUF_APPEND("Please issue below command for detailed reasons:\n\t"); + ERRBUF_APPEND("/usr/sbin/execerror ruby "); + for (i=0; message[i]; i++) { + ERRBUF_APPEND("\""); + ERRBUF_APPEND(message[i]); + ERRBUF_APPEND("\" "); + } + ERRBUF_APPEND("\n"); } - ERRBUF_APPEND("\n"); - } else { - ERRBUF_APPEND(strerror(errno)); - ERRBUF_APPEND("[loadquery failed]"); - } - dln_loaderror("%s", errbuf); + else { + ERRBUF_APPEND(strerror(errno)); + ERRBUF_APPEND("[loadquery failed]"); + } + dln_loaderror("%s", errbuf); } #endif Index: vm.c =================================================================== --- vm.c (revision 45191) +++ vm.c (revision 45192) @@ -149,7 +149,8 @@ vm_stat(int argc, VALUE *argv, VALUE sel https://github.com/ruby/ruby/blob/trunk/vm.c#L149 hash = arg; else rb_raise(rb_eTypeError, "non-hash or symbol given"); - } else if (arg == Qnil) { + } + else if (NIL_P(arg)) { hash = rb_hash_new(); } Index: bignum.c =================================================================== --- bignum.c (revision 45191) +++ bignum.c (revision 45192) @@ -4036,8 +4036,10 @@ rb_cstr_to_inum(const char *str, int bas https://github.com/ruby/ruby/blob/trunk/bignum.c#L4036 if (c == '_') { if (++us >= 2) break; - } else + } + else { us = 0; + } } if (!(c = *str) || ISSPACE(c)) --str; } Index: signal.c =================================================================== --- signal.c (revision 45191) +++ signal.c (revision 45192) @@ -1101,7 +1101,8 @@ init_sigchld(int sig) https://github.com/ruby/ruby/blob/trunk/signal.c#L1101 oldfunc = ruby_signal(sig, SIG_DFL); if (oldfunc != SIG_DFL && oldfunc != SIG_IGN) { ruby_signal(sig, oldfunc); - } else { + } + else { GET_VM()->trap_list[sig].cmd = 0; } rb_enable_interrupt(); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/