Skip to content

Commit c218862

Browse files
committed
Fix style [ci skip]
1 parent d6d4e68 commit c218862

File tree

14 files changed

+63
-33
lines changed

14 files changed

+63
-33
lines changed

complex.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,8 @@ complex_pow_for_special_angle(VALUE self, VALUE other)
10651065
else if (f_eqeq_p(dat->real, f_negate(dat->imag))) {
10661066
x = dat->imag;
10671067
dir = 3;
1068-
} else {
1068+
}
1069+
else {
10691070
dir = 0;
10701071
}
10711072

enum.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ enum_count(int argc, VALUE *argv, VALUE obj)
324324

325325
NORETURN(static void found(VALUE i, VALUE memop));
326326
static void
327-
found(VALUE i, VALUE memop) {
327+
found(VALUE i, VALUE memop)
328+
{
328329
struct MEMO *memo = MEMO_CAST(memop);
329330
MEMO_V1_SET(memo, i);
330331
memo->u3.cnt = 1;

error.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4195,7 +4195,8 @@ rb_warn_unchilled_literal(VALUE obj)
41954195
VALUE created = get_created_info(str, &line);
41964196
if (NIL_P(created)) {
41974197
rb_str_cat2(mesg, " (run with --debug-frozen-string-literal for more information)\n");
4198-
} else {
4198+
}
4199+
else {
41994200
rb_str_cat2(mesg, "\n");
42004201
rb_str_append(mesg, created);
42014202
if (line) rb_str_catf(mesg, ":%d", line);

gc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,8 @@ rb_gc_obj_slot_size(VALUE obj)
990990
}
991991

992992
static inline void
993-
gc_validate_pc(void) {
993+
gc_validate_pc(void)
994+
{
994995
#if RUBY_DEBUG
995996
rb_execution_context_t *ec = GET_EC();
996997
const rb_control_frame_t *cfp = ec->cfp;

io.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,8 @@ io_internal_wait(VALUE thread, rb_io_t *fptr, int error, int events, struct time
11851185
if (error) {
11861186
errno = error;
11871187
return -1;
1188-
} else {
1188+
}
1189+
else {
11891190
// Otherwise, whatever error was generated by `nogvl_wait_for` is the one we want:
11901191
return ready;
11911192
}
@@ -10987,11 +10988,11 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
1098710988
static int
1098810989
is_pos_inf(VALUE x)
1098910990
{
10990-
double f;
10991-
if (!RB_FLOAT_TYPE_P(x))
10992-
return 0;
10993-
f = RFLOAT_VALUE(x);
10994-
return isinf(f) && 0 < f;
10991+
double f;
10992+
if (!RB_FLOAT_TYPE_P(x))
10993+
return 0;
10994+
f = RFLOAT_VALUE(x);
10995+
return isinf(f) && 0 < f;
1099510996
}
1099610997

1099710998
/*

iseq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,8 @@ iseqw_s_compile_file_prism(int argc, VALUE *argv, VALUE self)
18421842
rb_vm_pop_frame(ec);
18431843
RB_GC_GUARD(v);
18441844
return ret;
1845-
} else {
1845+
}
1846+
else {
18461847
pm_parse_result_free(&result);
18471848
rb_vm_pop_frame(ec);
18481849
RB_GC_GUARD(v);

string.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,18 @@ struct fstring_table_probe {
594594
int mask;
595595
};
596596

597-
static int fstring_table_probe_start(struct fstring_table_probe *probe, struct fstring_table_struct *table, VALUE hash_code) {
597+
static int
598+
fstring_table_probe_start(struct fstring_table_probe *probe, struct fstring_table_struct *table, VALUE hash_code)
599+
{
598600
RUBY_ASSERT((table->capacity & (table->capacity - 1)) == 0);
599601
probe->mask = table->capacity - 1;
600602
probe->idx = hash_code & probe->mask;
601603
return probe->idx;
602604
}
603605

604-
static int fstring_table_probe_next(struct fstring_table_probe *probe) {
606+
static int
607+
fstring_table_probe_next(struct fstring_table_probe *probe)
608+
{
605609
probe->idx = (probe->idx + 1) & probe->mask;
606610
return probe->idx;
607611
}
@@ -769,22 +773,26 @@ fstring_find_or_insert(VALUE hash_code, VALUE value, struct fstr_update_arg *arg
769773

770774
RB_GC_GUARD(table_obj);
771775
return value;
772-
} else {
776+
}
777+
else {
773778
// Nothing was inserted
774779
RUBY_ATOMIC_DEC(table->count); // we didn't end up inserting
775780

776781
// Another thread won the race, try again at the same location
777782
continue;
778783
}
779-
} else if (candidate == FSTRING_TABLE_TOMBSTONE) {
784+
}
785+
else if (candidate == FSTRING_TABLE_TOMBSTONE) {
780786
// Deleted entry, continue searching
781-
} else if (candidate == FSTRING_TABLE_MOVED) {
787+
}
788+
else if (candidate == FSTRING_TABLE_MOVED) {
782789
// Wait
783790
RB_VM_LOCK_ENTER();
784791
RB_VM_LOCK_LEAVE();
785792

786793
goto retry;
787-
} else {
794+
}
795+
else {
788796
VALUE candidate_hash = RUBY_ATOMIC_VALUE_LOAD(entry->hash);
789797
if ((candidate_hash == hash_code || candidate_hash == 0) && !fstring_cmp(candidate, value)) {
790798
// We've found a match
@@ -794,7 +802,8 @@ fstring_find_or_insert(VALUE hash_code, VALUE value, struct fstr_update_arg *arg
794802
RUBY_ATOMIC_VALUE_CAS(entry->str, candidate, FSTRING_TABLE_TOMBSTONE);
795803

796804
// Fall through and continue our search
797-
} else {
805+
}
806+
else {
798807
RB_GC_GUARD(table_obj);
799808
return candidate;
800809
}
@@ -828,7 +837,8 @@ fstring_delete(VALUE hash_code, VALUE value)
828837
if (candidate == FSTRING_TABLE_EMPTY) {
829838
// We didn't find our string to delete
830839
return;
831-
} else if (candidate == value) {
840+
}
841+
else if (candidate == value) {
832842
// We found our string, replace it with a tombstone and increment the count
833843
entry->str = FSTRING_TABLE_TOMBSTONE;
834844
table->deleted_entries++;

thread.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start)
693693
if (state == TAG_NONE) {
694694
// This must be set AFTER doing all user-level code. At this point, the thread is effectively finished and calls to `Thread#join` will succeed.
695695
th->value = result;
696-
} else {
696+
}
697+
else {
697698
errinfo = th->ec->errinfo;
698699

699700
VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
@@ -1726,7 +1727,8 @@ thread_io_wake_pending_closer(struct waiting_fd *wfd)
17261727
rb_thread_t *th = rb_thread_ptr(wfd->busy->closing_thread);
17271728
if (th->scheduler != Qnil) {
17281729
rb_fiber_scheduler_unblock(th->scheduler, wfd->busy->closing_thread, wfd->busy->closing_fiber);
1729-
} else {
1730+
}
1731+
else {
17301732
rb_thread_wakeup(wfd->busy->closing_thread);
17311733
}
17321734
rb_mutex_unlock(wfd->busy->wakeup_mutex);

thread_none.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ th_has_dedicated_nt(const rb_thread_t *th)
276276
}
277277

278278
void
279-
rb_add_running_thread(rb_thread_t *th){
279+
rb_add_running_thread(rb_thread_t *th)
280+
{
280281
// do nothing
281282
}
282283

thread_pthread.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ ASSERT_thread_sched_locked(struct rb_thread_sched *sched, rb_thread_t *th)
430430

431431
RBIMPL_ATTR_MAYBE_UNUSED()
432432
static unsigned int
433-
rb_ractor_serial(const rb_ractor_t *r) {
433+
rb_ractor_serial(const rb_ractor_t *r)
434+
{
434435
if (r) {
435436
return rb_ractor_id(r);
436437
}

0 commit comments

Comments
 (0)