Skip to content

Commit

Permalink
adjust style.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Dec 1, 2012
1 parent 82b1bfe commit 66fd9d4
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 47 deletions.
6 changes: 3 additions & 3 deletions array.c
Expand Up @@ -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());
}

Expand All @@ -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());
}

Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions dln.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion encoding.c
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion enum.c
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion enumerator.c
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions eval.c
Expand Up @@ -503,10 +503,10 @@ 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());
rb_sourcefile(),
rb_sourceline());
}
EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
}
Expand Down
2 changes: 1 addition & 1 deletion hash.c
Expand Up @@ -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());
}

Expand Down
44 changes: 20 additions & 24 deletions load.c
Expand Up @@ -623,11 +623,10 @@ 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),
rb_sourcefile(),
rb_sourceline());
if (RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
RUBY_DTRACE_LOAD_ENTRY(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}

path = rb_find_file(FilePathValue(fname));
Expand All @@ -638,8 +637,8 @@ rb_f_load(int argc, VALUE *argv)
}
rb_load_internal(path, RTEST(wrap));

if(RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
if (RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
}

return Qtrue;
Expand Down Expand Up @@ -875,11 +874,10 @@ 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),
rb_sourcefile(),
rb_sourceline());
if (RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
RUBY_DTRACE_REQUIRE_ENTRY(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}

PUSH_TAG();
Expand All @@ -893,20 +891,18 @@ 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),
rb_sourcefile(),
rb_sourceline());
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),
rb_sourcefile(),
rb_sourceline());
if (RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
RUBY_DTRACE_FIND_REQUIRE_RETURN(StringValuePtr(fname),
rb_sourcefile(),
rb_sourceline());
}
if (found) {
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
Expand Down Expand Up @@ -943,8 +939,8 @@ rb_require_safe(VALUE fname, int safe)

th->errinfo = errinfo;

if(RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
if (RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion numeric.c
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions probes_helper.h
Expand Up @@ -23,15 +23,16 @@ 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: \
{ \
VALUE _name = rb_class_path_no_cache(_klass); \
if (!NIL_P(_name)) { \
classname = StringValuePtr(_name); \
} else { \
} \
else { \
classname = "<unknown>"; \
} \
methodname = rb_id2name(_id); \
Expand Down
2 changes: 1 addition & 1 deletion signal.c
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions string.c
Expand Up @@ -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);
Expand All @@ -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());
}

Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion vm.c
Expand Up @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion vm_trace.c
Expand Up @@ -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 */
}
Expand Down

0 comments on commit 66fd9d4

Please sign in to comment.