summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-04-19 22:02:10 +0900
committerNobuyoshi Nakada <[email protected]>2025-04-19 22:02:10 +0900
commitc218862d3c664b4afff5acce55d7a6eb13779809 (patch)
treec5dde0ff7443236a9846f95ffffcbb36547e0411
parentd6d4e6877c9670b871ba44b9ca8bece033d17f22 (diff)
Fix style [ci skip]
-rw-r--r--complex.c3
-rw-r--r--enum.c3
-rw-r--r--error.c3
-rw-r--r--gc.c3
-rw-r--r--io.c13
-rw-r--r--iseq.c3
-rw-r--r--string.c26
-rw-r--r--thread.c6
-rw-r--r--thread_none.c3
-rw-r--r--thread_pthread.c3
-rw-r--r--thread_win32.c3
-rw-r--r--vm_eval.c12
-rw-r--r--vm_insnhelper.c9
-rw-r--r--vm_method.c6
14 files changed, 63 insertions, 33 deletions
diff --git a/complex.c b/complex.c
index 6e4ec3b6c2..05c991f35b 100644
--- a/complex.c
+++ b/complex.c
@@ -1065,7 +1065,8 @@ complex_pow_for_special_angle(VALUE self, VALUE other)
else if (f_eqeq_p(dat->real, f_negate(dat->imag))) {
x = dat->imag;
dir = 3;
- } else {
+ }
+ else {
dir = 0;
}
diff --git a/enum.c b/enum.c
index b35abcdd8b..537ecf5532 100644
--- a/enum.c
+++ b/enum.c
@@ -324,7 +324,8 @@ enum_count(int argc, VALUE *argv, VALUE obj)
NORETURN(static void found(VALUE i, VALUE memop));
static void
-found(VALUE i, VALUE memop) {
+found(VALUE i, VALUE memop)
+{
struct MEMO *memo = MEMO_CAST(memop);
MEMO_V1_SET(memo, i);
memo->u3.cnt = 1;
diff --git a/error.c b/error.c
index 1a8a4cd430..d3aeec54d8 100644
--- a/error.c
+++ b/error.c
@@ -4195,7 +4195,8 @@ rb_warn_unchilled_literal(VALUE obj)
VALUE created = get_created_info(str, &line);
if (NIL_P(created)) {
rb_str_cat2(mesg, " (run with --debug-frozen-string-literal for more information)\n");
- } else {
+ }
+ else {
rb_str_cat2(mesg, "\n");
rb_str_append(mesg, created);
if (line) rb_str_catf(mesg, ":%d", line);
diff --git a/gc.c b/gc.c
index 104ed2bb66..6e4c7ff74b 100644
--- a/gc.c
+++ b/gc.c
@@ -990,7 +990,8 @@ rb_gc_obj_slot_size(VALUE obj)
}
static inline void
-gc_validate_pc(void) {
+gc_validate_pc(void)
+{
#if RUBY_DEBUG
rb_execution_context_t *ec = GET_EC();
const rb_control_frame_t *cfp = ec->cfp;
diff --git a/io.c b/io.c
index 7f4efca8da..9a82edae46 100644
--- a/io.c
+++ b/io.c
@@ -1185,7 +1185,8 @@ io_internal_wait(VALUE thread, rb_io_t *fptr, int error, int events, struct time
if (error) {
errno = error;
return -1;
- } else {
+ }
+ else {
// Otherwise, whatever error was generated by `nogvl_wait_for` is the one we want:
return ready;
}
@@ -10987,11 +10988,11 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
static int
is_pos_inf(VALUE x)
{
- double f;
- if (!RB_FLOAT_TYPE_P(x))
- return 0;
- f = RFLOAT_VALUE(x);
- return isinf(f) && 0 < f;
+ double f;
+ if (!RB_FLOAT_TYPE_P(x))
+ return 0;
+ f = RFLOAT_VALUE(x);
+ return isinf(f) && 0 < f;
}
/*
diff --git a/iseq.c b/iseq.c
index 4583591b5d..b793ed7e16 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1842,7 +1842,8 @@ iseqw_s_compile_file_prism(int argc, VALUE *argv, VALUE self)
rb_vm_pop_frame(ec);
RB_GC_GUARD(v);
return ret;
- } else {
+ }
+ else {
pm_parse_result_free(&result);
rb_vm_pop_frame(ec);
RB_GC_GUARD(v);
diff --git a/string.c b/string.c
index 74acaac8d1..49f4f27d5b 100644
--- a/string.c
+++ b/string.c
@@ -594,14 +594,18 @@ struct fstring_table_probe {
int mask;
};
-static int fstring_table_probe_start(struct fstring_table_probe *probe, struct fstring_table_struct *table, VALUE hash_code) {
+static int
+fstring_table_probe_start(struct fstring_table_probe *probe, struct fstring_table_struct *table, VALUE hash_code)
+{
RUBY_ASSERT((table->capacity & (table->capacity - 1)) == 0);
probe->mask = table->capacity - 1;
probe->idx = hash_code & probe->mask;
return probe->idx;
}
-static int fstring_table_probe_next(struct fstring_table_probe *probe) {
+static int
+fstring_table_probe_next(struct fstring_table_probe *probe)
+{
probe->idx = (probe->idx + 1) & probe->mask;
return probe->idx;
}
@@ -769,22 +773,26 @@ fstring_find_or_insert(VALUE hash_code, VALUE value, struct fstr_update_arg *arg
RB_GC_GUARD(table_obj);
return value;
- } else {
+ }
+ else {
// Nothing was inserted
RUBY_ATOMIC_DEC(table->count); // we didn't end up inserting
// Another thread won the race, try again at the same location
continue;
}
- } else if (candidate == FSTRING_TABLE_TOMBSTONE) {
+ }
+ else if (candidate == FSTRING_TABLE_TOMBSTONE) {
// Deleted entry, continue searching
- } else if (candidate == FSTRING_TABLE_MOVED) {
+ }
+ else if (candidate == FSTRING_TABLE_MOVED) {
// Wait
RB_VM_LOCK_ENTER();
RB_VM_LOCK_LEAVE();
goto retry;
- } else {
+ }
+ else {
VALUE candidate_hash = RUBY_ATOMIC_VALUE_LOAD(entry->hash);
if ((candidate_hash == hash_code || candidate_hash == 0) && !fstring_cmp(candidate, value)) {
// We've found a match
@@ -794,7 +802,8 @@ fstring_find_or_insert(VALUE hash_code, VALUE value, struct fstr_update_arg *arg
RUBY_ATOMIC_VALUE_CAS(entry->str, candidate, FSTRING_TABLE_TOMBSTONE);
// Fall through and continue our search
- } else {
+ }
+ else {
RB_GC_GUARD(table_obj);
return candidate;
}
@@ -828,7 +837,8 @@ fstring_delete(VALUE hash_code, VALUE value)
if (candidate == FSTRING_TABLE_EMPTY) {
// We didn't find our string to delete
return;
- } else if (candidate == value) {
+ }
+ else if (candidate == value) {
// We found our string, replace it with a tombstone and increment the count
entry->str = FSTRING_TABLE_TOMBSTONE;
table->deleted_entries++;
diff --git a/thread.c b/thread.c
index 0026ea2b02..d09767cb75 100644
--- a/thread.c
+++ b/thread.c
@@ -693,7 +693,8 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start)
if (state == TAG_NONE) {
// 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.
th->value = result;
- } else {
+ }
+ else {
errinfo = th->ec->errinfo;
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)
rb_thread_t *th = rb_thread_ptr(wfd->busy->closing_thread);
if (th->scheduler != Qnil) {
rb_fiber_scheduler_unblock(th->scheduler, wfd->busy->closing_thread, wfd->busy->closing_fiber);
- } else {
+ }
+ else {
rb_thread_wakeup(wfd->busy->closing_thread);
}
rb_mutex_unlock(wfd->busy->wakeup_mutex);
diff --git a/thread_none.c b/thread_none.c
index 8d32aaabee..d535d9af4c 100644
--- a/thread_none.c
+++ b/thread_none.c
@@ -276,7 +276,8 @@ th_has_dedicated_nt(const rb_thread_t *th)
}
void
-rb_add_running_thread(rb_thread_t *th){
+rb_add_running_thread(rb_thread_t *th)
+{
// do nothing
}
diff --git a/thread_pthread.c b/thread_pthread.c
index 195fe69948..fc96622592 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -430,7 +430,8 @@ ASSERT_thread_sched_locked(struct rb_thread_sched *sched, rb_thread_t *th)
RBIMPL_ATTR_MAYBE_UNUSED()
static unsigned int
-rb_ractor_serial(const rb_ractor_t *r) {
+rb_ractor_serial(const rb_ractor_t *r)
+{
if (r) {
return rb_ractor_id(r);
}
diff --git a/thread_win32.c b/thread_win32.c
index 3bca58cbac..f9c268b117 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -875,7 +875,8 @@ native_thread_native_thread_id(rb_thread_t *th)
#define USE_NATIVE_THREAD_NATIVE_THREAD_ID 1
void
-rb_add_running_thread(rb_thread_t *th){
+rb_add_running_thread(rb_thread_t *th)
+{
// do nothing
}
diff --git a/vm_eval.c b/vm_eval.c
index 229dbf03b3..eb075b8c02 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1742,16 +1742,20 @@ pm_eval_make_iseq(VALUE src, VALUE fname, int line,
RB_GC_GUARD(name_obj);
pm_string_owned_init(scope_local, (uint8_t *) name_dup, length);
- } else if (local == idMULT) {
+ }
+ else if (local == idMULT) {
forwarding |= PM_OPTIONS_SCOPE_FORWARDING_POSITIONALS;
pm_string_constant_init(scope_local, FORWARDING_POSITIONALS_STR, 1);
- } else if (local == idPow) {
+ }
+ else if (local == idPow) {
forwarding |= PM_OPTIONS_SCOPE_FORWARDING_KEYWORDS;
pm_string_constant_init(scope_local, FORWARDING_KEYWORDS_STR, 1);
- } else if (local == idAnd) {
+ }
+ else if (local == idAnd) {
forwarding |= PM_OPTIONS_SCOPE_FORWARDING_BLOCK;
pm_string_constant_init(scope_local, FORWARDING_BLOCK_STR, 1);
- } else if (local == idDot3) {
+ }
+ else if (local == idDot3) {
forwarding |= PM_OPTIONS_SCOPE_FORWARDING_ALL;
pm_string_constant_init(scope_local, FORWARDING_ALL_STR, 1);
}
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 9aa2034b41..1263d27568 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3228,7 +3228,8 @@ vm_callee_setup_arg(rb_execution_context_t *ec, struct rb_calling_info *calling,
vm_ci_flag(ci),
vm_ci_argc(ci),
vm_ci_kwarg(ci));
- } else {
+ }
+ else {
ci = forward_cd->caller_ci;
}
can_fastpath = false;
@@ -5568,7 +5569,8 @@ vm_concat_array(VALUE ary1, VALUE ary2st)
if (NIL_P(tmp2)) {
return rb_ary_push(tmp1, ary2);
- } else {
+ }
+ else {
return rb_ary_concat(tmp1, tmp2);
}
}
@@ -5585,7 +5587,8 @@ vm_concat_to_array(VALUE ary1, VALUE ary2st)
if (NIL_P(tmp2)) {
return rb_ary_push(ary1, ary2);
- } else {
+ }
+ else {
return rb_ary_concat(ary1, tmp2);
}
}
diff --git a/vm_method.c b/vm_method.c
index 95a252337f..4c534b0583 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -361,7 +361,8 @@ vm_ci_hash_cmp(VALUE v1, VALUE v2)
return 1;
}
}
- } else {
+ }
+ else {
VM_ASSERT(ci2->kwarg == NULL); // implied by matching flags
}
return 0;
@@ -382,7 +383,8 @@ ci_lookup_i(st_data_t *key, st_data_t *value, st_data_t data, int existing)
if (rb_objspace_garbage_object_p((VALUE)ci)) {
*ret = (st_data_t)NULL;
return ST_DELETE;
- } else {
+ }
+ else {
*ret = *key;
return ST_STOP;
}