[前][次][番号順一覧][スレッド一覧]

ruby-changes:26072

From: nobu <ko1@a...>
Date: Sun, 2 Dec 2012 00:25:42 +0900 (JST)
Subject: [ruby-changes:26072] nobu:r38128 (trunk): adjust style.

nobu	2012-12-02 00:25:28 +0900 (Sun, 02 Dec 2012)

  New Revision: 38128

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38128

  Log:
    adjust style.

  Modified files:
    trunk/array.c
    trunk/dln.c
    trunk/encoding.c
    trunk/enum.c
    trunk/enumerator.c
    trunk/eval.c
    trunk/hash.c
    trunk/load.c
    trunk/numeric.c
    trunk/probes_helper.h
    trunk/signal.c
    trunk/string.c
    trunk/vm.c
    trunk/vm_trace.c

Index: array.c
===================================================================
--- array.c	(revision 38127)
+++ array.c	(revision 38128)
@@ -379,7 +379,7 @@
 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 @@
 	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 @@
 	}
 
 	/* 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)) {
Index: encoding.c
===================================================================
--- encoding.c	(revision 38127)
+++ encoding.c	(revision 38128)
@@ -1487,7 +1487,7 @@
 # endif
     if (!codeset) {
 	UINT codepage = GetConsoleCP();
-	if(!codepage) codepage = GetACP();
+	if (!codepage) codepage = GetACP();
 	snprintf(cp, sizeof(cp), "CP%d", codepage);
 	codeset = cp;
     }
Index: enumerator.c
===================================================================
--- enumerator.c	(revision 38127)
+++ enumerator.c	(revision 38128)
@@ -1003,7 +1003,7 @@
 	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);
Index: enum.c
===================================================================
--- enum.c	(revision 38127)
+++ enum.c	(revision 38128)
@@ -2490,7 +2490,7 @@
     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);
 
Index: string.c
===================================================================
--- string.c	(revision 38127)
+++ string.c	(revision 38128)
@@ -385,7 +385,7 @@
 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 @@
 	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 @@
 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);
 }
Index: load.c
===================================================================
--- load.c	(revision 38127)
+++ load.c	(revision 38128)
@@ -623,11 +623,10 @@
 
     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));
@@ -638,8 +637,8 @@
     }
     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;
@@ -875,11 +874,10 @@
     } 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();
@@ -893,20 +891,18 @@
 	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)))) {
@@ -943,8 +939,8 @@
 
     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;
Index: eval.c
===================================================================
--- eval.c	(revision 38127)
+++ eval.c	(revision 38128)
@@ -503,10 +503,10 @@
     }
 
     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);
     }
Index: probes_helper.h
===================================================================
--- probes_helper.h	(revision 38127)
+++ probes_helper.h	(revision 38128)
@@ -23,7 +23,7 @@
 	    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 _name = rb_class_path_no_cache(_klass); \
 		    if (!NIL_P(_name)) { \
 		        classname = StringValuePtr(_name); \
-		    } else { \
+		    } \
+		    else {			 \
 		        classname = "<unknown>"; \
 		    } \
 		    methodname = rb_id2name(_id); \
Index: dln.c
===================================================================
--- dln.c	(revision 38127)
+++ dln.c	(revision 38128)
@@ -767,7 +767,7 @@
 	    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 @@
 	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));
Index: hash.c
===================================================================
--- hash.c	(revision 38127)
+++ hash.c	(revision 38128)
@@ -219,7 +219,7 @@
 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());
     }
 
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 38127)
+++ vm_trace.c	(revision 38128)
@@ -1082,7 +1082,7 @@
 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 */
     }
Index: numeric.c
===================================================================
--- numeric.c	(revision 38127)
+++ numeric.c	(revision 38128)
@@ -850,7 +850,7 @@
     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
Index: vm.c
===================================================================
--- vm.c	(revision 38127)
+++ vm.c	(revision 38128)
@@ -1986,7 +1986,7 @@
     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());
     }
 
Index: signal.c
===================================================================
--- signal.c	(revision 38127)
+++ signal.c	(revision 38128)
@@ -394,7 +394,7 @@
 	}
 	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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]