Adjust styles and indents [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2024-01-08 00:50:41 +09:00
parent 76c20b06aa
commit c30b8ae947
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
13 changed files with 155 additions and 143 deletions

View File

@ -3880,7 +3880,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
if ((flag & VM_CALL_ARGS_SPLAT) && !(flag & (VM_CALL_KW_SPLAT|VM_CALL_ARGS_BLOCKARG))) { if ((flag & VM_CALL_ARGS_SPLAT) && !(flag & (VM_CALL_KW_SPLAT|VM_CALL_ARGS_BLOCKARG))) {
OPERAND_AT(iobj, 0) = Qfalse; OPERAND_AT(iobj, 0) = Qfalse;
} }
} else if (IS_NEXT_INSN_ID(niobj, getlocal) || IS_NEXT_INSN_ID(niobj, getinstancevariable)) { }
else if (IS_NEXT_INSN_ID(niobj, getlocal) || IS_NEXT_INSN_ID(niobj, getinstancevariable)) {
niobj = niobj->next; niobj = niobj->next;
if (IS_NEXT_INSN_ID(niobj, send)) { if (IS_NEXT_INSN_ID(niobj, send)) {

3
cont.c
View File

@ -3299,7 +3299,8 @@ rb_fiber_m_kill(VALUE self)
else if (fiber->status != FIBER_TERMINATED) { else if (fiber->status != FIBER_TERMINATED) {
if (fiber_current() == fiber) { if (fiber_current() == fiber) {
fiber_check_killed(fiber); fiber_check_killed(fiber);
} else { }
else {
fiber_raise(fiber_ptr(self), Qnil); fiber_raise(fiber_ptr(self), Qnil);
} }
} }

12
parse.y
View File

@ -12068,7 +12068,8 @@ rb_node_lit_new(struct parser_params *p, VALUE nd_lit, const YYLTYPE *loc)
} }
static rb_node_integer_t * static rb_node_integer_t *
rb_node_integer_new(struct parser_params *p, char* val, int base, const YYLTYPE *loc) { rb_node_integer_new(struct parser_params *p, char* val, int base, const YYLTYPE *loc)
{
rb_node_integer_t *n = NODE_NEWNODE(NODE_INTEGER, rb_node_integer_t, loc); rb_node_integer_t *n = NODE_NEWNODE(NODE_INTEGER, rb_node_integer_t, loc);
n->val = val; n->val = val;
n->minus = FALSE; n->minus = FALSE;
@ -12078,7 +12079,8 @@ rb_node_integer_new(struct parser_params *p, char* val, int base, const YYLTYPE
} }
static rb_node_float_t * static rb_node_float_t *
rb_node_float_new(struct parser_params *p, char* val, const YYLTYPE *loc) { rb_node_float_new(struct parser_params *p, char* val, const YYLTYPE *loc)
{
rb_node_float_t *n = NODE_NEWNODE(NODE_FLOAT, rb_node_float_t, loc); rb_node_float_t *n = NODE_NEWNODE(NODE_FLOAT, rb_node_float_t, loc);
n->val = val; n->val = val;
n->minus = FALSE; n->minus = FALSE;
@ -12087,7 +12089,8 @@ rb_node_float_new(struct parser_params *p, char* val, const YYLTYPE *loc) {
} }
static rb_node_rational_t * static rb_node_rational_t *
rb_node_rational_new(struct parser_params *p, char* val, int base, int seen_point, const YYLTYPE *loc) { rb_node_rational_new(struct parser_params *p, char* val, int base, int seen_point, const YYLTYPE *loc)
{
rb_node_rational_t *n = NODE_NEWNODE(NODE_RATIONAL, rb_node_rational_t, loc); rb_node_rational_t *n = NODE_NEWNODE(NODE_RATIONAL, rb_node_rational_t, loc);
n->val = val; n->val = val;
n->minus = FALSE; n->minus = FALSE;
@ -12098,7 +12101,8 @@ rb_node_rational_new(struct parser_params *p, char* val, int base, int seen_poin
} }
static rb_node_imaginary_t * static rb_node_imaginary_t *
rb_node_imaginary_new(struct parser_params *p, char* val, int base, int seen_point, enum rb_numeric_type numeric_type, const YYLTYPE *loc) { rb_node_imaginary_new(struct parser_params *p, char* val, int base, int seen_point, enum rb_numeric_type numeric_type, const YYLTYPE *loc)
{
rb_node_imaginary_t *n = NODE_NEWNODE(NODE_IMAGINARY, rb_node_imaginary_t, loc); rb_node_imaginary_t *n = NODE_NEWNODE(NODE_IMAGINARY, rb_node_imaginary_t, loc);
n->val = val; n->val = val;
n->minus = FALSE; n->minus = FALSE;

View File

@ -17,8 +17,7 @@ compile_negative_numeric(VALUE val)
} }
#endif #endif
} }
switch (OBJ_BUILTIN_TYPE(val)) switch (OBJ_BUILTIN_TYPE(val)) {
{
case T_BIGNUM: case T_BIGNUM:
BIGNUM_NEGATE(val); BIGNUM_NEGATE(val);
val = rb_big_norm(val); val = rb_big_norm(val);
@ -79,7 +78,8 @@ compile_rational_literal(char* node_val, int base, int seen_point)
memmove(point, point+1, fraclen+1); memmove(point, point+1, fraclen+1);
lit = rb_rational_new(compile_numeric_literal(val, base), rb_int_positive_pow(10, fraclen)); lit = rb_rational_new(compile_numeric_literal(val, base), rb_int_positive_pow(10, fraclen));
} else { }
else {
lit = rb_rational_raw1(compile_numeric_literal(val, base)); lit = rb_rational_raw1(compile_numeric_literal(val, base));
} }

View File

@ -921,7 +921,8 @@ timer_thread_polling(rb_vm_t *vm)
// wakeup timerthread // wakeup timerthread
RUBY_DEBUG_LOG("comm from fd:%d", timer_th.comm_fds[1]); RUBY_DEBUG_LOG("comm from fd:%d", timer_th.comm_fds[1]);
consume_communication_pipe(timer_th.comm_fds[0]); consume_communication_pipe(timer_th.comm_fds[0]);
} else { }
else {
// wakeup specific thread by IO // wakeup specific thread by IO
RUBY_DEBUG_LOG("io event. wakeup_th:%u event:%s%s", RUBY_DEBUG_LOG("io event. wakeup_th:%u event:%s%s",
rb_th_serial(th), rb_th_serial(th),
@ -940,7 +941,8 @@ timer_thread_polling(rb_vm_t *vm)
th->sched.waiting_reason.data.result = filter; th->sched.waiting_reason.data.result = filter;
timer_thread_wakeup_thread(th); timer_thread_wakeup_thread(th);
} else { }
else {
// already released // already released
} }
} }

View File

@ -216,7 +216,8 @@ rb_mod_set_temporary_name(VALUE mod, VALUE name)
if (NIL_P(name)) { if (NIL_P(name)) {
// Set the temporary classpath to NULL (anonymous): // Set the temporary classpath to NULL (anonymous):
RCLASS_SET_CLASSPATH(mod, 0, FALSE); RCLASS_SET_CLASSPATH(mod, 0, FALSE);
} else { }
else {
// Ensure the name is a string: // Ensure the name is a string:
StringValue(name); StringValue(name);

View File

@ -551,7 +551,8 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
arg_rest_dup(args); arg_rest_dup(args);
rb_ary_push(args->rest, converted_keyword_hash); rb_ary_push(args->rest, converted_keyword_hash);
keyword_hash = Qnil; keyword_hash = Qnil;
} else { }
else {
keyword_hash = converted_keyword_hash; keyword_hash = converted_keyword_hash;
} }

View File

@ -5884,7 +5884,8 @@ rb_vm_opt_getconstant_path(rb_execution_context_t *ec, rb_control_frame_t *const
val = ice->value; val = ice->value;
VM_ASSERT(val == vm_get_ev_const_chain(ec, segments)); VM_ASSERT(val == vm_get_ev_const_chain(ec, segments));
} else { }
else {
ruby_vm_constant_cache_misses++; ruby_vm_constant_cache_misses++;
val = vm_get_ev_const_chain(ec, segments); val = vm_get_ev_const_chain(ec, segments);
vm_ic_track_const_chain(GET_CFP(), ic, segments); vm_ic_track_const_chain(GET_CFP(), ic, segments);

View File

@ -1767,7 +1767,8 @@ rb_postponed_job_preregister(unsigned int flags, rb_postponed_job_func_t func, v
* datas being written */ * datas being written */
RUBY_ATOMIC_PTR_EXCHANGE(pjq->table[i].data, data); RUBY_ATOMIC_PTR_EXCHANGE(pjq->table[i].data, data);
return (rb_postponed_job_handle_t)i; return (rb_postponed_job_handle_t)i;
} else { }
else {
/* Try the next slot if this one already has a func in it */ /* Try the next slot if this one already has a func in it */
continue; continue;
} }