adjust style

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-12-29 12:22:04 +00:00
parent e878df745c
commit be7bf5aa0c
12 changed files with 18 additions and 18 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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),

4
cont.c
View File

@ -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:

2
gc.c
View File

@ -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;

2
hash.c
View File

@ -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);

2
io.c
View File

@ -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);

4
iseq.c
View File

@ -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;

4
re.c
View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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: \