diff options
Diffstat (limited to 'ext/-test-')
-rw-r--r-- | ext/-test-/debug/inspector.c | 14 | ||||
-rw-r--r-- | ext/-test-/debug/profile_frames.c | 26 | ||||
-rw-r--r-- | ext/-test-/file/fs.c | 14 | ||||
-rw-r--r-- | ext/-test-/funcall/funcall.c | 12 | ||||
-rw-r--r-- | ext/-test-/gvl/call_without_gvl/call_without_gvl.c | 2 | ||||
-rw-r--r-- | ext/-test-/memory_status/memory_status.c | 12 | ||||
-rw-r--r-- | ext/-test-/printf/printf.c | 64 | ||||
-rw-r--r-- | ext/-test-/proc/super.c | 2 | ||||
-rw-r--r-- | ext/-test-/st/foreach/foreach.c | 100 | ||||
-rw-r--r-- | ext/-test-/st/numhash/numhash.c | 16 | ||||
-rw-r--r-- | ext/-test-/st/update/update.c | 12 | ||||
-rw-r--r-- | ext/-test-/string/coderange.c | 8 | ||||
-rw-r--r-- | ext/-test-/string/cstr.c | 16 | ||||
-rw-r--r-- | ext/-test-/string/qsort.c | 14 | ||||
-rw-r--r-- | ext/-test-/struct/member.c | 2 | ||||
-rw-r--r-- | ext/-test-/symbol/type.c | 6 | ||||
-rw-r--r-- | ext/-test-/tracepoint/gc_hook.c | 26 | ||||
-rw-r--r-- | ext/-test-/tracepoint/tracepoint.c | 54 | ||||
-rw-r--r-- | ext/-test-/typeddata/typeddata.c | 2 | ||||
-rw-r--r-- | ext/-test-/vm/at_exit.c | 12 | ||||
-rw-r--r-- | ext/-test-/win32/console/attribute.c | 18 | ||||
-rw-r--r-- | ext/-test-/win32/fd_setsize/fd_setsize.c | 10 |
22 files changed, 221 insertions, 221 deletions
diff --git a/ext/-test-/debug/inspector.c b/ext/-test-/debug/inspector.c index f0c58e59f9..25f9d894d3 100644 --- a/ext/-test-/debug/inspector.c +++ b/ext/-test-/debug/inspector.c @@ -8,13 +8,13 @@ callback(const rb_debug_inspector_t *dbg_context, void *data) long i, len = RARRAY_LEN(locs); VALUE binds = rb_ary_new(); for (i = 0; i < len; ++i) { - VALUE entry = rb_ary_new(); - rb_ary_push(binds, entry); - rb_ary_push(entry, rb_debug_inspector_frame_self_get(dbg_context, i)); - rb_ary_push(entry, rb_debug_inspector_frame_binding_get(dbg_context, i)); - rb_ary_push(entry, rb_debug_inspector_frame_class_get(dbg_context, i)); - rb_ary_push(entry, rb_debug_inspector_frame_iseq_get(dbg_context, i)); - rb_ary_push(entry, rb_ary_entry(locs, i)); + VALUE entry = rb_ary_new(); + rb_ary_push(binds, entry); + rb_ary_push(entry, rb_debug_inspector_frame_self_get(dbg_context, i)); + rb_ary_push(entry, rb_debug_inspector_frame_binding_get(dbg_context, i)); + rb_ary_push(entry, rb_debug_inspector_frame_class_get(dbg_context, i)); + rb_ary_push(entry, rb_debug_inspector_frame_iseq_get(dbg_context, i)); + rb_ary_push(entry, rb_ary_entry(locs, i)); } return binds; } diff --git a/ext/-test-/debug/profile_frames.c b/ext/-test-/debug/profile_frames.c index 1656ff7d4b..5f14755ce7 100644 --- a/ext/-test-/debug/profile_frames.c +++ b/ext/-test-/debug/profile_frames.c @@ -18,19 +18,19 @@ profile_frames(VALUE self, VALUE start_v, VALUE num_v) collected_size = rb_profile_frames(start, buff_size, buff, lines); for (i=0; i<collected_size; i++) { - VALUE ary = rb_ary_new(); - rb_ary_push(ary, rb_profile_frame_path(buff[i])); - rb_ary_push(ary, rb_profile_frame_absolute_path(buff[i])); - rb_ary_push(ary, rb_profile_frame_label(buff[i])); - rb_ary_push(ary, rb_profile_frame_base_label(buff[i])); - rb_ary_push(ary, rb_profile_frame_full_label(buff[i])); - rb_ary_push(ary, rb_profile_frame_first_lineno(buff[i])); - rb_ary_push(ary, rb_profile_frame_classpath(buff[i])); - rb_ary_push(ary, rb_profile_frame_singleton_method_p(buff[i])); - rb_ary_push(ary, rb_profile_frame_method_name(buff[i])); - rb_ary_push(ary, rb_profile_frame_qualified_method_name(buff[i])); - - rb_ary_push(result, ary); + VALUE ary = rb_ary_new(); + rb_ary_push(ary, rb_profile_frame_path(buff[i])); + rb_ary_push(ary, rb_profile_frame_absolute_path(buff[i])); + rb_ary_push(ary, rb_profile_frame_label(buff[i])); + rb_ary_push(ary, rb_profile_frame_base_label(buff[i])); + rb_ary_push(ary, rb_profile_frame_full_label(buff[i])); + rb_ary_push(ary, rb_profile_frame_first_lineno(buff[i])); + rb_ary_push(ary, rb_profile_frame_classpath(buff[i])); + rb_ary_push(ary, rb_profile_frame_singleton_method_p(buff[i])); + rb_ary_push(ary, rb_profile_frame_method_name(buff[i])); + rb_ary_push(ary, rb_profile_frame_qualified_method_name(buff[i])); + + rb_ary_push(result, ary); } return result; diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c index 1a6c3d06dc..eb17e9768e 100644 --- a/ext/-test-/file/fs.c +++ b/ext/-test-/file/fs.c @@ -54,24 +54,24 @@ get_fsname(VALUE self, VALUE str) FilePathValue(str); str = rb_str_encode_ospath(str); if (STATFS(StringValueCStr(str), &st) == -1) { - rb_sys_fail_str(str); + rb_sys_fail_str(str); } # ifdef HAVE_STRUCT_STATFS_T_F_FSTYPENAME if (st.f_fstypename[0]) - return CSTR(st.f_fstypename); + return CSTR(st.f_fstypename); # endif # ifdef HAVE_STRUCT_STATFS_T_F_TYPE switch (st.f_type) { case 0x9123683E: /* BTRFS_SUPER_MAGIC */ - return CSTR("btrfs"); + return CSTR("btrfs"); case 0x7461636f: /* OCFS2_SUPER_MAGIC */ - return CSTR("ocfs"); + return CSTR("ocfs"); case 0xEF53: /* EXT2_SUPER_MAGIC EXT3_SUPER_MAGIC EXT4_SUPER_MAGIC */ - return CSTR("ext4"); + return CSTR("ext4"); case 0x58465342: /* XFS_SUPER_MAGIC */ - return CSTR("xfs"); + return CSTR("xfs"); case 0x01021994: /* TMPFS_MAGIC */ - return CSTR("tmpfs"); + return CSTR("tmpfs"); } # endif #endif diff --git a/ext/-test-/funcall/funcall.c b/ext/-test-/funcall/funcall.c index 43521bf2e9..a68d6de255 100644 --- a/ext/-test-/funcall/funcall.c +++ b/ext/-test-/funcall/funcall.c @@ -47,17 +47,17 @@ Init_funcall(void) VALUE cRelay = rb_define_module_under(cTestFuncall, "Relay"); rb_define_singleton_method(cRelay, - "with_funcall2", - with_funcall2, - -1); + "with_funcall2", + with_funcall2, + -1); rb_define_singleton_method(cRelay, "with_funcall_passing_block_kw", with_funcall_passing_block_kw, -1); rb_define_singleton_method(cRelay, - "with_funcall_passing_block", - with_funcall_passing_block, - -1); + "with_funcall_passing_block", + with_funcall_passing_block, + -1); rb_define_singleton_method(cRelay, "with_funcallv_public_kw", with_funcallv_public_kw, diff --git a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c index 233635421b..97946e925d 100644 --- a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c +++ b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c @@ -17,7 +17,7 @@ thread_runnable_sleep(VALUE thread, VALUE timeout) struct timeval timeval; if (NIL_P(timeout)) { - rb_raise(rb_eArgError, "timeout must be non nil"); + rb_raise(rb_eArgError, "timeout must be non nil"); } timeval = rb_time_interval(timeout); diff --git a/ext/-test-/memory_status/memory_status.c b/ext/-test-/memory_status/memory_status.c index afacbee785..f124c97ca1 100644 --- a/ext/-test-/memory_status/memory_status.c +++ b/ext/-test-/memory_status/memory_status.c @@ -34,7 +34,7 @@ read_status(VALUE self) taskinfo.virtual_size = 0; taskinfo.resident_size = 0; error = task_info(mach_task_self(), flavor, - (task_info_t)&taskinfo, &out_count); + (task_info_t)&taskinfo, &out_count); if (error != KERN_SUCCESS) return Qnil; #ifndef ULL2NUM /* "long long" does not exist here, use size_t instead. */ @@ -50,7 +50,7 @@ read_status(VALUE self) PROCESS_MEMORY_COUNTERS c; c.cb = sizeof(c); if (!GetProcessMemoryInfo(GetCurrentProcess(), &c, c.cb)) - return Qnil; + return Qnil; size = SIZET2NUM(c.PagefileUsage); rss = SIZET2NUM(c.WorkingSetSize); peak = SIZET2NUM(c.PeakWorkingSetSize); @@ -68,13 +68,13 @@ Init_memory_status(void) { VALUE mMemory = rb_define_module("Memory"); cMemoryStatus = - rb_struct_define_under(mMemory, "Status", "size", + rb_struct_define_under(mMemory, "Status", "size", #ifdef HAVE_RSS - "rss", + "rss", #endif #ifdef HAVE_PEAK - "peak", + "peak", #endif - (char *)NULL); + (char *)NULL); rb_define_method(cMemoryStatus, "_update", read_status, 0); } diff --git a/ext/-test-/printf/printf.c b/ext/-test-/printf/printf.c index e793bb7a48..889c0d9f0d 100644 --- a/ext/-test-/printf/printf.c +++ b/ext/-test-/printf/printf.c @@ -25,7 +25,7 @@ uint_to_str(char *p, char *e, unsigned int x) char *e0 = e; if (e <= p) return p; do { - *--e = x % 10 + '0'; + *--e = x % 10 + '0'; } while ((x /= 10) != 0 && e > p); memmove(p, e, e0 - e); return p + (e0 - e); @@ -44,48 +44,48 @@ printf_test_call(int argc, VALUE *argv, VALUE self) if (RSTRING_LEN(type) != 1) rb_raise(rb_eArgError, "wrong length(%ld)", RSTRING_LEN(type)); switch (cnv = RSTRING_PTR(type)[0]) { case 'd': case 'x': case 'o': case 'X': - n = NUM2INT(num); - break; + n = NUM2INT(num); + break; case 's': - s = StringValueCStr(num); - break; + s = StringValueCStr(num); + break; default: rb_raise(rb_eArgError, "wrong conversion(%c)", cnv); } *p++ = '%'; if (!NIL_P(opt)) { - VALUE v; - Check_Type(opt, T_HASH); - if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("space"))))) { - *p++ = ' '; - } - if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("hash"))))) { - *p++ = '#'; - } - if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("plus"))))) { - *p++ = '+'; - } - if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("minus"))))) { - *p++ = '-'; - } - if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("zero"))))) { - *p++ = '0'; - } - if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("width"))))) { - p = uint_to_str(p, format + sizeof(format), NUM2UINT(v)); - } - if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("prec"))))) { - *p++ = '.'; - if (FIXNUM_P(v)) - p = uint_to_str(p, format + sizeof(format), NUM2UINT(v)); - } + VALUE v; + Check_Type(opt, T_HASH); + if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("space"))))) { + *p++ = ' '; + } + if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("hash"))))) { + *p++ = '#'; + } + if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("plus"))))) { + *p++ = '+'; + } + if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("minus"))))) { + *p++ = '-'; + } + if (RTEST(rb_hash_aref(opt, ID2SYM(rb_intern("zero"))))) { + *p++ = '0'; + } + if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("width"))))) { + p = uint_to_str(p, format + sizeof(format), NUM2UINT(v)); + } + if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("prec"))))) { + *p++ = '.'; + if (FIXNUM_P(v)) + p = uint_to_str(p, format + sizeof(format), NUM2UINT(v)); + } } *p++ = cnv; *p++ = '\0'; if (cnv == 's') { - result = rb_enc_sprintf(rb_usascii_encoding(), format, s); + result = rb_enc_sprintf(rb_usascii_encoding(), format, s); } else { - result = rb_enc_sprintf(rb_usascii_encoding(), format, n); + result = rb_enc_sprintf(rb_usascii_encoding(), format, n); } return rb_assoc_new(result, rb_usascii_str_new_cstr(format)); } diff --git a/ext/-test-/proc/super.c b/ext/-test-/proc/super.c index dbe8af08f1..816520e1df 100644 --- a/ext/-test-/proc/super.c +++ b/ext/-test-/proc/super.c @@ -9,7 +9,7 @@ bug_proc_call_super(RB_BLOCK_CALL_FUNC_ARGLIST(yieldarg, procarg)) args[1] = procarg; ret = rb_call_super(2, args); if (!NIL_P(blockarg)) { - ret = rb_proc_call(blockarg, ret); + ret = rb_proc_call(blockarg, ret); } return ret; } diff --git a/ext/-test-/st/foreach/foreach.c b/ext/-test-/st/foreach/foreach.c index 27ac18046f..cde49fb26d 100644 --- a/ext/-test-/st/foreach/foreach.c +++ b/ext/-test-/st/foreach/foreach.c @@ -12,22 +12,22 @@ static void force_unpack_check(struct checker *c, st_data_t key, st_data_t val) { if (c->nr == 0) { - st_data_t i; + st_data_t i; - if (c->tbl->bins != NULL) rb_bug("should be packed\n"); + if (c->tbl->bins != NULL) rb_bug("should be packed\n"); - /* force unpacking during iteration: */ - for (i = 1; i < expect_size; i++) - st_add_direct(c->tbl, i, i); + /* force unpacking during iteration: */ + for (i = 1; i < expect_size; i++) + st_add_direct(c->tbl, i, i); - if (c->tbl->bins == NULL) rb_bug("should be unpacked\n"); + if (c->tbl->bins == NULL) rb_bug("should be unpacked\n"); } if (key != c->nr) { - rb_bug("unexpected key: %"PRIuVALUE" (expected %"PRIuVALUE")\n", (VALUE)key, (VALUE)c->nr); + rb_bug("unexpected key: %"PRIuVALUE" (expected %"PRIuVALUE")\n", (VALUE)key, (VALUE)c->nr); } if (val != c->nr) { - rb_bug("unexpected val: %"PRIuVALUE" (expected %"PRIuVALUE")\n", (VALUE)val, (VALUE)c->nr); + rb_bug("unexpected val: %"PRIuVALUE" (expected %"PRIuVALUE")\n", (VALUE)val, (VALUE)c->nr); } c->nr++; @@ -39,34 +39,34 @@ unp_fec_i(st_data_t key, st_data_t val, st_data_t args, int error) struct checker *c = (struct checker *)args; if (error) { - if (c->test == ID2SYM(rb_intern("delete2"))) - return ST_STOP; + if (c->test == ID2SYM(rb_intern("delete2"))) + return ST_STOP; - rb_bug("unexpected error"); + rb_bug("unexpected error"); } force_unpack_check(c, key, val); if (c->test == ID2SYM(rb_intern("check"))) { - return ST_CHECK; + return ST_CHECK; } if (c->test == ID2SYM(rb_intern("delete1"))) { - if (c->nr == 1) return ST_DELETE; - return ST_CHECK; + if (c->nr == 1) return ST_DELETE; + return ST_CHECK; } if (c->test == ID2SYM(rb_intern("delete2"))) { - if (c->nr == 1) { - st_data_t k = 0; - st_data_t v; - - if (!st_delete(c->tbl, &k, &v)) { - rb_bug("failed to delete\n"); - } - if (v != 0) { - rb_bug("unexpected value deleted: %"PRIuVALUE" (expected 0)", (VALUE)v); - } - } - return ST_CHECK; + if (c->nr == 1) { + st_data_t k = 0; + st_data_t v; + + if (!st_delete(c->tbl, &k, &v)) { + rb_bug("failed to delete\n"); + } + if (v != 0) { + rb_bug("unexpected value deleted: %"PRIuVALUE" (expected 0)", (VALUE)v); + } + } + return ST_CHECK; } rb_raise(rb_eArgError, "unexpected arg: %+"PRIsVALUE, c->test); @@ -89,13 +89,13 @@ unp_fec(VALUE self, VALUE test) st_foreach_check(tbl, unp_fec_i, (st_data_t)&c, -1); if (c.test == ID2SYM(rb_intern("delete2"))) { - if (c.nr != 1) { - rb_bug("mismatched iteration: %"PRIuVALUE" (expected 1)\n", (VALUE)c.nr); - } + if (c.nr != 1) { + rb_bug("mismatched iteration: %"PRIuVALUE" (expected 1)\n", (VALUE)c.nr); + } } else if (c.nr != expect_size) { - rb_bug("mismatched iteration: %"PRIuVALUE" (expected %"PRIuVALUE")\n", - (VALUE)c.nr, (VALUE)expect_size); + rb_bug("mismatched iteration: %"PRIuVALUE" (expected %"PRIuVALUE")\n", + (VALUE)c.nr, (VALUE)expect_size); } if (tbl->bins == NULL) rb_bug("should be unpacked\n"); @@ -112,22 +112,22 @@ unp_fe_i(st_data_t key, st_data_t val, st_data_t args) force_unpack_check(c, key, val); if (c->test == ID2SYM(rb_intern("unpacked"))) { - return ST_CONTINUE; + return ST_CONTINUE; } else if (c->test == ID2SYM(rb_intern("unpack_delete"))) { - if (c->nr == 1) { - st_data_t k = 0; - st_data_t v; - - if (!st_delete(c->tbl, &k, &v)) { - rb_bug("failed to delete\n"); - } - if (v != 0) { - rb_bug("unexpected value deleted: %"PRIuVALUE" (expected 0)", (VALUE)v); - } - return ST_CONTINUE; - } - rb_bug("should never get here\n"); + if (c->nr == 1) { + st_data_t k = 0; + st_data_t v; + + if (!st_delete(c->tbl, &k, &v)) { + rb_bug("failed to delete\n"); + } + if (v != 0) { + rb_bug("unexpected value deleted: %"PRIuVALUE" (expected 0)", (VALUE)v); + } + return ST_CONTINUE; + } + rb_bug("should never get here\n"); } rb_raise(rb_eArgError, "unexpected arg: %+"PRIsVALUE, c->test); @@ -150,13 +150,13 @@ unp_fe(VALUE self, VALUE test) st_foreach(tbl, unp_fe_i, (st_data_t)&c); if (c.test == ID2SYM(rb_intern("unpack_delete"))) { - if (c.nr != 1) { - rb_bug("mismatched iteration: %"PRIuVALUE" (expected 1)\n", (VALUE)c.nr); - } + if (c.nr != 1) { + rb_bug("mismatched iteration: %"PRIuVALUE" (expected 1)\n", (VALUE)c.nr); + } } else if (c.nr != expect_size) { - rb_bug("mismatched iteration: %"PRIuVALUE" (expected %"PRIuVALUE"o)\n", - (VALUE)c.nr, (VALUE)expect_size); + rb_bug("mismatched iteration: %"PRIuVALUE" (expected %"PRIuVALUE"o)\n", + (VALUE)c.nr, (VALUE)expect_size); } if (tbl->bins == NULL) rb_bug("should be unpacked\n"); diff --git a/ext/-test-/st/numhash/numhash.c b/ext/-test-/st/numhash/numhash.c index aa8015e86c..7e8d5d9fe2 100644 --- a/ext/-test-/st/numhash/numhash.c +++ b/ext/-test-/st/numhash/numhash.c @@ -42,7 +42,7 @@ numhash_aref(VALUE self, VALUE key) st_table *tbl = (st_table *)Check_TypedStruct(self, &numhash_type); if (!SPECIAL_CONST_P(key)) rb_raise(rb_eArgError, "not a special const"); if (st_lookup(tbl, (st_data_t)key, &data)) - return (VALUE)data; + return (VALUE)data; return Qnil; } @@ -79,12 +79,12 @@ update_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing) VALUE ret = rb_yield_values(existing ? 2 : 1, (VALUE)*key, (VALUE)*value); switch (ret) { case Qfalse: - return ST_STOP; + return ST_STOP; case Qnil: - return ST_DELETE; + return ST_DELETE; default: - *value = ret; - return ST_CONTINUE; + *value = ret; + return ST_CONTINUE; } } @@ -93,9 +93,9 @@ numhash_update(VALUE self, VALUE key) { st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type); if (st_update(table, (st_data_t)key, update_func, 0)) - return Qtrue; + return Qtrue; else - return Qfalse; + return Qfalse; } #if SIZEOF_LONG == SIZEOF_VOIDP @@ -117,7 +117,7 @@ numhash_delete_safe(VALUE self, VALUE key) st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type); st_data_t val, k = (st_data_t)key; if (st_delete_safe(table, &k, &val, (st_data_t)self)) { - return val; + return val; } return Qnil; } diff --git a/ext/-test-/st/update/update.c b/ext/-test-/st/update/update.c index 979ad3e334..ea7fab12e1 100644 --- a/ext/-test-/st/update/update.c +++ b/ext/-test-/st/update/update.c @@ -7,12 +7,12 @@ update_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing) VALUE ret = rb_yield_values(existing ? 2 : 1, (VALUE)*key, (VALUE)*value); switch (ret) { case Qfalse: - return ST_STOP; + return ST_STOP; case Qnil: - return ST_DELETE; + return ST_DELETE; default: - *value = ret; - return ST_CONTINUE; + *value = ret; + return ST_CONTINUE; } } @@ -20,9 +20,9 @@ static VALUE test_st_update(VALUE self, VALUE key) { if (st_update(RHASH_TBL(self), (st_data_t)key, update_func, 0)) - return Qtrue; + return Qtrue; else - return Qfalse; + return Qfalse; } void diff --git a/ext/-test-/string/coderange.c b/ext/-test-/string/coderange.c index bc998ca372..4197ecca9f 100644 --- a/ext/-test-/string/coderange.c +++ b/ext/-test-/string/coderange.c @@ -8,13 +8,13 @@ coderange_int2sym(int coderange) { switch (coderange) { case ENC_CODERANGE_7BIT: - return sym_7bit; + return sym_7bit; case ENC_CODERANGE_VALID: - return sym_valid; + return sym_valid; case ENC_CODERANGE_UNKNOWN: - return sym_unknown; + return sym_unknown; case ENC_CODERANGE_BROKEN: - return sym_broken; + return sym_broken; } rb_bug("wrong condition of coderange"); UNREACHABLE_RETURN(Qnil); diff --git a/ext/-test-/string/cstr.c b/ext/-test-/string/cstr.c index 1eadb8b4fd..468ee7a3b1 100644 --- a/ext/-test-/string/cstr.c +++ b/ext/-test-/string/cstr.c @@ -42,11 +42,11 @@ bug_str_cstr_term_char(VALUE str) len = rb_enc_mbminlen(enc); c = rb_enc_precise_mbclen(s, s + len, enc); if (!MBCLEN_CHARFOUND_P(c)) { - c = (unsigned char)*s; + c = (unsigned char)*s; } else { - c = rb_enc_mbc_to_codepoint(s, s + len, enc); - if (!c) return Qnil; + c = rb_enc_mbc_to_codepoint(s, s + len, enc); + if (!c) return Qnil; } return rb_enc_uint_chr((unsigned int)c, enc); } @@ -65,14 +65,14 @@ bug_str_unterminated_substring(VALUE str, VALUE vbeg, VALUE vlen) #if USE_RVARGC RSTRING(str)->as.embed.len = (short)len; #else - RSTRING(str)->basic.flags &= ~RSTRING_EMBED_LEN_MASK; - RSTRING(str)->basic.flags |= len << RSTRING_EMBED_LEN_SHIFT; + RSTRING(str)->basic.flags &= ~RSTRING_EMBED_LEN_MASK; + RSTRING(str)->basic.flags |= len << RSTRING_EMBED_LEN_SHIFT; #endif memmove(RSTRING(str)->as.embed.ary, RSTRING(str)->as.embed.ary + beg, len); } else { - RSTRING(str)->as.heap.ptr += beg; - RSTRING(str)->as.heap.len = len; + RSTRING(str)->as.heap.ptr += beg; + RSTRING(str)->as.heap.len = len; } return str; } @@ -104,7 +104,7 @@ bug_str_s_cstr_term_char(VALUE self, VALUE str) const int term_fill_len = (termlen);\ *term_fill_ptr = '\0';\ if (UNLIKELY(term_fill_len > 1))\ - memset(term_fill_ptr, 0, term_fill_len);\ + memset(term_fill_ptr, 0, term_fill_len);\ } while (0) static VALUE diff --git a/ext/-test-/string/qsort.c b/ext/-test-/string/qsort.c index fb7ea3d8cb..4a641e74e3 100644 --- a/ext/-test-/string/qsort.c +++ b/ext/-test-/string/qsort.c @@ -35,22 +35,22 @@ bug_str_qsort_bang(int argc, VALUE *argv, VALUE str) rb_scan_args(argc, argv, "03", &beg, &len, &size); l = RSTRING_LEN(str); if (!NIL_P(beg) && (b = NUM2INT(beg)) < 0 && (b += l) < 0) { - rb_raise(rb_eArgError, "out of bounds"); + rb_raise(rb_eArgError, "out of bounds"); } if (!NIL_P(size) && (s = NUM2INT(size)) < 0) { - rb_raise(rb_eArgError, "negative size"); + rb_raise(rb_eArgError, "negative size"); } if (NIL_P(len) || - (((n = NUM2INT(len)) < 0) ? - (rb_raise(rb_eArgError, "negative length"), 0) : - (b + n * s > l))) { - n = (l - b) / s; + (((n = NUM2INT(len)) < 0) ? + (rb_raise(rb_eArgError, "negative length"), 0) : + (b + n * s > l))) { + n = (l - b) / s; } rb_str_modify(str); d.enc = rb_enc_get(str); d.elsize = s; ruby_qsort(RSTRING_PTR(str) + b, n, s, - rb_block_given_p() ? cmp_1 : cmp_2, &d); + rb_block_given_p() ? cmp_1 : cmp_2, &d); return str; } diff --git a/ext/-test-/struct/member.c b/ext/-test-/struct/member.c index 1d404039b4..f5400fe477 100644 --- a/ext/-test-/struct/member.c +++ b/ext/-test-/struct/member.c @@ -6,7 +6,7 @@ bug_struct_get(VALUE obj, VALUE name) ID id = rb_check_id(&name); if (!id) { - rb_name_error_str(name, "`%"PRIsVALUE"' is not a struct member", name); + rb_name_error_str(name, "`%"PRIsVALUE"' is not a struct member", name); } return rb_struct_getmember(obj, id); } diff --git a/ext/-test-/symbol/type.c b/ext/-test-/symbol/type.c index e51e09eb26..8d0e647340 100644 --- a/ext/-test-/symbol/type.c +++ b/ext/-test-/symbol/type.c @@ -2,12 +2,12 @@ #ifdef HAVE_RB_IS_CONST_NAME # define get_symbol_type(type, t, name) do { \ - ID id = rb_check_id(&name); \ - t = (id ? rb_is_##type##_id(id) : rb_is_##type##_name(name)); \ + ID id = rb_check_id(&name); \ + t = (id ? rb_is_##type##_id(id) : rb_is_##type##_name(name)); \ } while (0) #else # define get_symbol_type(type, t, name) do { \ - t = rb_is_##type##_id(rb_to_id(name)); \ + t = rb_is_##type##_id(rb_to_id(name)); \ } while (0) #endif diff --git a/ext/-test-/tracepoint/gc_hook.c b/ext/-test-/tracepoint/gc_hook.c index 5fd46fa518..a3f4e7f68a 100644 --- a/ext/-test-/tracepoint/gc_hook.c +++ b/ext/-test-/tracepoint/gc_hook.c @@ -28,12 +28,12 @@ static void gc_start_end_i(VALUE tpval, void *data) { if (0) { - rb_trace_arg_t *tparg = rb_tracearg_from_tracepoint(tpval); - fprintf(stderr, "trace: %s\n", rb_tracearg_event_flag(tparg) == RUBY_INTERNAL_EVENT_GC_START ? "gc_start" : "gc_end"); + rb_trace_arg_t *tparg = rb_tracearg_from_tracepoint(tpval); + fprintf(stderr, "trace: %s\n", rb_tracearg_event_flag(tparg) == RUBY_INTERNAL_EVENT_GC_START ? "gc_start" : "gc_end"); } if (invoking == 0) { - rb_postponed_job_register(0, invoke_proc, data); + rb_postponed_job_register(0, invoke_proc, data); } } @@ -45,19 +45,19 @@ set_gc_hook(VALUE module, VALUE proc, rb_event_flag_t event, const char *tp_str, /* disable previous keys */ if (rb_ivar_defined(module, tp_key) != 0 && - RTEST(tpval = rb_ivar_get(module, tp_key))) { - rb_tracepoint_disable(tpval); - rb_ivar_set(module, tp_key, Qnil); + RTEST(tpval = rb_ivar_get(module, tp_key))) { + rb_tracepoint_disable(tpval); + rb_ivar_set(module, tp_key, Qnil); } if (RTEST(proc)) { - if (!rb_obj_is_proc(proc)) { - rb_raise(rb_eTypeError, "trace_func needs to be Proc"); - } + if (!rb_obj_is_proc(proc)) { + rb_raise(rb_eTypeError, "trace_func needs to be Proc"); + } - tpval = rb_tracepoint_new(0, event, gc_start_end_i, (void *)proc); - rb_ivar_set(module, tp_key, tpval); - rb_tracepoint_enable(tpval); + tpval = rb_tracepoint_new(0, event, gc_start_end_i, (void *)proc); + rb_ivar_set(module, tp_key, tpval); + rb_tracepoint_enable(tpval); } return proc; @@ -67,7 +67,7 @@ static VALUE set_after_gc_start(VALUE module, VALUE proc) { return set_gc_hook(module, proc, RUBY_INTERNAL_EVENT_GC_START, - "__set_after_gc_start_tpval__", "__set_after_gc_start_proc__"); + "__set_after_gc_start_tpval__", "__set_after_gc_start_proc__"); } static VALUE diff --git a/ext/-test-/tracepoint/tracepoint.c b/ext/-test-/tracepoint/tracepoint.c index aa8c212f99..2826cc038c 100644 --- a/ext/-test-/tracepoint/tracepoint.c +++ b/ext/-test-/tracepoint/tracepoint.c @@ -21,35 +21,35 @@ tracepoint_track_objspace_events_i(VALUE tpval, void *data) switch (rb_tracearg_event_flag(tparg)) { case RUBY_INTERNAL_EVENT_NEWOBJ: - { - VALUE obj = rb_tracearg_object(tparg); - if (track->objects_count < objects_max) - track->objects[track->objects_count++] = obj; - track->newobj_count++; - break; - } + { + VALUE obj = rb_tracearg_object(tparg); + if (track->objects_count < objects_max) + track->objects[track->objects_count++] = obj; + track->newobj_count++; + break; + } case RUBY_INTERNAL_EVENT_FREEOBJ: - { - track->free_count++; - break; - } + { + track->free_count++; + break; + } case RUBY_INTERNAL_EVENT_GC_START: - { - track->gc_start_count++; - break; - } + { + track->gc_start_count++; + break; + } case RUBY_INTERNAL_EVENT_GC_END_MARK: - { - track->gc_end_mark_count++; - break; - } + { + track->gc_end_mark_count++; + break; + } case RUBY_INTERNAL_EVENT_GC_END_SWEEP: - { - track->gc_end_sweep_count++; - break; - } + { + track->gc_end_sweep_count++; + break; + } default: - rb_raise(rb_eRuntimeError, "unknown event"); + rb_raise(rb_eRuntimeError, "unknown event"); } } @@ -58,9 +58,9 @@ tracepoint_track_objspace_events(VALUE self) { struct tracepoint_track track = {0, 0, 0, 0, 0,}; VALUE tpval = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_NEWOBJ | RUBY_INTERNAL_EVENT_FREEOBJ | - RUBY_INTERNAL_EVENT_GC_START | RUBY_INTERNAL_EVENT_GC_END_MARK | - RUBY_INTERNAL_EVENT_GC_END_SWEEP, - tracepoint_track_objspace_events_i, &track); + RUBY_INTERNAL_EVENT_GC_START | RUBY_INTERNAL_EVENT_GC_END_MARK | + RUBY_INTERNAL_EVENT_GC_END_SWEEP, + tracepoint_track_objspace_events_i, &track); VALUE result = rb_ary_new(); rb_tracepoint_enable(tpval); diff --git a/ext/-test-/typeddata/typeddata.c b/ext/-test-/typeddata/typeddata.c index 2adfd56ae8..cf3178fd18 100644 --- a/ext/-test-/typeddata/typeddata.c +++ b/ext/-test-/typeddata/typeddata.c @@ -27,7 +27,7 @@ test_make(VALUE klass, VALUE num) unsigned long i, n = NUM2UINT(num); for (i = 0; i < n; i++) { - test_alloc(klass); + test_alloc(klass); } return Qnil; diff --git a/ext/-test-/vm/at_exit.c b/ext/-test-/vm/at_exit.c index 6cfbfafa9e..efc439b26a 100644 --- a/ext/-test-/vm/at_exit.c +++ b/ext/-test-/vm/at_exit.c @@ -23,14 +23,14 @@ register_at_exit(VALUE self, VALUE t) { switch (t) { case Qtrue: - ruby_vm_at_exit(print_begin); - break; + ruby_vm_at_exit(print_begin); + break; case Qfalse: - ruby_vm_at_exit(print_end); - break; + ruby_vm_at_exit(print_end); + break; default: - ruby_vm_at_exit(do_nothing); - break; + ruby_vm_at_exit(do_nothing); + break; } return self; } diff --git a/ext/-test-/win32/console/attribute.c b/ext/-test-/win32/console/attribute.c index e3e80a199f..b43ba23a5c 100644 --- a/ext/-test-/win32/console/attribute.c +++ b/ext/-test-/win32/console/attribute.c @@ -19,13 +19,13 @@ console_info(VALUE klass, VALUE io) CONSOLE_SCREEN_BUFFER_INFO csbi; if (!GetConsoleScreenBufferInfo(h, &csbi)) - rb_syserr_fail(rb_w32_map_errno(GetLastError()), "not console"); + rb_syserr_fail(rb_w32_map_errno(GetLastError()), "not console"); return rb_struct_new(rb_cConsoleScreenBufferInfo, - INT2FIX(csbi.dwSize.X), - INT2FIX(csbi.dwSize.Y), - INT2FIX(csbi.dwCursorPosition.X), - INT2FIX(csbi.dwCursorPosition.Y), - INT2FIX(csbi.wAttributes)); + INT2FIX(csbi.dwSize.X), + INT2FIX(csbi.dwSize.Y), + INT2FIX(csbi.dwCursorPosition.X), + INT2FIX(csbi.dwCursorPosition.Y), + INT2FIX(csbi.wAttributes)); } static VALUE @@ -44,9 +44,9 @@ void Init_attribute(VALUE m) { rb_cConsoleScreenBufferInfo = rb_struct_define_under(m, "ConsoleScreenBufferInfo", - "size_x", "size_y", - "cur_x", "cur_y", - "attr", NULL); + "size_x", "size_y", + "cur_x", "cur_y", + "attr", NULL); rb_define_singleton_method(m, "console_info", console_info, 1); rb_define_singleton_method(m, "console_attribute", console_set_attribute, 2); diff --git a/ext/-test-/win32/fd_setsize/fd_setsize.c b/ext/-test-/win32/fd_setsize/fd_setsize.c index 8da8b1eaa0..e29114a0ca 100644 --- a/ext/-test-/win32/fd_setsize/fd_setsize.c +++ b/ext/-test-/win32/fd_setsize/fd_setsize.c @@ -37,11 +37,11 @@ test_fdset(VALUE self) FD_ZERO(&set); for (i = 0; i < FD_SETSIZE * 2; i++) { - int sd = socket(AF_INET, SOCK_DGRAM, 0); - FD_SET(sd, &set); - if (set.fd_count > FD_SETSIZE) { - return Qfalse; - } + int sd = socket(AF_INET, SOCK_DGRAM, 0); + FD_SET(sd, &set); + if (set.fd_count > FD_SETSIZE) { + return Qfalse; + } } return Qtrue; } |