Skip to content

Commit 66fd9d4

Browse files
committed
adjust style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 82b1bfe commit 66fd9d4

File tree

14 files changed

+44
-47
lines changed

14 files changed

+44
-47
lines changed

array.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ ary_alloc(VALUE klass)
379379
static VALUE
380380
empty_ary_alloc(VALUE klass)
381381
{
382-
if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
382+
if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
383383
RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
384384
}
385385

@@ -398,7 +398,7 @@ ary_new(VALUE klass, long capa)
398398
rb_raise(rb_eArgError, "array size too big");
399399
}
400400

401-
if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
401+
if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
402402
RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
403403
}
404404

@@ -5042,7 +5042,7 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
50425042
}
50435043

50445044
/* put it on the result array */
5045-
if(NIL_P(result)) {
5045+
if (NIL_P(result)) {
50465046
FL_SET(t0, FL_USER5);
50475047
rb_yield(subarray);
50485048
if (! FL_TEST(t0, FL_USER5)) {

dln.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ load_1(int fd, long disp, const char *need_init)
767767
unsigned int mask = 0;
768768
#endif
769769

770-
if(rel >= rel_beg)
770+
if (rel >= rel_beg)
771771
address += hdr.a_text;
772772

773773
if (rel->r_extern) { /* Look it up in symbol-table */
@@ -1429,7 +1429,7 @@ dln_load(const char *file)
14291429
NSLinkModule(obj_file, file, NSLINKMODULE_OPTION_BINDNOW);
14301430

14311431
/* lookup the initial function */
1432-
if(!NSIsSymbolNameDefined(buf)) {
1432+
if (!NSIsSymbolNameDefined(buf)) {
14331433
dln_loaderror("Failed to lookup Init function %.200s",file);
14341434
}
14351435
init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));

encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ rb_locale_charmap(VALUE klass)
14871487
# endif
14881488
if (!codeset) {
14891489
UINT codepage = GetConsoleCP();
1490-
if(!codepage) codepage = GetACP();
1490+
if (!codepage) codepage = GetACP();
14911491
snprintf(cp, sizeof(cp), "CP%d", codepage);
14921492
codeset = cp;
14931493
}

enum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ enum_chunk(int argc, VALUE *argv, VALUE enumerable)
24902490
VALUE initial_state;
24912491
VALUE enumerator;
24922492

2493-
if(!rb_block_given_p())
2493+
if (!rb_block_given_p())
24942494
rb_raise(rb_eArgError, "no block given");
24952495
rb_scan_args(argc, argv, "01", &initial_state);
24962496

enumerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ enumerator_size(VALUE obj)
10031003
return (*e->size_fn)(e->obj, e->args);
10041004
}
10051005
if (rb_obj_is_proc(e->size)) {
1006-
if(e->args)
1006+
if (e->args)
10071007
return rb_proc_call(e->size, e->args);
10081008
else
10091009
return rb_proc_call_with_block(e->size, 0, 0, Qnil);

eval.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
503503
}
504504

505505
if (tag != TAG_FATAL) {
506-
if(RUBY_DTRACE_RAISE_ENABLED()) {
506+
if (RUBY_DTRACE_RAISE_ENABLED()) {
507507
RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
508-
rb_sourcefile(),
509-
rb_sourceline());
508+
rb_sourcefile(),
509+
rb_sourceline());
510510
}
511511
EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
512512
}

hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ hash_alloc(VALUE klass)
219219
static VALUE
220220
empty_hash_alloc(VALUE klass)
221221
{
222-
if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
222+
if (RUBY_DTRACE_HASH_CREATE_ENABLED()) {
223223
RUBY_DTRACE_HASH_CREATE(0, rb_sourcefile(), rb_sourceline());
224224
}
225225

load.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,10 @@ rb_f_load(int argc, VALUE *argv)
623623

624624
rb_scan_args(argc, argv, "11", &fname, &wrap);
625625

626-
if(RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
627-
RUBY_DTRACE_LOAD_ENTRY(
628-
StringValuePtr(fname),
629-
rb_sourcefile(),
630-
rb_sourceline());
626+
if (RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
627+
RUBY_DTRACE_LOAD_ENTRY(StringValuePtr(fname),
628+
rb_sourcefile(),
629+
rb_sourceline());
631630
}
632631

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

641-
if(RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
642-
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
640+
if (RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
641+
RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
643642
}
644643

645644
return Qtrue;
@@ -875,11 +874,10 @@ rb_require_safe(VALUE fname, int safe)
875874
} volatile saved;
876875
char *volatile ftptr = 0;
877876

878-
if(RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
879-
RUBY_DTRACE_REQUIRE_ENTRY(
880-
StringValuePtr(fname),
881-
rb_sourcefile(),
882-
rb_sourceline());
877+
if (RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
878+
RUBY_DTRACE_REQUIRE_ENTRY(StringValuePtr(fname),
879+
rb_sourcefile(),
880+
rb_sourceline());
883881
}
884882

885883
PUSH_TAG();
@@ -893,20 +891,18 @@ rb_require_safe(VALUE fname, int safe)
893891
FilePathValue(fname);
894892
rb_set_safe_level_force(0);
895893

896-
if(RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
897-
RUBY_DTRACE_FIND_REQUIRE_ENTRY(
898-
StringValuePtr(fname),
899-
rb_sourcefile(),
900-
rb_sourceline());
894+
if (RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
895+
RUBY_DTRACE_FIND_REQUIRE_ENTRY(StringValuePtr(fname),
896+
rb_sourcefile(),
897+
rb_sourceline());
901898
}
902899

903900
found = search_required(fname, &path, safe);
904901

905-
if(RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
906-
RUBY_DTRACE_FIND_REQUIRE_RETURN(
907-
StringValuePtr(fname),
908-
rb_sourcefile(),
909-
rb_sourceline());
902+
if (RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
903+
RUBY_DTRACE_FIND_REQUIRE_RETURN(StringValuePtr(fname),
904+
rb_sourcefile(),
905+
rb_sourceline());
910906
}
911907
if (found) {
912908
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
@@ -943,8 +939,8 @@ rb_require_safe(VALUE fname, int safe)
943939

944940
th->errinfo = errinfo;
945941

946-
if(RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
947-
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
942+
if (RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
943+
RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
948944
}
949945

950946
return result;

numeric.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ flodivmod(double x, double y, double *divp, double *modp)
850850
double div, mod;
851851

852852
if (y == 0.0) rb_num_zerodiv();
853-
if((x == 0.0) || (isinf(y) && !isinf(x)))
853+
if ((x == 0.0) || (isinf(y) && !isinf(x)))
854854
mod = x;
855855
else {
856856
#ifdef HAVE_FMOD

probes_helper.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ VALUE rb_class_path_no_cache(VALUE _klass);
2323
else if (FL_TEST(_klass, FL_SINGLETON)) { \
2424
_klass = rb_iv_get(_klass, "__attached__"); \
2525
} \
26-
switch(TYPE(_klass)) { \
26+
switch (TYPE(_klass)) { \
2727
case T_CLASS: \
2828
case T_ICLASS: \
2929
case T_MODULE: \
3030
{ \
3131
VALUE _name = rb_class_path_no_cache(_klass); \
3232
if (!NIL_P(_name)) { \
3333
classname = StringValuePtr(_name); \
34-
} else { \
34+
} \
35+
else { \
3536
classname = "<unknown>"; \
3637
} \
3738
methodname = rb_id2name(_id); \

signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ rb_f_kill(int argc, VALUE *argv)
394394
}
395395
if (strncmp("SIG", s, 3) == 0)
396396
s += 3;
397-
if((sig = signm2signo(s)) == 0)
397+
if ((sig = signm2signo(s)) == 0)
398398
rb_raise(rb_eArgError, "unsupported name `SIG%s'", s);
399399

400400
if (negative)

string.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ str_alloc(VALUE klass)
385385
static inline VALUE
386386
empty_str_alloc(VALUE klass)
387387
{
388-
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
388+
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
389389
RUBY_DTRACE_STRING_CREATE(0, rb_sourcefile(), rb_sourceline());
390390
}
391391
return str_alloc(klass);
@@ -400,7 +400,7 @@ str_new(VALUE klass, const char *ptr, long len)
400400
rb_raise(rb_eArgError, "negative string size (or size too big)");
401401
}
402402

403-
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
403+
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
404404
RUBY_DTRACE_STRING_CREATE(len, rb_sourcefile(), rb_sourceline());
405405
}
406406

@@ -932,9 +932,9 @@ rb_str_dup(VALUE str)
932932
VALUE
933933
rb_str_resurrect(VALUE str)
934934
{
935-
if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
936-
RUBY_DTRACE_STRING_CREATE(
937-
RSTRING_LEN(str), rb_sourcefile(), rb_sourceline());
935+
if (RUBY_DTRACE_STRING_CREATE_ENABLED()) {
936+
RUBY_DTRACE_STRING_CREATE(RSTRING_LEN(str),
937+
rb_sourcefile(), rb_sourceline());
938938
}
939939
return str_replace(str_alloc(rb_cString), str);
940940
}

vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ m_core_hash_from_ary(VALUE self, VALUE ary)
19861986
VALUE hash = rb_hash_new();
19871987
int i;
19881988

1989-
if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
1989+
if (RUBY_DTRACE_HASH_CREATE_ENABLED()) {
19901990
RUBY_DTRACE_HASH_CREATE(RARRAY_LEN(ary), rb_sourcefile(), rb_sourceline());
19911991
}
19921992

vm_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ tracepoint_new(VALUE klass, rb_thread_t *target_th, rb_event_flag_t events, void
10821082
VALUE
10831083
rb_tracepoint_new(VALUE target_thread, rb_event_flag_t events, void (*func)(VALUE, void *), void *data)
10841084
{
1085-
rb_thread_t *target_th = 0;
1085+
rb_thread_t *target_th = GET_THREAD();
10861086
if (RTEST(target_thread)) {
10871087
/* TODO: now unsupported */
10881088
}

0 commit comments

Comments
 (0)