Adjust styles [ci skip]
This commit is contained in:
parent
8b9d4b2ce6
commit
f42230ff22
@ -4837,7 +4837,8 @@ struct masgn_state {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int
|
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) {
|
if (!state) {
|
||||||
rb_bug("no masgn_state");
|
rb_bug("no masgn_state");
|
||||||
}
|
}
|
||||||
|
3
debug.c
3
debug.c
@ -348,7 +348,8 @@ setup_debug_log_filter(void)
|
|||||||
if (*str == '-') {
|
if (*str == '-') {
|
||||||
debug_log.filters[i].negative = true;
|
debug_log.filters[i].negative = true;
|
||||||
str++;
|
str++;
|
||||||
} else if (*str == '+') {
|
}
|
||||||
|
else if (*str == '+') {
|
||||||
// negative is false on default.
|
// negative is false on default.
|
||||||
str++;
|
str++;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ enumerator_kw(int argc, VALUE *argv, VALUE self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Init_enumerator_kw(void) {
|
Init_enumerator_kw(void)
|
||||||
|
{
|
||||||
VALUE module = rb_define_module("Bug");
|
VALUE module = rb_define_module("Bug");
|
||||||
module = rb_define_module_under(module, "EnumeratorKw");
|
module = rb_define_module_under(module, "EnumeratorKw");
|
||||||
rb_define_method(module, "m", enumerator_kw, -1);
|
rb_define_method(module, "m", enumerator_kw, -1);
|
||||||
|
@ -7,7 +7,8 @@ rb_call_super_kw_m(int argc, VALUE *argv, VALUE self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Init_rb_call_super_kw(void) {
|
Init_rb_call_super_kw(void)
|
||||||
|
{
|
||||||
VALUE module = rb_define_module("Bug");
|
VALUE module = rb_define_module("Bug");
|
||||||
module = rb_define_module_under(module, "RbCallSuperKw");
|
module = rb_define_module_under(module, "RbCallSuperKw");
|
||||||
rb_define_method(module, "m", rb_call_super_kw_m, -1);
|
rb_define_method(module, "m", rb_call_super_kw_m, -1);
|
||||||
|
6
gc.c
6
gc.c
@ -8452,7 +8452,8 @@ gc_compact_move(rb_objspace_t *objspace, rb_heap_t *heap, rb_size_pool_t *size_p
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
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_size = page->slot_size;
|
||||||
short slot_bits = slot_size / BASE_SLOT_SIZE;
|
short slot_bits = slot_size / BASE_SLOT_SIZE;
|
||||||
GC_ASSERT(slot_bits > 0);
|
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
|
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++) {
|
for (int i = 0; i < SIZE_POOL_COUNT; i++) {
|
||||||
rb_size_pool_t *size_pool = &size_pools[i];
|
rb_size_pool_t *size_pool = &size_pools[i];
|
||||||
rb_heap_t *heap = SIZE_POOL_EDEN_HEAP(size_pool);
|
rb_heap_t *heap = SIZE_POOL_EDEN_HEAP(size_pool);
|
||||||
|
@ -43,10 +43,12 @@ struct timeval;
|
|||||||
* @return A `VALUE` which contains the result and/or errno.
|
* @return A `VALUE` which contains the result and/or errno.
|
||||||
*/
|
*/
|
||||||
static inline VALUE
|
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) {
|
if (result == -1) {
|
||||||
return RB_INT2NUM(-error);
|
return RB_INT2NUM(-error);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return RB_SIZE2NUM(result);
|
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.
|
* @return The original result of the system call.
|
||||||
*/
|
*/
|
||||||
static inline ssize_t
|
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) {
|
if (RB_FIXNUM_P(result) && RB_NUM2INT(result) < 0) {
|
||||||
errno = -RB_NUM2INT(result);
|
errno = -RB_NUM2INT(result);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return RB_NUM2SIZE(result);
|
return RB_NUM2SIZE(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
io.c
6
io.c
@ -1224,7 +1224,8 @@ io_flush_buffer(rb_io_t *fptr)
|
|||||||
{
|
{
|
||||||
if (!NIL_P(fptr->write_lock) && rb_mutex_owned_p(fptr->write_lock)) {
|
if (!NIL_P(fptr->write_lock) && rb_mutex_owned_p(fptr->write_lock)) {
|
||||||
return (int)io_flush_buffer_async((VALUE)fptr);
|
return (int)io_flush_buffer_async((VALUE)fptr);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return (int)rb_mutex_synchronize(fptr->write_lock, io_flush_buffer_async, (VALUE)fptr);
|
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 {
|
else {
|
||||||
return io_binwrite_string((VALUE)&arg);
|
return io_binwrite_string((VALUE)&arg);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (fptr->wbuf.off) {
|
if (fptr->wbuf.off) {
|
||||||
if (fptr->wbuf.len)
|
if (fptr->wbuf.len)
|
||||||
MEMMOVE(fptr->wbuf.ptr, fptr->wbuf.ptr+fptr->wbuf.off, char, fptr->wbuf.len);
|
MEMMOVE(fptr->wbuf.ptr, fptr->wbuf.ptr+fptr->wbuf.off, char, fptr->wbuf.len);
|
||||||
|
@ -312,7 +312,8 @@ struct io_buffer_for_yield_instance_arguments {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static VALUE
|
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;
|
struct io_buffer_for_yield_instance_arguments *arguments = (struct io_buffer_for_yield_instance_arguments *)_arguments;
|
||||||
|
|
||||||
rb_str_locktmp(arguments->string);
|
rb_str_locktmp(arguments->string);
|
||||||
|
@ -5,9 +5,11 @@
|
|||||||
#elif defined __wasi__
|
#elif defined __wasi__
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
int flock(int fd, int operation) {
|
int
|
||||||
errno = EINVAL;
|
flock(int fd, int operation)
|
||||||
return -1;
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
|
#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
|
||||||
|
|
||||||
|
3
mjit.c
3
mjit.c
@ -1501,7 +1501,8 @@ create_unit(const rb_iseq_t *iseq)
|
|||||||
unit->id = current_unit_num++;
|
unit->id = current_unit_num++;
|
||||||
if (iseq == NULL) { // Compact unit
|
if (iseq == NULL) { // Compact unit
|
||||||
unit->compact_p = true;
|
unit->compact_p = true;
|
||||||
} else { // Normal unit
|
}
|
||||||
|
else { // Normal unit
|
||||||
unit->iseq = (rb_iseq_t *)iseq;
|
unit->iseq = (rb_iseq_t *)iseq;
|
||||||
ISEQ_BODY(iseq)->jit_unit = unit;
|
ISEQ_BODY(iseq)->jit_unit = unit;
|
||||||
}
|
}
|
||||||
|
12
object.c
12
object.c
@ -1623,16 +1623,19 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
|
|||||||
return RCLASS_SUPERCLASSES(mod)[arg_depth] == arg ?
|
return RCLASS_SUPERCLASSES(mod)[arg_depth] == arg ?
|
||||||
Qtrue :
|
Qtrue :
|
||||||
Qnil;
|
Qnil;
|
||||||
} else if (arg_depth > mod_depth) {
|
}
|
||||||
|
else if (arg_depth > mod_depth) {
|
||||||
// check if mod > arg
|
// check if mod > arg
|
||||||
return RCLASS_SUPERCLASSES(arg)[mod_depth] == mod ?
|
return RCLASS_SUPERCLASSES(arg)[mod_depth] == mod ?
|
||||||
Qfalse :
|
Qfalse :
|
||||||
Qnil;
|
Qnil;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
// Depths match, and we know they aren't equal: no relation
|
// Depths match, and we know they aren't equal: no relation
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (!CLASS_OR_MODULE_P(arg) && !RB_TYPE_P(arg, T_ICLASS)) {
|
if (!CLASS_OR_MODULE_P(arg) && !RB_TYPE_P(arg, T_ICLASS)) {
|
||||||
rb_raise(rb_eTypeError, "compared with non class/module");
|
rb_raise(rb_eTypeError, "compared with non class/module");
|
||||||
}
|
}
|
||||||
@ -2025,7 +2028,8 @@ rb_class_superclass(VALUE klass)
|
|||||||
if (!super) {
|
if (!super) {
|
||||||
if (klass == rb_cBasicObject) return Qnil;
|
if (klass == rb_cBasicObject) return Qnil;
|
||||||
rb_raise(rb_eTypeError, "uninitialized class");
|
rb_raise(rb_eTypeError, "uninitialized class");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
super = RCLASS_SUPERCLASSES(klass)[RCLASS_SUPERCLASS_DEPTH(klass) - 1];
|
super = RCLASS_SUPERCLASSES(klass)[RCLASS_SUPERCLASS_DEPTH(klass) - 1];
|
||||||
RUBY_ASSERT(RB_TYPE_P(klass, T_CLASS));
|
RUBY_ASSERT(RB_TYPE_P(klass, T_CLASS));
|
||||||
return super;
|
return super;
|
||||||
|
@ -146,7 +146,8 @@ rb_internal_thread_remove_event_hook(rb_internal_thread_event_hook_t * hook)
|
|||||||
if (rb_internal_thread_event_hooks == hook) {
|
if (rb_internal_thread_event_hooks == hook) {
|
||||||
ATOMIC_PTR_EXCHANGE(rb_internal_thread_event_hooks, hook->next);
|
ATOMIC_PTR_EXCHANGE(rb_internal_thread_event_hooks, hook->next);
|
||||||
success = TRUE;
|
success = TRUE;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
rb_internal_thread_event_hook_t *h = rb_internal_thread_event_hooks;
|
rb_internal_thread_event_hook_t *h = rb_internal_thread_event_hooks;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -5359,7 +5359,8 @@ vm_opt_ltlt(VALUE recv, VALUE obj)
|
|||||||
BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) {
|
BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) {
|
||||||
if (LIKELY(RB_TYPE_P(obj, T_STRING))) {
|
if (LIKELY(RB_TYPE_P(obj, T_STRING))) {
|
||||||
return rb_str_buf_append(recv, obj);
|
return rb_str_buf_append(recv, obj);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return rb_str_concat(recv, obj);
|
return rb_str_concat(recv, obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
yjit.c
3
yjit.c
@ -91,7 +91,8 @@ rb_yjit_add_frame(VALUE hash, VALUE frame)
|
|||||||
|
|
||||||
if (RTEST(rb_hash_aref(hash, frame_id))) {
|
if (RTEST(rb_hash_aref(hash, frame_id))) {
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
VALUE frame_info = rb_hash_new();
|
VALUE frame_info = rb_hash_new();
|
||||||
// Full label for the frame
|
// Full label for the frame
|
||||||
VALUE name = rb_profile_frame_full_label(frame);
|
VALUE name = rb_profile_frame_full_label(frame);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user