ruby-changes:26603
From: nobu <ko1@a...>
Date: Sat, 29 Dec 2012 21:25:37 +0900 (JST)
Subject: [ruby-changes:26603] nobu:r38654 (trunk): adjust style
nobu 2012-12-29 21:22:04 +0900 (Sat, 29 Dec 2012) New Revision: 38654 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38654 Log: adjust style Modified files: trunk/array.c trunk/bignum.c trunk/compile.c trunk/cont.c trunk/gc.c trunk/hash.c trunk/io.c trunk/iseq.c trunk/re.c trunk/regparse.c trunk/thread_pthread.c trunk/vm_exec.h Index: regparse.c =================================================================== --- regparse.c (revision 38653) +++ regparse.c (revision 38654) @@ -2278,7 +2278,7 @@ onig_reduce_nested_quantifier(Node* pnod https://github.com/ruby/ruby/blob/trunk/regparse.c#L2278 cnum = popular_quantifier_num(c); if (pnum < 0 || cnum < 0) return ; - switch(ReduceTypeTable[cnum][pnum]) { + switch (ReduceTypeTable[cnum][pnum]) { case RQ_DEL: *pnode = *cnode; break; @@ -5284,7 +5284,7 @@ set_quantifier(Node* qnode, Node* target https://github.com/ruby/ruby/blob/trunk/regparse.c#L5284 IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT)) { UChar buf[WARN_BUFSIZE]; - switch(ReduceTypeTable[targetq_num][nestq_num]) { + switch (ReduceTypeTable[targetq_num][nestq_num]) { case RQ_ASIS: break; Index: array.c =================================================================== --- array.c (revision 38653) +++ array.c (revision 38654) @@ -4582,7 +4582,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L4582 descending_factorial(long from, long how_many) { VALUE cnt = LONG2FIX(how_many >= 0); - while(how_many-- > 0) { + while (how_many-- > 0) { cnt = rb_funcall(cnt, '*', 1, LONG2FIX(from--)); } return cnt; Index: re.c =================================================================== --- re.c (revision 38653) +++ re.c (revision 38654) @@ -739,7 +739,7 @@ reg_named_captures_iter(const OnigUChar https://github.com/ruby/ruby/blob/trunk/re.c#L739 VALUE ary = rb_ary_new2(back_num); int i; - for(i = 0; i < back_num; i++) + for (i = 0; i < back_num; i++) rb_ary_store(ary, i, INT2NUM(back_refs[i])); rb_hash_aset(hash, rb_str_new((const char*)name, name_end-name),ary); @@ -1046,7 +1046,7 @@ match_backref_number(VALUE match, VALUE https://github.com/ruby/ruby/blob/trunk/re.c#L1046 VALUE regexp = RMATCH(match)->regexp; match_check(match); - switch(TYPE(backref)) { + switch (TYPE(backref)) { default: return NUM2INT(backref); Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 38653) +++ thread_pthread.c (revision 38654) @@ -1006,7 +1006,7 @@ print_signal_list(char *str) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1006 struct signal_thread_list *list = signal_thread_list_anchor.next; thread_debug("list (%s)> ", str); - while(list){ + while (list) { thread_debug("%p (%p), ", list->th, list->th->thread_id); list = list->next; } Index: iseq.c =================================================================== --- iseq.c (revision 38653) +++ iseq.c (revision 38654) @@ -1595,7 +1595,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/iseq.c#L1595 exception_type2symbol(VALUE type) { ID id; - switch(type) { + switch (type) { case CATCH_TYPE_RESCUE: CONST_ID(id, "rescue"); break; case CATCH_TYPE_ENSURE: CONST_ID(id, "ensure"); break; case CATCH_TYPE_RETRY: CONST_ID(id, "retry"); break; @@ -1664,7 +1664,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1664 } /* type */ - switch(iseq->type) { + switch (iseq->type) { case ISEQ_TYPE_TOP: type = sym_top; break; case ISEQ_TYPE_METHOD: type = sym_method; break; case ISEQ_TYPE_BLOCK: type = sym_block; break; Index: io.c =================================================================== --- io.c (revision 38653) +++ io.c (revision 38654) @@ -4062,7 +4062,7 @@ fptr_finalize(rb_io_t *fptr, int noraise https://github.com/ruby/ruby/blob/trunk/io.c#L4062 } if (!NIL_P(err) && !noraise) { - switch(TYPE(err)) { + switch (TYPE(err)) { case T_FIXNUM: case T_BIGNUM: errno = NUM2INT(err); Index: compile.c =================================================================== --- compile.c (revision 38653) +++ compile.c (revision 38654) @@ -4674,7 +4674,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4674 INIT_ANCHOR(recv); INIT_ANCHOR(val); - switch(nd_type(node)) { + switch (nd_type(node)) { case NODE_MATCH: ADD_INSN1(recv, nd_line(node), putobject, node->nd_lit); ADD_INSN2(val, nd_line(node), getspecial, INT2FIX(0), Index: gc.c =================================================================== --- gc.c (revision 38653) +++ gc.c (revision 38654) @@ -2231,7 +2231,7 @@ init_mark_stack(mark_stack_t *stack) https://github.com/ruby/ruby/blob/trunk/gc.c#L2231 push_mark_stack_chunk(stack); stack->limit = STACK_CHUNK_SIZE; - for(i=0; i < 4; i++) { + for (i=0; i < 4; i++) { add_stack_chunk_cache(stack, stack_chunk_alloc()); } stack->unused_cache_size = stack->cache_size; Index: hash.c =================================================================== --- hash.c (revision 38653) +++ hash.c (revision 38654) @@ -2976,7 +2976,7 @@ env_size(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L2976 rb_secure(4); env = GET_ENVIRON(environ); - for(i=0; env[i]; i++) + for (i=0; env[i]; i++) ; FREE_ENVIRON(environ); return INT2FIX(i); Index: vm_exec.h =================================================================== --- vm_exec.h (revision 38653) +++ vm_exec.h (revision 38654) @@ -143,8 +143,8 @@ case BIN(insn): https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L143 #define INSN_DISPATCH() \ - while(1){ \ - switch(GET_CURRENT_INSN()){ + while (1) { \ + switch (GET_CURRENT_INSN()) { #define END_INSNS_DISPATCH() \ default: \ Index: cont.c =================================================================== --- cont.c (revision 38653) +++ cont.c (revision 38654) @@ -128,7 +128,7 @@ static VALUE rb_eFiberError; https://github.com/ruby/ruby/blob/trunk/cont.c#L128 #define GetFiberPtr(obj, ptr) do {\ TypedData_Get_Struct((obj), rb_fiber_t, &fiber_data_type, (ptr)); \ if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \ -} while(0) +} while (0) NOINLINE(static VALUE cont_capture(volatile int *stat)); @@ -872,7 +872,7 @@ rb_callcc(VALUE self) https://github.com/ruby/ruby/blob/trunk/cont.c#L872 static VALUE make_passing_arg(int argc, VALUE *argv) { - switch(argc) { + switch (argc) { case 0: return Qnil; case 1: Index: bignum.c =================================================================== --- bignum.c (revision 38653) +++ bignum.c (revision 38654) @@ -1557,7 +1557,7 @@ rb_big_cmp(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/bignum.c#L1557 xds = BDIGITS(x); yds = BDIGITS(y); - while(xlen-- && (xds[xlen]==yds[xlen])); + while (xlen-- && (xds[xlen]==yds[xlen])); if (-1 == xlen) return INT2FIX(0); return (xds[xlen] > yds[xlen]) ? (RBIGNUM_SIGN(x) ? INT2FIX(1) : INT2FIX(-1)) : @@ -2825,7 +2825,7 @@ bigdivrem(VALUE x, VALUE y, volatile VAL https://github.com/ruby/ruby/blob/trunk/bignum.c#L2825 while (ny > 1 && !zds[ny-1]) --ny; if (dd) { t2 = 0; i = ny; - while(i--) { + while (i--) { t2 = (t2 | zds[i]) >> dd; q = zds[i]; zds[i] = BIGLO(t2); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/