Skip to content

Commit 2e3f818

Browse files
committed
Align styles [ci skip]
1 parent 427ede2 commit 2e3f818

File tree

9 files changed

+56
-27
lines changed

9 files changed

+56
-27
lines changed

compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9530,7 +9530,8 @@ compile_call(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, co
95309530

95319531
ADD_LABEL(ret, not_basic_new_finish);
95329532
ADD_INSN(ret, line_node, pop);
9533-
} else {
9533+
}
9534+
else {
95349535
ADD_SEND_R(ret, line_node, mid, argc, parent_block, INT2FIX(flag), keywords);
95359536
}
95369537

load.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,8 @@ struct rb_vm_call_cfunc2_data {
13711371
};
13721372

13731373
static VALUE
1374-
call_load_ext_in_ns(VALUE data){
1374+
call_load_ext_in_ns(VALUE data)
1375+
{
13751376
struct rb_vm_call_cfunc2_data *arg = (struct rb_vm_call_cfunc2_data *)data;
13761377
return rb_vm_call_cfunc2(arg->recv, load_ext, arg->arg1, arg->arg2, arg->block_handler, arg->filename);
13771378
}

ractor.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ ractor_sleeping_by(const rb_ractor_t *r, rb_thread_t *th, enum rb_ractor_wait_st
538538
if ((th->ractor_waiting.wait_status & wait_status) && th->ractor_waiting.wakeup_status == wakeup_none) {
539539
return th;
540540
}
541-
} else {
541+
}
542+
else {
542543
// find any thread that has this ractor wait status that is blocked
543544
ccan_list_for_each(&r->sync.wait.waiting_threads, th, ractor_waiting.waiting_node) {
544545
if ((th->ractor_waiting.wait_status & wait_status) && th->ractor_waiting.wakeup_status == wakeup_none) {
@@ -679,7 +680,8 @@ ractor_sleep_wo_gvl(void *ptr)
679680
ractor_cond_wait(cr, cur_th);
680681
cur_th->status = THREAD_RUNNABLE;
681682
VM_ASSERT(cur_th->ractor_waiting.wakeup_status != wakeup_none);
682-
} else {
683+
}
684+
else {
683685
RUBY_DEBUG_LOG("rare timing, no cond wait");
684686
}
685687
cur_th->ractor_waiting.wait_status = wait_none;

regenc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,8 @@ onigenc_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const
985985
if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) {
986986
flags |= ONIGENC_CASE_MODIFIED;
987987
code += 'A' - 'a';
988-
} else if (code >= 'A' && code <= 'Z' &&
988+
}
989+
else if (code >= 'A' && code <= 'Z' &&
989990
(flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
990991
flags |= ONIGENC_CASE_MODIFIED;
991992
code += 'a' - 'A';
@@ -1013,7 +1014,8 @@ onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar
10131014
if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) {
10141015
flags |= ONIGENC_CASE_MODIFIED;
10151016
code += 'A' - 'a';
1016-
} else if (code >= 'A' && code <= 'Z' &&
1017+
}
1018+
else if (code >= 'A' && code <= 'Z' &&
10171019
(flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
10181020
flags |= ONIGENC_CASE_MODIFIED;
10191021
code += 'a' - 'A';

regerror.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ onig_error_code_to_str(UChar* s, OnigPosition code, ...)
299299
if (q) {
300300
len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q);
301301
xmemcpy(s, q, len);
302-
} else {
302+
}
303+
else {
303304
len = 0;
304305
}
305306
s[len] = '\0';

regexec.c

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,13 +1174,15 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from)
11741174
stk_base = stk_alloc;\
11751175
stk = stk_base;\
11761176
stk_end = stk_base + msa->stack_n;\
1177-
} else {\
1177+
}\
1178+
else {\
11781179
stk_alloc = (OnigStackType* )xalloca(sizeof(OnigStackType) * (stack_num));\
11791180
stk_base = stk_alloc;\
11801181
stk = stk_base;\
11811182
stk_end = stk_base + (stack_num);\
11821183
}\
1183-
} else if (msa->stack_p) {\
1184+
}\
1185+
else if (msa->stack_p) {\
11841186
alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num));\
11851187
heap_addr = NULL;\
11861188
stk_alloc = (OnigStackType* )(msa->stack_p);\
@@ -1532,7 +1534,8 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
15321534
if (stk->type == STK_MATCH_CACHE_POINT) {\
15331535
msa->match_cache_buf[stk->u.match_cache_point.index] |= stk->u.match_cache_point.mask;\
15341536
MATCH_CACHE_DEBUG_MEMOIZE(stk);\
1535-
} else if (stk->type == STK_ATOMIC_MATCH_CACHE_POINT) {\
1537+
}\
1538+
else if (stk->type == STK_ATOMIC_MATCH_CACHE_POINT) {\
15361539
memoize_extended_match_cache_point(msa->match_cache_buf, stk->u.match_cache_point.index, stk->u.match_cache_point.mask);\
15371540
MATCH_CACHE_DEBUG_MEMOIZE(stkp);\
15381541
}\
@@ -2277,19 +2280,25 @@ find_cache_point(regex_t* reg, const OnigCacheOpcode* cache_opcodes, long num_ca
22772280
cache_point;
22782281
}
22792282

2280-
static int check_extended_match_cache_point(uint8_t *match_cache_buf, long match_cache_point_index, uint8_t match_cache_point_mask) {
2283+
static int
2284+
check_extended_match_cache_point(uint8_t *match_cache_buf, long match_cache_point_index, uint8_t match_cache_point_mask)
2285+
{
22812286
if (match_cache_point_mask & 0x80) {
22822287
return (match_cache_buf[match_cache_point_index + 1] & 0x01) > 0;
2283-
} else {
2288+
}
2289+
else {
22842290
return (match_cache_buf[match_cache_point_index] & (match_cache_point_mask << 1)) > 0;
22852291
}
22862292
}
22872293

2288-
static void memoize_extended_match_cache_point(uint8_t *match_cache_buf, long match_cache_point_index, uint8_t match_cache_point_mask) {
2294+
static void
2295+
memoize_extended_match_cache_point(uint8_t *match_cache_buf, long match_cache_point_index, uint8_t match_cache_point_mask)
2296+
{
22892297
match_cache_buf[match_cache_point_index] |= match_cache_point_mask;
22902298
if (match_cache_point_mask & 0x80) {
22912299
match_cache_buf[match_cache_point_index + 1] |= 0x01;
2292-
} else {
2300+
}
2301+
else {
22932302
match_cache_buf[match_cache_point_index] |= match_cache_point_mask << 1;
22942303
}
22952304
}
@@ -2630,13 +2639,16 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
26302639
if (check_extended_match_cache_point(msa->match_cache_buf, match_cache_point_index, match_cache_point_mask)) {\
26312640
STACK_STOP_BT_FAIL;\
26322641
goto fail;\
2633-
} else goto fail;\
2634-
} else {\
2642+
}\
2643+
else goto fail;\
2644+
}\
2645+
else {\
26352646
if (check_extended_match_cache_point(msa->match_cache_buf, match_cache_point_index, match_cache_point_mask)) {\
26362647
p = cache_opcode->match_addr;\
26372648
MOP_OUT;\
26382649
JUMP;\
2639-
} else goto fail;\
2650+
}\
2651+
else goto fail;\
26402652
}\
26412653
}\
26422654
STACK_PUSH_MATCH_CACHE_POINT(match_cache_point_index, match_cache_point_mask);\

regparse.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5687,7 +5687,8 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],
56875687
if (add_flag) {
56885688
if (is_singlebyte_range(*to, env->enc)) {
56895689
BITSET_SET_BIT(bs, *to);
5690-
} else {
5690+
}
5691+
else {
56915692
r = add_code_range0(&(cc->mbuf), env, *to, *to, 0);
56925693
if (r < 0) return r;
56935694
}
@@ -5699,10 +5700,12 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],
56995700
if (is_singlebyte_range(*to, env->enc)) {
57005701
if (IS_NCCLASS_NOT(cc)) {
57015702
BITSET_CLEAR_BIT(bs, *to);
5702-
} else {
5703+
}
5704+
else {
57035705
BITSET_SET_BIT(bs, *to);
57045706
}
5705-
} else {
5707+
}
5708+
else {
57065709
if (IS_NCCLASS_NOT(cc)) clear_not_flag_cclass(cc, env->enc);
57075710
r = add_code_range0(&(cc->mbuf), env, *to, *to, 0);
57085711
if (r < 0) return r;
@@ -6282,7 +6285,8 @@ is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
62826285
if (b1 != 0) {
62836286
if (((b1 & (b1 - 1)) == 0) && (c == not_found)) {
62846287
c = BITS_IN_ROOM * i + countbits(b1 - 1);
6285-
} else {
6288+
}
6289+
else {
62866290
return 0; /* the character class contains multiple chars */
62876291
}
62886292
}

thread.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,8 @@ rb_io_blocking_operations(struct rb_io *io)
17081708
}
17091709

17101710
static void
1711-
rb_io_blocking_operation_enter(struct rb_io *io, struct rb_io_blocking_operation *blocking_operation) {
1711+
rb_io_blocking_operation_enter(struct rb_io *io, struct rb_io_blocking_operation *blocking_operation)
1712+
{
17121713
ccan_list_add(rb_io_blocking_operations(io), &blocking_operation->list);
17131714
}
17141715

@@ -1718,7 +1719,8 @@ struct io_blocking_operation_arguments {
17181719
};
17191720

17201721
static VALUE
1721-
io_blocking_operation_exit(VALUE _arguments) {
1722+
io_blocking_operation_exit(VALUE _arguments)
1723+
{
17221724
struct io_blocking_operation_arguments *arguments = (void*)_arguments;
17231725
struct rb_io_blocking_operation *blocking_operation = arguments->blocking_operation;
17241726

@@ -1730,7 +1732,8 @@ io_blocking_operation_exit(VALUE _arguments) {
17301732

17311733
if (thread->scheduler != Qnil) {
17321734
rb_fiber_scheduler_unblock(thread->scheduler, io->self, rb_fiberptr_self(fiber));
1733-
} else {
1735+
}
1736+
else {
17341737
rb_thread_wakeup(thread->self);
17351738
}
17361739

@@ -1749,7 +1752,8 @@ rb_io_blocking_operation_exit(struct rb_io *io, struct rb_io_blocking_operation
17491752
};
17501753

17511754
rb_mutex_synchronize(wakeup_mutex, io_blocking_operation_exit, (VALUE)&arguments);
1752-
} else {
1755+
}
1756+
else {
17531757
ccan_list_del(&blocking_operation->list);
17541758
}
17551759
}
@@ -4594,7 +4598,8 @@ thread_io_wait(struct rb_io *io, int fd, int events, struct timeval *timeout)
45944598
blocking_operation.ec = GET_EC();
45954599
rb_io_blocking_operation_enter(io, &blocking_operation);
45964600
args.blocking_operation = &blocking_operation;
4597-
} else {
4601+
}
4602+
else {
45984603
args.io = NULL;
45994604
blocking_operation.ec = NULL;
46004605
args.blocking_operation = NULL;

vm_eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ gccct_method_search(rb_execution_context_t *ec, VALUE recv, ID mid, const struct
460460

461461
if (NAMESPACE_USER_P(ns)) {
462462
ns_value = ns->ns_object;
463-
} else {
463+
}
464+
else {
464465
ns_value = 0;
465466
}
466467
// search global method cache

0 commit comments

Comments
 (0)