mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
adjust style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
82b1bfe417
commit
66fd9d44d8
14 changed files with 44 additions and 47 deletions
6
array.c
6
array.c
|
@ -379,7 +379,7 @@ ary_alloc(VALUE klass)
|
||||||
static VALUE
|
static VALUE
|
||||||
empty_ary_alloc(VALUE klass)
|
empty_ary_alloc(VALUE klass)
|
||||||
{
|
{
|
||||||
if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
|
RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ ary_new(VALUE klass, long capa)
|
||||||
rb_raise(rb_eArgError, "array size too big");
|
rb_raise(rb_eArgError, "array size too big");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
|
RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5042,7 +5042,7 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put it on the result array */
|
/* put it on the result array */
|
||||||
if(NIL_P(result)) {
|
if (NIL_P(result)) {
|
||||||
FL_SET(t0, FL_USER5);
|
FL_SET(t0, FL_USER5);
|
||||||
rb_yield(subarray);
|
rb_yield(subarray);
|
||||||
if (! FL_TEST(t0, FL_USER5)) {
|
if (! FL_TEST(t0, FL_USER5)) {
|
||||||
|
|
4
dln.c
4
dln.c
|
@ -767,7 +767,7 @@ load_1(int fd, long disp, const char *need_init)
|
||||||
unsigned int mask = 0;
|
unsigned int mask = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(rel >= rel_beg)
|
if (rel >= rel_beg)
|
||||||
address += hdr.a_text;
|
address += hdr.a_text;
|
||||||
|
|
||||||
if (rel->r_extern) { /* Look it up in symbol-table */
|
if (rel->r_extern) { /* Look it up in symbol-table */
|
||||||
|
@ -1429,7 +1429,7 @@ dln_load(const char *file)
|
||||||
NSLinkModule(obj_file, file, NSLINKMODULE_OPTION_BINDNOW);
|
NSLinkModule(obj_file, file, NSLINKMODULE_OPTION_BINDNOW);
|
||||||
|
|
||||||
/* lookup the initial function */
|
/* lookup the initial function */
|
||||||
if(!NSIsSymbolNameDefined(buf)) {
|
if (!NSIsSymbolNameDefined(buf)) {
|
||||||
dln_loaderror("Failed to lookup Init function %.200s",file);
|
dln_loaderror("Failed to lookup Init function %.200s",file);
|
||||||
}
|
}
|
||||||
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));
|
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));
|
||||||
|
|
|
@ -1487,7 +1487,7 @@ rb_locale_charmap(VALUE klass)
|
||||||
# endif
|
# endif
|
||||||
if (!codeset) {
|
if (!codeset) {
|
||||||
UINT codepage = GetConsoleCP();
|
UINT codepage = GetConsoleCP();
|
||||||
if(!codepage) codepage = GetACP();
|
if (!codepage) codepage = GetACP();
|
||||||
snprintf(cp, sizeof(cp), "CP%d", codepage);
|
snprintf(cp, sizeof(cp), "CP%d", codepage);
|
||||||
codeset = cp;
|
codeset = cp;
|
||||||
}
|
}
|
||||||
|
|
2
enum.c
2
enum.c
|
@ -2490,7 +2490,7 @@ enum_chunk(int argc, VALUE *argv, VALUE enumerable)
|
||||||
VALUE initial_state;
|
VALUE initial_state;
|
||||||
VALUE enumerator;
|
VALUE enumerator;
|
||||||
|
|
||||||
if(!rb_block_given_p())
|
if (!rb_block_given_p())
|
||||||
rb_raise(rb_eArgError, "no block given");
|
rb_raise(rb_eArgError, "no block given");
|
||||||
rb_scan_args(argc, argv, "01", &initial_state);
|
rb_scan_args(argc, argv, "01", &initial_state);
|
||||||
|
|
||||||
|
|
|
@ -1003,7 +1003,7 @@ enumerator_size(VALUE obj)
|
||||||
return (*e->size_fn)(e->obj, e->args);
|
return (*e->size_fn)(e->obj, e->args);
|
||||||
}
|
}
|
||||||
if (rb_obj_is_proc(e->size)) {
|
if (rb_obj_is_proc(e->size)) {
|
||||||
if(e->args)
|
if (e->args)
|
||||||
return rb_proc_call(e->size, e->args);
|
return rb_proc_call(e->size, e->args);
|
||||||
else
|
else
|
||||||
return rb_proc_call_with_block(e->size, 0, 0, Qnil);
|
return rb_proc_call_with_block(e->size, 0, 0, Qnil);
|
||||||
|
|
6
eval.c
6
eval.c
|
@ -503,10 +503,10 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag != TAG_FATAL) {
|
if (tag != TAG_FATAL) {
|
||||||
if(RUBY_DTRACE_RAISE_ENABLED()) {
|
if (RUBY_DTRACE_RAISE_ENABLED()) {
|
||||||
RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
|
RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
|
||||||
rb_sourcefile(),
|
rb_sourcefile(),
|
||||||
rb_sourceline());
|
rb_sourceline());
|
||||||
}
|
}
|
||||||
EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
|
EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
|
||||||
}
|
}
|
||||||
|
|
2
hash.c
2
hash.c
|
@ -219,7 +219,7 @@ hash_alloc(VALUE klass)
|
||||||
static VALUE
|
static VALUE
|
||||||
empty_hash_alloc(VALUE klass)
|
empty_hash_alloc(VALUE klass)
|
||||||
{
|
{
|
||||||
if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_HASH_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_HASH_CREATE(0, rb_sourcefile(), rb_sourceline());
|
RUBY_DTRACE_HASH_CREATE(0, rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
44
load.c
44
load.c
|
@ -623,11 +623,10 @@ rb_f_load(int argc, VALUE *argv)
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "11", &fname, &wrap);
|
rb_scan_args(argc, argv, "11", &fname, &wrap);
|
||||||
|
|
||||||
if(RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
|
if (RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
|
||||||
RUBY_DTRACE_LOAD_ENTRY(
|
RUBY_DTRACE_LOAD_ENTRY(StringValuePtr(fname),
|
||||||
StringValuePtr(fname),
|
rb_sourcefile(),
|
||||||
rb_sourcefile(),
|
rb_sourceline());
|
||||||
rb_sourceline());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
path = rb_find_file(FilePathValue(fname));
|
path = rb_find_file(FilePathValue(fname));
|
||||||
|
@ -638,8 +637,8 @@ rb_f_load(int argc, VALUE *argv)
|
||||||
}
|
}
|
||||||
rb_load_internal(path, RTEST(wrap));
|
rb_load_internal(path, RTEST(wrap));
|
||||||
|
|
||||||
if(RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
|
if (RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
|
||||||
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
|
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Qtrue;
|
return Qtrue;
|
||||||
|
@ -875,11 +874,10 @@ rb_require_safe(VALUE fname, int safe)
|
||||||
} volatile saved;
|
} volatile saved;
|
||||||
char *volatile ftptr = 0;
|
char *volatile ftptr = 0;
|
||||||
|
|
||||||
if(RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
|
if (RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
|
||||||
RUBY_DTRACE_REQUIRE_ENTRY(
|
RUBY_DTRACE_REQUIRE_ENTRY(StringValuePtr(fname),
|
||||||
StringValuePtr(fname),
|
rb_sourcefile(),
|
||||||
rb_sourcefile(),
|
rb_sourceline());
|
||||||
rb_sourceline());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PUSH_TAG();
|
PUSH_TAG();
|
||||||
|
@ -893,20 +891,18 @@ rb_require_safe(VALUE fname, int safe)
|
||||||
FilePathValue(fname);
|
FilePathValue(fname);
|
||||||
rb_set_safe_level_force(0);
|
rb_set_safe_level_force(0);
|
||||||
|
|
||||||
if(RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
|
if (RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
|
||||||
RUBY_DTRACE_FIND_REQUIRE_ENTRY(
|
RUBY_DTRACE_FIND_REQUIRE_ENTRY(StringValuePtr(fname),
|
||||||
StringValuePtr(fname),
|
rb_sourcefile(),
|
||||||
rb_sourcefile(),
|
rb_sourceline());
|
||||||
rb_sourceline());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
found = search_required(fname, &path, safe);
|
found = search_required(fname, &path, safe);
|
||||||
|
|
||||||
if(RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
|
if (RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
|
||||||
RUBY_DTRACE_FIND_REQUIRE_RETURN(
|
RUBY_DTRACE_FIND_REQUIRE_RETURN(StringValuePtr(fname),
|
||||||
StringValuePtr(fname),
|
rb_sourcefile(),
|
||||||
rb_sourcefile(),
|
rb_sourceline());
|
||||||
rb_sourceline());
|
|
||||||
}
|
}
|
||||||
if (found) {
|
if (found) {
|
||||||
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
|
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
|
||||||
|
@ -943,8 +939,8 @@ rb_require_safe(VALUE fname, int safe)
|
||||||
|
|
||||||
th->errinfo = errinfo;
|
th->errinfo = errinfo;
|
||||||
|
|
||||||
if(RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
|
if (RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
|
||||||
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
|
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -850,7 +850,7 @@ flodivmod(double x, double y, double *divp, double *modp)
|
||||||
double div, mod;
|
double div, mod;
|
||||||
|
|
||||||
if (y == 0.0) rb_num_zerodiv();
|
if (y == 0.0) rb_num_zerodiv();
|
||||||
if((x == 0.0) || (isinf(y) && !isinf(x)))
|
if ((x == 0.0) || (isinf(y) && !isinf(x)))
|
||||||
mod = x;
|
mod = x;
|
||||||
else {
|
else {
|
||||||
#ifdef HAVE_FMOD
|
#ifdef HAVE_FMOD
|
||||||
|
|
|
@ -23,7 +23,7 @@ VALUE rb_class_path_no_cache(VALUE _klass);
|
||||||
else if (FL_TEST(_klass, FL_SINGLETON)) { \
|
else if (FL_TEST(_klass, FL_SINGLETON)) { \
|
||||||
_klass = rb_iv_get(_klass, "__attached__"); \
|
_klass = rb_iv_get(_klass, "__attached__"); \
|
||||||
} \
|
} \
|
||||||
switch(TYPE(_klass)) { \
|
switch (TYPE(_klass)) { \
|
||||||
case T_CLASS: \
|
case T_CLASS: \
|
||||||
case T_ICLASS: \
|
case T_ICLASS: \
|
||||||
case T_MODULE: \
|
case T_MODULE: \
|
||||||
|
@ -31,7 +31,8 @@ VALUE rb_class_path_no_cache(VALUE _klass);
|
||||||
VALUE _name = rb_class_path_no_cache(_klass); \
|
VALUE _name = rb_class_path_no_cache(_klass); \
|
||||||
if (!NIL_P(_name)) { \
|
if (!NIL_P(_name)) { \
|
||||||
classname = StringValuePtr(_name); \
|
classname = StringValuePtr(_name); \
|
||||||
} else { \
|
} \
|
||||||
|
else { \
|
||||||
classname = "<unknown>"; \
|
classname = "<unknown>"; \
|
||||||
} \
|
} \
|
||||||
methodname = rb_id2name(_id); \
|
methodname = rb_id2name(_id); \
|
||||||
|
|
2
signal.c
2
signal.c
|
@ -394,7 +394,7 @@ rb_f_kill(int argc, VALUE *argv)
|
||||||
}
|
}
|
||||||
if (strncmp("SIG", s, 3) == 0)
|
if (strncmp("SIG", s, 3) == 0)
|
||||||
s += 3;
|
s += 3;
|
||||||
if((sig = signm2signo(s)) == 0)
|
if ((sig = signm2signo(s)) == 0)
|
||||||
rb_raise(rb_eArgError, "unsupported name `SIG%s'", s);
|
rb_raise(rb_eArgError, "unsupported name `SIG%s'", s);
|
||||||
|
|
||||||
if (negative)
|
if (negative)
|
||||||
|
|
10
string.c
10
string.c
|
@ -385,7 +385,7 @@ str_alloc(VALUE klass)
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
empty_str_alloc(VALUE klass)
|
empty_str_alloc(VALUE klass)
|
||||||
{
|
{
|
||||||
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_STRING_CREATE(0, rb_sourcefile(), rb_sourceline());
|
RUBY_DTRACE_STRING_CREATE(0, rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
return str_alloc(klass);
|
return str_alloc(klass);
|
||||||
|
@ -400,7 +400,7 @@ str_new(VALUE klass, const char *ptr, long len)
|
||||||
rb_raise(rb_eArgError, "negative string size (or size too big)");
|
rb_raise(rb_eArgError, "negative string size (or size too big)");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_STRING_CREATE(len, rb_sourcefile(), rb_sourceline());
|
RUBY_DTRACE_STRING_CREATE(len, rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,9 +932,9 @@ rb_str_dup(VALUE str)
|
||||||
VALUE
|
VALUE
|
||||||
rb_str_resurrect(VALUE str)
|
rb_str_resurrect(VALUE str)
|
||||||
{
|
{
|
||||||
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_STRING_CREATE(
|
RUBY_DTRACE_STRING_CREATE(RSTRING_LEN(str),
|
||||||
RSTRING_LEN(str), rb_sourcefile(), rb_sourceline());
|
rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
return str_replace(str_alloc(rb_cString), str);
|
return str_replace(str_alloc(rb_cString), str);
|
||||||
}
|
}
|
||||||
|
|
2
vm.c
2
vm.c
|
@ -1986,7 +1986,7 @@ m_core_hash_from_ary(VALUE self, VALUE ary)
|
||||||
VALUE hash = rb_hash_new();
|
VALUE hash = rb_hash_new();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
|
if (RUBY_DTRACE_HASH_CREATE_ENABLED()) {
|
||||||
RUBY_DTRACE_HASH_CREATE(RARRAY_LEN(ary), rb_sourcefile(), rb_sourceline());
|
RUBY_DTRACE_HASH_CREATE(RARRAY_LEN(ary), rb_sourcefile(), rb_sourceline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ tracepoint_new(VALUE klass, rb_thread_t *target_th, rb_event_flag_t events, void
|
||||||
VALUE
|
VALUE
|
||||||
rb_tracepoint_new(VALUE target_thread, rb_event_flag_t events, void (*func)(VALUE, void *), void *data)
|
rb_tracepoint_new(VALUE target_thread, rb_event_flag_t events, void (*func)(VALUE, void *), void *data)
|
||||||
{
|
{
|
||||||
rb_thread_t *target_th = 0;
|
rb_thread_t *target_th = GET_THREAD();
|
||||||
if (RTEST(target_thread)) {
|
if (RTEST(target_thread)) {
|
||||||
/* TODO: now unsupported */
|
/* TODO: now unsupported */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue