зеркало из https://github.com/github/ruby.git
Adjust styles [ci skip]
This commit is contained in:
Родитель
8b9d4b2ce6
Коммит
f42230ff22
|
@ -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");
|
||||
}
|
||||
|
|
3
debug.c
3
debug.c
|
@ -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++;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
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
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
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)) {
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
3
mjit.c
3
mjit.c
|
@ -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;
|
||||
}
|
||||
|
|
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 ?
|
||||
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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
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))) {
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
VALUE frame_info = rb_hash_new();
|
||||
// Full label for the frame
|
||||
VALUE name = rb_profile_frame_full_label(frame);
|
||||
|
|
Загрузка…
Ссылка в новой задаче