diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-27 18:42:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-27 18:42:27 +0900 |
commit | f42230ff2210647d480d02a381065359be993015 (patch) | |
tree | b56f825079885aa90cb274bf76a602bafdeec0e8 | |
parent | 8b9d4b2ce64d496454428292b8d723878906c966 (diff) | |
download | ruby-f42230ff2210647d480d02a381065359be993015.tar.gz |
Adjust styles [ci skip]
-rw-r--r-- | compile.c | 3 | ||||
-rw-r--r-- | debug.c | 3 | ||||
-rw-r--r-- | ext/-test-/enumerator_kw/enumerator_kw.c | 3 | ||||
-rw-r--r-- | ext/-test-/rb_call_super_kw/rb_call_super_kw.c | 3 | ||||
-rw-r--r-- | gc.c | 6 | ||||
-rw-r--r-- | include/ruby/fiber/scheduler.h | 12 | ||||
-rw-r--r-- | io.c | 6 | ||||
-rw-r--r-- | io_buffer.c | 3 | ||||
-rw-r--r-- | missing/flock.c | 8 | ||||
-rw-r--r-- | mjit.c | 3 | ||||
-rw-r--r-- | object.c | 12 | ||||
-rw-r--r-- | thread_pthread.c | 3 | ||||
-rw-r--r-- | vm_insnhelper.c | 3 | ||||
-rw-r--r-- | yjit.c | 3 |
14 files changed, 47 insertions, 24 deletions
@@ -4837,7 +4837,8 @@ struct masgn_state { }; static int -add_masgn_lhs_node(struct masgn_state *state, int lhs_pos, const NODE *line_node, int argc, INSN *before_insn) { +add_masgn_lhs_node(struct masgn_state *state, int lhs_pos, const NODE *line_node, int argc, INSN *before_insn) +{ if (!state) { rb_bug("no masgn_state"); } @@ -348,7 +348,8 @@ setup_debug_log_filter(void) if (*str == '-') { debug_log.filters[i].negative = true; str++; - } else if (*str == '+') { + } + else if (*str == '+') { // negative is false on default. str++; } diff --git a/ext/-test-/enumerator_kw/enumerator_kw.c b/ext/-test-/enumerator_kw/enumerator_kw.c index 947d2b37e6..9104c51869 100644 --- a/ext/-test-/enumerator_kw/enumerator_kw.c +++ b/ext/-test-/enumerator_kw/enumerator_kw.c @@ -14,7 +14,8 @@ enumerator_kw(int argc, VALUE *argv, VALUE self) } void -Init_enumerator_kw(void) { +Init_enumerator_kw(void) +{ VALUE module = rb_define_module("Bug"); module = rb_define_module_under(module, "EnumeratorKw"); rb_define_method(module, "m", enumerator_kw, -1); diff --git a/ext/-test-/rb_call_super_kw/rb_call_super_kw.c b/ext/-test-/rb_call_super_kw/rb_call_super_kw.c index 7f094545d2..61681ed733 100644 --- a/ext/-test-/rb_call_super_kw/rb_call_super_kw.c +++ b/ext/-test-/rb_call_super_kw/rb_call_super_kw.c @@ -7,7 +7,8 @@ rb_call_super_kw_m(int argc, VALUE *argv, VALUE self) } void -Init_rb_call_super_kw(void) { +Init_rb_call_super_kw(void) +{ VALUE module = rb_define_module("Bug"); module = rb_define_module_under(module, "RbCallSuperKw"); rb_define_method(module, "m", rb_call_super_kw_m, -1); @@ -8452,7 +8452,8 @@ gc_compact_move(rb_objspace_t *objspace, rb_heap_t *heap, rb_size_pool_t *size_p } static bool -gc_compact_plane(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *heap, uintptr_t p, bits_t bitset, struct heap_page *page) { +gc_compact_plane(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *heap, uintptr_t p, bits_t bitset, struct heap_page *page) +{ short slot_size = page->slot_size; short slot_bits = slot_size / BASE_SLOT_SIZE; GC_ASSERT(slot_bits > 0); @@ -8511,7 +8512,8 @@ gc_compact_page(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *h } static bool -gc_compact_all_compacted_p(rb_objspace_t *objspace) { +gc_compact_all_compacted_p(rb_objspace_t *objspace) +{ for (int i = 0; i < SIZE_POOL_COUNT; i++) { rb_size_pool_t *size_pool = &size_pools[i]; rb_heap_t *heap = SIZE_POOL_EDEN_HEAP(size_pool); diff --git a/include/ruby/fiber/scheduler.h b/include/ruby/fiber/scheduler.h index ced092adbc..9f67bd5bf6 100644 --- a/include/ruby/fiber/scheduler.h +++ b/include/ruby/fiber/scheduler.h @@ -43,10 +43,12 @@ struct timeval; * @return A `VALUE` which contains the result and/or errno. */ static inline VALUE -rb_fiber_scheduler_io_result(ssize_t result, int error) { +rb_fiber_scheduler_io_result(ssize_t result, int error) +{ if (result == -1) { return RB_INT2NUM(-error); - } else { + } + else { return RB_SIZE2NUM(result); } } @@ -63,11 +65,13 @@ rb_fiber_scheduler_io_result(ssize_t result, int error) { * @return The original result of the system call. */ static inline ssize_t -rb_fiber_scheduler_io_result_apply(VALUE result) { +rb_fiber_scheduler_io_result_apply(VALUE result) +{ if (RB_FIXNUM_P(result) && RB_NUM2INT(result) < 0) { errno = -RB_NUM2INT(result); return -1; - } else { + } + else { return RB_NUM2SIZE(result); } } @@ -1224,7 +1224,8 @@ io_flush_buffer(rb_io_t *fptr) { if (!NIL_P(fptr->write_lock) && rb_mutex_owned_p(fptr->write_lock)) { return (int)io_flush_buffer_async((VALUE)fptr); - } else { + } + else { return (int)rb_mutex_synchronize(fptr->write_lock, io_flush_buffer_async, (VALUE)fptr); } } @@ -1699,7 +1700,8 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync) else { return io_binwrite_string((VALUE)&arg); } - } else { + } + else { if (fptr->wbuf.off) { if (fptr->wbuf.len) MEMMOVE(fptr->wbuf.ptr, fptr->wbuf.ptr+fptr->wbuf.off, char, fptr->wbuf.len); diff --git a/io_buffer.c b/io_buffer.c index 898aa3e796..6ce0dd13df 100644 --- a/io_buffer.c +++ b/io_buffer.c @@ -312,7 +312,8 @@ struct io_buffer_for_yield_instance_arguments { }; static VALUE -io_buffer_for_yield_instance(VALUE _arguments) { +io_buffer_for_yield_instance(VALUE _arguments) +{ struct io_buffer_for_yield_instance_arguments *arguments = (struct io_buffer_for_yield_instance_arguments *)_arguments; rb_str_locktmp(arguments->string); diff --git a/missing/flock.c b/missing/flock.c index 9daf1c38cc..0b76961762 100644 --- a/missing/flock.c +++ b/missing/flock.c @@ -5,9 +5,11 @@ #elif defined __wasi__ #include <errno.h> -int flock(int fd, int operation) { - errno = EINVAL; - return -1; +int +flock(int fd, int operation) +{ + errno = EINVAL; + return -1; } #elif defined HAVE_FCNTL && defined HAVE_FCNTL_H @@ -1501,7 +1501,8 @@ create_unit(const rb_iseq_t *iseq) unit->id = current_unit_num++; if (iseq == NULL) { // Compact unit unit->compact_p = true; - } else { // Normal unit + } + else { // Normal unit unit->iseq = (rb_iseq_t *)iseq; ISEQ_BODY(iseq)->jit_unit = unit; } @@ -1623,16 +1623,19 @@ rb_class_inherited_p(VALUE mod, VALUE arg) return RCLASS_SUPERCLASSES(mod)[arg_depth] == arg ? Qtrue : Qnil; - } else if (arg_depth > mod_depth) { + } + else if (arg_depth > mod_depth) { // check if mod > arg return RCLASS_SUPERCLASSES(arg)[mod_depth] == mod ? Qfalse : Qnil; - } else { + } + else { // Depths match, and we know they aren't equal: no relation return Qnil; } - } else { + } + else { if (!CLASS_OR_MODULE_P(arg) && !RB_TYPE_P(arg, T_ICLASS)) { rb_raise(rb_eTypeError, "compared with non class/module"); } @@ -2025,7 +2028,8 @@ rb_class_superclass(VALUE klass) if (!super) { if (klass == rb_cBasicObject) return Qnil; rb_raise(rb_eTypeError, "uninitialized class"); - } else { + } + else { super = RCLASS_SUPERCLASSES(klass)[RCLASS_SUPERCLASS_DEPTH(klass) - 1]; RUBY_ASSERT(RB_TYPE_P(klass, T_CLASS)); return super; diff --git a/thread_pthread.c b/thread_pthread.c index e748797fe7..c29c7e1958 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -146,7 +146,8 @@ rb_internal_thread_remove_event_hook(rb_internal_thread_event_hook_t * hook) if (rb_internal_thread_event_hooks == hook) { ATOMIC_PTR_EXCHANGE(rb_internal_thread_event_hooks, hook->next); success = TRUE; - } else { + } + else { rb_internal_thread_event_hook_t *h = rb_internal_thread_event_hooks; do { diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 2fb1ecb5f7..2ff48d2662 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -5359,7 +5359,8 @@ vm_opt_ltlt(VALUE recv, VALUE obj) BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) { if (LIKELY(RB_TYPE_P(obj, T_STRING))) { return rb_str_buf_append(recv, obj); - } else { + } + else { return rb_str_concat(recv, obj); } } @@ -91,7 +91,8 @@ rb_yjit_add_frame(VALUE hash, VALUE frame) if (RTEST(rb_hash_aref(hash, frame_id))) { return; - } else { + } + else { VALUE frame_info = rb_hash_new(); // Full label for the frame VALUE name = rb_profile_frame_full_label(frame); |