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

ruby-changes:57970

From: Nobuyoshi <ko1@a...>
Date: Fri, 27 Sep 2019 10:21:27 +0900 (JST)
Subject: [ruby-changes:57970] 0c6f36668a (master): Adjusted spaces [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=0c6f36668a

From 0c6f36668a11902903d85ada61a812d297d02de5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 27 Sep 2019 10:20:56 +0900
Subject: Adjusted spaces [ci skip]


diff --git a/class.c b/class.c
index d0ee7a6..b4aeb59 100644
--- a/class.c
+++ b/class.c
@@ -1974,9 +1974,9 @@ rb_scan_args_parse(int kw_flag, int argc, const VALUE *argv, const char *fmt, st https://github.com/ruby/ruby/blob/trunk/class.c#L1974
     arg->last_idx = -1;
     arg->hash = Qnil;
 
-    switch(kw_flag) {
+    switch (kw_flag) {
       case RB_SCAN_ARGS_PASS_CALLED_KEYWORDS:
-        if(!(keyword_given = rb_keyword_given_p())) {
+        if (!(keyword_given = rb_keyword_given_p())) {
             empty_keyword_given = rb_empty_keyword_given_p();
         }
         break;
diff --git a/compile.c b/compile.c
index 59ee138..68c7e5a 100644
--- a/compile.c
+++ b/compile.c
@@ -3988,7 +3988,7 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int pop https://github.com/ruby/ruby/blob/trunk/compile.c#L3988
         if (static_literal_node_p(node, iseq)) {
             /* count the elements that are optimizable */
             const NODE *node_tmp = node->nd_next;
-            for(; node_tmp && static_literal_node_p(node_tmp, iseq); node_tmp = node_tmp->nd_next)
+            for (; node_tmp && static_literal_node_p(node_tmp, iseq); node_tmp = node_tmp->nd_next)
                 count++;
 
             if ((first_chunk && stack_len == 0 && !node_tmp) || count >= min_tmp_ary_len) {
@@ -4117,7 +4117,7 @@ compile_hash(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popp https://github.com/ruby/ruby/blob/trunk/compile.c#L4117
         if (static_literal_node_pair_p(node, iseq)) {
             /* count the elements that are optimizable */
             const NODE *node_tmp = node->nd_next->nd_next;
-            for(; node_tmp && static_literal_node_pair_p(node_tmp, iseq); node_tmp = node_tmp->nd_next->nd_next)
+            for (; node_tmp && static_literal_node_pair_p(node_tmp, iseq); node_tmp = node_tmp->nd_next->nd_next)
                 count++;
 
             if ((first_chunk && stack_len == 0 && !node_tmp) || count >= min_tmp_hash_len) {
@@ -8968,7 +8968,8 @@ rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *storage) https://github.com/ruby/ruby/blob/trunk/compile.c#L8968
         if (offset > storage->size || offset > storage->pos) {
             pos = 0;
             storage = storage->next;
-        } else {
+        }
+        else {
 #ifdef STRICT_ALIGNMENT
             pos += (int)padding;
 #endif /* STRICT_ALIGNMENT */
@@ -8979,12 +8980,12 @@ rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *storage) https://github.com/ruby/ruby/blob/trunk/compile.c#L8980
                 int j;
                 const char *types = insn_op_types(iobj->insn_id);
 
-                for(j = 0; types[j]; j++) {
+                for (j = 0; types[j]; j++) {
                     char type = types[j];
-                    switch(type) {
-                        case TS_CDHASH:
-                        case TS_ISEQ:
-                        case TS_VALUE:
+                    switch (type) {
+                      case TS_CDHASH:
+                      case TS_ISEQ:
+                      case TS_VALUE:
                         {
                             VALUE op = OPERAND_AT(iobj, j);
                             if (!SPECIAL_CONST_P(op)) {
@@ -8992,8 +8993,8 @@ rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *storage) https://github.com/ruby/ruby/blob/trunk/compile.c#L8993
                             }
                             break;
                         }
-                        default:
-                            break;
+                      default:
+                        break;
                     }
                 }
             }
diff --git a/eval.c b/eval.c
index 5d402e5..24228ca 100644
--- a/eval.c
+++ b/eval.c
@@ -1648,8 +1648,8 @@ rb_mod_s_used_modules(VALUE _) https://github.com/ruby/ruby/blob/trunk/eval.c#L1648
     const rb_cref_t *cref = rb_vm_cref();
     VALUE ary = rb_ary_new();
 
-    while(cref) {
-	if(!NIL_P(CREF_REFINEMENTS(cref))) {
+    while (cref) {
+	if (!NIL_P(CREF_REFINEMENTS(cref))) {
 	    rb_hash_foreach(CREF_REFINEMENTS(cref), used_modules_i, ary);
 	}
 	cref = CREF_NEXT(cref);
diff --git a/file.c b/file.c
index 1c14c7e..b0056b0 100644
--- a/file.c
+++ b/file.c
@@ -4365,7 +4365,7 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode https://github.com/ruby/ruby/blob/trunk/file.c#L4365
     }
     unresolved_path = TO_OSPATH(unresolved_path);
 
-    if((resolved_ptr = realpath(RSTRING_PTR(unresolved_path), NULL)) == NULL) {
+    if ((resolved_ptr = realpath(RSTRING_PTR(unresolved_path), NULL)) == NULL) {
         /* glibc realpath(3) does not allow /path/to/file.rb/../other_file.rb,
            returning ENOTDIR in that case.
            glibc realpath(3) can also return ENOENT for paths that exist,
@@ -4398,9 +4398,9 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode https://github.com/ruby/ruby/blob/trunk/file.c#L4398
         rb_enc_associate(resolved, origenc);
     }
 
-    if(rb_enc_str_coderange(resolved) == ENC_CODERANGE_BROKEN) {
+    if (rb_enc_str_coderange(resolved) == ENC_CODERANGE_BROKEN) {
         rb_enc_associate(resolved, rb_filesystem_encoding());
-        if(rb_enc_str_coderange(resolved) == ENC_CODERANGE_BROKEN) {
+        if (rb_enc_str_coderange(resolved) == ENC_CODERANGE_BROKEN) {
             rb_enc_associate(resolved, rb_ascii8bit_encoding());
         }
     }
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index bb7b889..18901bb 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -2661,11 +2661,11 @@ rb_scan_args_set(int argc, const VALUE *argv, https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2661
 
     if (argi < argc) {
       argc_error:
-        if(tmp_buffer) rb_free_tmp_buffer(&tmp_buffer);
+        if (tmp_buffer) rb_free_tmp_buffer(&tmp_buffer);
         rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
     }
 
-    if(tmp_buffer) rb_free_tmp_buffer(&tmp_buffer);
+    if (tmp_buffer) rb_free_tmp_buffer(&tmp_buffer);
     return argc;
 }
 #endif
diff --git a/iseq.c b/iseq.c
index 03fe1dd..ae7b1cc 100644
--- a/iseq.c
+++ b/iseq.c
@@ -262,7 +262,7 @@ rb_iseq_update_references(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L262
         if (body->catch_table) {
             struct iseq_catch_table *table = body->catch_table;
             unsigned int i;
-            for(i = 0; i < table->size; i++) {
+            for (i = 0; i < table->size; i++) {
                 struct iseq_catch_table_entry *entry;
                 entry = UNALIGNED_MEMBER_PTR(table, entries[i]);
                 if (entry->iseq) {
@@ -321,7 +321,7 @@ rb_iseq_mark(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L321
 	if (body->catch_table) {
 	    const struct iseq_catch_table *table = body->catch_table;
 	    unsigned int i;
-	    for(i = 0; i < table->size; i++) {
+	    for (i = 0; i < table->size; i++) {
 		const struct iseq_catch_table_entry *entry;
 		entry = UNALIGNED_MEMBER_PTR(table, entries[i]);
 		if (entry->iseq) {
diff --git a/node.c b/node.c
index ee6a356..8f42f7e 100644
--- a/node.c
+++ b/node.c
@@ -1194,20 +1194,20 @@ rb_ast_newnode(rb_ast_t *ast, enum node_type type) https://github.com/ruby/ruby/blob/trunk/node.c#L1194
 {
     node_buffer_t *nb = ast->node_buffer;
     switch (type) {
-        case NODE_MATCH:
-        case NODE_LIT:
-        case NODE_STR:
-        case NODE_XSTR:
-        case NODE_DSTR:
-        case NODE_DXSTR:
-        case NODE_DREGX:
-        case NODE_DSYM:
-        case NODE_ARGS:
-        case NODE_SCOPE:
-        case NODE_ARYPTN:
-            return ast_newnode_in_bucket(&nb->markable);
-        default:
-            return ast_newnode_in_bucket(&nb->unmarkable);
+      case NODE_MATCH:
+      case NODE_LIT:
+      case NODE_STR:
+      case NODE_XSTR:
+      case NODE_DSTR:
+      case NODE_DXSTR:
+      case NODE_DREGX:
+      case NODE_DSYM:
+      case NODE_ARGS:
+      case NODE_SCOPE:
+      case NODE_ARYPTN:
+        return ast_newnode_in_bucket(&nb->markable);
+      default:
+        return ast_newnode_in_bucket(&nb->unmarkable);
     }
 }
 
@@ -1257,7 +1257,7 @@ static void https://github.com/ruby/ruby/blob/trunk/node.c#L1257
 mark_ast_value(void *ctx, NODE * node)
 {
     switch (nd_type(node)) {
-        case NODE_SCOPE:
+      case NODE_SCOPE:
         {
             ID *buf = node->nd_tbl;
             if (buf) {
@@ -1266,30 +1266,30 @@ mark_ast_value(void *ctx, NODE * node) https://github.com/ruby/ruby/blob/trunk/node.c#L1266
             }
             break;
         }
-        case NODE_ARYPTN:
+      case NODE_ARYPTN:
         {
             struct rb_ary_pattern_info *apinfo = node->nd_apinfo;
             rb_gc_mark_movable(apinfo->imemo);
             break;
         }
-        case NODE_ARGS:
+      case NODE_ARGS:
         {
             struct rb_args_info *args = node->nd_ainfo;
             rb_gc_mark_movable(args->imemo);
             break;
         }
-        case NODE_MATCH:
-        case NODE_LIT:
-        case NODE_STR:
-        case NODE_XSTR:
-        case NODE_DSTR:
-        case NODE_DXSTR:
-        case NODE_DREGX:
-        case NODE_DSYM:
-            rb_gc_mark_movable(node->nd_lit);
-            break;
-        default:
-            rb_bug("unreachable node %s", ruby_node_name(nd_type(node)));
+      case NODE_MATCH:
+      case NODE_LIT:
+      case NODE_STR:
+      case NODE_XSTR:
+      case NODE_DSTR:
+      case NODE_DXSTR:
+      case NODE_DREGX:
+      case NODE_DSYM:
+        rb_gc_mark_movable(node->nd_lit);
+        break;
+      default:
+        rb_bug("unreachable node %s", ruby_node_name(nd_type(node)));
     }
 }
 
@@ -1297,7 +1297,7 @@ static void https://g (... truncated)

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

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