From be7bf5aa0cd9a8e90dbaf268d53b8590fc23393d Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 29 Dec 2012 12:22:04 +0000 Subject: adjust style git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 2 +- bignum.c | 4 ++-- compile.c | 2 +- cont.c | 4 ++-- gc.c | 2 +- hash.c | 2 +- io.c | 2 +- iseq.c | 4 ++-- re.c | 4 ++-- regparse.c | 4 ++-- thread_pthread.c | 2 +- vm_exec.h | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/array.c b/array.c index 3bbf9356db..6f14b99933 100644 --- a/array.c +++ b/array.c @@ -4582,7 +4582,7 @@ static VALUE 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; diff --git a/bignum.c b/bignum.c index 95a2504097..8601d80342 100644 --- a/bignum.c +++ b/bignum.c @@ -1557,7 +1557,7 @@ rb_big_cmp(VALUE x, VALUE y) 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 VALUE *divp, volatile VALUE *modp) 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); diff --git a/compile.c b/compile.c index b89a79ce0b..7dffe08141 100644 --- a/compile.c +++ b/compile.c @@ -4674,7 +4674,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) 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), diff --git a/cont.c b/cont.c index e24c2d39ff..43a60fa149 100644 --- a/cont.c +++ b/cont.c @@ -128,7 +128,7 @@ static VALUE rb_eFiberError; #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) static VALUE make_passing_arg(int argc, VALUE *argv) { - switch(argc) { + switch (argc) { case 0: return Qnil; case 1: diff --git a/gc.c b/gc.c index 6133fe5c6c..c79fd73dc9 100644 --- a/gc.c +++ b/gc.c @@ -2231,7 +2231,7 @@ init_mark_stack(mark_stack_t *stack) 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; diff --git a/hash.c b/hash.c index cba71f948f..34fbbf7035 100644 --- a/hash.c +++ b/hash.c @@ -2976,7 +2976,7 @@ env_size(void) 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); diff --git a/io.c b/io.c index b6d5f4a80c..f75251b10e 100644 --- a/io.c +++ b/io.c @@ -4062,7 +4062,7 @@ fptr_finalize(rb_io_t *fptr, int noraise) } if (!NIL_P(err) && !noraise) { - switch(TYPE(err)) { + switch (TYPE(err)) { case T_FIXNUM: case T_BIGNUM: errno = NUM2INT(err); diff --git a/iseq.c b/iseq.c index 4c3e2bc52f..a296544320 100644 --- a/iseq.c +++ b/iseq.c @@ -1595,7 +1595,7 @@ static VALUE 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) } /* 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; diff --git a/re.c b/re.c index 2bda09951d..36b89deeb6 100644 --- a/re.c +++ b/re.c @@ -739,7 +739,7 @@ reg_named_captures_iter(const OnigUChar *name, const OnigUChar *name_end, 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 backref) VALUE regexp = RMATCH(match)->regexp; match_check(match); - switch(TYPE(backref)) { + switch (TYPE(backref)) { default: return NUM2INT(backref); diff --git a/regparse.c b/regparse.c index 70713f6a14..b8ef730f4f 100644 --- a/regparse.c +++ b/regparse.c @@ -2278,7 +2278,7 @@ onig_reduce_nested_quantifier(Node* pnode, Node* cnode) 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, int group, ScanEnv* env) 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; diff --git a/thread_pthread.c b/thread_pthread.c index cbf75aa3e1..32904adbc5 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1006,7 +1006,7 @@ print_signal_list(char *str) 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; } diff --git a/vm_exec.h b/vm_exec.h index 410e3a5130..1c77f3746a 100644 --- a/vm_exec.h +++ b/vm_exec.h @@ -143,8 +143,8 @@ case BIN(insn): #define INSN_DISPATCH() \ - while(1){ \ - switch(GET_CURRENT_INSN()){ + while (1) { \ + switch (GET_CURRENT_INSN()) { #define END_INSNS_DISPATCH() \ default: \ -- cgit v1.2.1