1
0
Fork 0
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:
nobu 2012-12-01 15:25:28 +00:00
parent 82b1bfe417
commit 66fd9d44d8
14 changed files with 44 additions and 47 deletions

View file

@ -379,7 +379,7 @@ ary_alloc(VALUE klass)
static VALUE
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());
}
@ -398,7 +398,7 @@ ary_new(VALUE klass, long capa)
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());
}
@ -5042,7 +5042,7 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
}
/* put it on the result array */
if(NIL_P(result)) {
if (NIL_P(result)) {
FL_SET(t0, FL_USER5);
rb_yield(subarray);
if (! FL_TEST(t0, FL_USER5)) {

4
dln.c
View file

@ -767,7 +767,7 @@ load_1(int fd, long disp, const char *need_init)
unsigned int mask = 0;
#endif
if(rel >= rel_beg)
if (rel >= rel_beg)
address += hdr.a_text;
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);
/* lookup the initial function */
if(!NSIsSymbolNameDefined(buf)) {
if (!NSIsSymbolNameDefined(buf)) {
dln_loaderror("Failed to lookup Init function %.200s",file);
}
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));

View file

@ -1487,7 +1487,7 @@ rb_locale_charmap(VALUE klass)
# endif
if (!codeset) {
UINT codepage = GetConsoleCP();
if(!codepage) codepage = GetACP();
if (!codepage) codepage = GetACP();
snprintf(cp, sizeof(cp), "CP%d", codepage);
codeset = cp;
}

2
enum.c
View file

@ -2490,7 +2490,7 @@ enum_chunk(int argc, VALUE *argv, VALUE enumerable)
VALUE initial_state;
VALUE enumerator;
if(!rb_block_given_p())
if (!rb_block_given_p())
rb_raise(rb_eArgError, "no block given");
rb_scan_args(argc, argv, "01", &initial_state);

View file

@ -1003,7 +1003,7 @@ enumerator_size(VALUE obj)
return (*e->size_fn)(e->obj, e->args);
}
if (rb_obj_is_proc(e->size)) {
if(e->args)
if (e->args)
return rb_proc_call(e->size, e->args);
else
return rb_proc_call_with_block(e->size, 0, 0, Qnil);

2
eval.c
View file

@ -503,7 +503,7 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
}
if (tag != TAG_FATAL) {
if(RUBY_DTRACE_RAISE_ENABLED()) {
if (RUBY_DTRACE_RAISE_ENABLED()) {
RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
rb_sourcefile(),
rb_sourceline());

2
hash.c
View file

@ -219,7 +219,7 @@ hash_alloc(VALUE klass)
static VALUE
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());
}

24
load.c
View file

@ -623,9 +623,8 @@ rb_f_load(int argc, VALUE *argv)
rb_scan_args(argc, argv, "11", &fname, &wrap);
if(RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
RUBY_DTRACE_LOAD_ENTRY(
StringValuePtr(fname),
if (RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
RUBY_DTRACE_LOAD_ENTRY(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}
@ -638,7 +637,7 @@ rb_f_load(int argc, VALUE *argv)
}
rb_load_internal(path, RTEST(wrap));
if(RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
if (RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
}
@ -875,9 +874,8 @@ rb_require_safe(VALUE fname, int safe)
} volatile saved;
char *volatile ftptr = 0;
if(RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
RUBY_DTRACE_REQUIRE_ENTRY(
StringValuePtr(fname),
if (RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
RUBY_DTRACE_REQUIRE_ENTRY(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}
@ -893,18 +891,16 @@ rb_require_safe(VALUE fname, int safe)
FilePathValue(fname);
rb_set_safe_level_force(0);
if(RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
RUBY_DTRACE_FIND_REQUIRE_ENTRY(
StringValuePtr(fname),
if (RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
RUBY_DTRACE_FIND_REQUIRE_ENTRY(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}
found = search_required(fname, &path, safe);
if(RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
RUBY_DTRACE_FIND_REQUIRE_RETURN(
StringValuePtr(fname),
if (RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
RUBY_DTRACE_FIND_REQUIRE_RETURN(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}
@ -943,7 +939,7 @@ rb_require_safe(VALUE fname, int safe)
th->errinfo = errinfo;
if(RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
if (RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
}

View file

@ -850,7 +850,7 @@ flodivmod(double x, double y, double *divp, double *modp)
double div, mod;
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;
else {
#ifdef HAVE_FMOD

View file

@ -23,7 +23,7 @@ VALUE rb_class_path_no_cache(VALUE _klass);
else if (FL_TEST(_klass, FL_SINGLETON)) { \
_klass = rb_iv_get(_klass, "__attached__"); \
} \
switch(TYPE(_klass)) { \
switch (TYPE(_klass)) { \
case T_CLASS: \
case T_ICLASS: \
case T_MODULE: \
@ -31,7 +31,8 @@ VALUE rb_class_path_no_cache(VALUE _klass);
VALUE _name = rb_class_path_no_cache(_klass); \
if (!NIL_P(_name)) { \
classname = StringValuePtr(_name); \
} else { \
} \
else { \
classname = "<unknown>"; \
} \
methodname = rb_id2name(_id); \

View file

@ -394,7 +394,7 @@ rb_f_kill(int argc, VALUE *argv)
}
if (strncmp("SIG", s, 3) == 0)
s += 3;
if((sig = signm2signo(s)) == 0)
if ((sig = signm2signo(s)) == 0)
rb_raise(rb_eArgError, "unsupported name `SIG%s'", s);
if (negative)

View file

@ -385,7 +385,7 @@ str_alloc(VALUE klass)
static inline VALUE
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());
}
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)");
}
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
RUBY_DTRACE_STRING_CREATE(len, rb_sourcefile(), rb_sourceline());
}
@ -932,9 +932,9 @@ rb_str_dup(VALUE str)
VALUE
rb_str_resurrect(VALUE str)
{
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
RUBY_DTRACE_STRING_CREATE(
RSTRING_LEN(str), rb_sourcefile(), rb_sourceline());
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
RUBY_DTRACE_STRING_CREATE(RSTRING_LEN(str),
rb_sourcefile(), rb_sourceline());
}
return str_replace(str_alloc(rb_cString), str);
}

2
vm.c
View file

@ -1986,7 +1986,7 @@ m_core_hash_from_ary(VALUE self, VALUE ary)
VALUE hash = rb_hash_new();
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());
}

View file

@ -1082,7 +1082,7 @@ tracepoint_new(VALUE klass, rb_thread_t *target_th, rb_event_flag_t events, void
VALUE
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)) {
/* TODO: now unsupported */
}