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

ruby-changes:40810

From: nobu <ko1@a...>
Date: Sat, 5 Dec 2015 02:28:46 +0900 (JST)
Subject: [ruby-changes:40810] nobu:r52889 (trunk): compile.c: no extra parentheses

nobu	2015-12-05 02:28:26 +0900 (Sat, 05 Dec 2015)

  New Revision: 52889

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

  Log:
    compile.c: no extra parentheses
    
    * compile.c (COMPILE_ERROR): remove extra parentheses to enclose
      variadic arguments.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 52888)
+++ compile.c	(revision 52889)
@@ -327,7 +327,7 @@ prepare_compile_error(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/compile.c#L327
     return append_compile_error;
 }
 
-#define COMPILE_ERROR(strs) prepare_compile_error(iseq)strs
+#define COMPILE_ERROR prepare_compile_error(iseq)
 
 #define ERROR_ARGS_AT(n) ruby_sourcefile, nd_line(n),
 #define ERROR_ARGS ERROR_ARGS_AT(node)
@@ -509,9 +509,9 @@ validate_label(st_data_t name, st_data_t https://github.com/ruby/ruby/blob/trunk/compile.c#L509
     LABEL *lobj = (LABEL *)label;
     if (!lobj->link.next) {
 	do {
-	    COMPILE_ERROR((ruby_sourcefile, lobj->position,
-			   "%"PRIsVALUE": undefined label",
-			   rb_id2str((ID)name)));
+	    COMPILE_ERROR(ruby_sourcefile, lobj->position,
+			  "%"PRIsVALUE": undefined label",
+			  rb_id2str((ID)name));
 	} while (0);
     }
     return ST_CONTINUE;
@@ -592,8 +592,8 @@ rb_iseq_compile_node(rb_iseq_t *iseq, NO https://github.com/ruby/ruby/blob/trunk/compile.c#L592
 	  case ISEQ_TYPE_EVAL:
 	  case ISEQ_TYPE_MAIN:
 	  case ISEQ_TYPE_TOP:
-	    COMPILE_ERROR((ERROR_ARGS "compile/should not be reached: %s:%d",
-			   __FILE__, __LINE__));
+	    COMPILE_ERROR(ERROR_ARGS "compile/should not be reached: %s:%d",
+			  __FILE__, __LINE__);
 	    return COMPILE_NG;
 	  case ISEQ_TYPE_RESCUE:
 	    iseq_set_exception_local_table(iseq);
@@ -1556,7 +1556,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1556
 	  default:
 	    dump_disasm_list(FIRST_ELEMENT(anchor));
 	    dump_disasm_list(list);
-	    COMPILE_ERROR((ruby_sourcefile, line, "error: set_sequence"));
+	    COMPILE_ERROR(ruby_sourcefile, line, "error: set_sequence");
 	    return COMPILE_NG;
 	}
 	list = list->next;
@@ -1603,9 +1603,9 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1603
 		    dump_disasm_list(list);
 		    xfree(generated_iseq);
 		    xfree(line_info_table);
-		    COMPILE_ERROR((ruby_sourcefile, iobj->line_no,
-				   "operand size miss! (%d for %d)",
-				   iobj->operand_size, len - 1));
+		    COMPILE_ERROR(ruby_sourcefile, iobj->line_no,
+				  "operand size miss! (%d for %d)",
+				  iobj->operand_size, len - 1);
 		    return COMPILE_NG;
 		}
 
@@ -1618,8 +1618,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1618
 			    /* label(destination position) */
 			    LABEL *lobj = (LABEL *)operands[j];
 			    if (!lobj->set) {
-				COMPILE_ERROR((ruby_sourcefile, iobj->line_no,
-					       "unknown label"));
+				COMPILE_ERROR(ruby_sourcefile, iobj->line_no,
+					      "unknown label");
 				return COMPILE_NG;
 			    }
 			    if (lobj->sp == -1) {
@@ -1712,8 +1712,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L1712
 		      default:
 			xfree(generated_iseq);
 			xfree(line_info_table);
-			COMPILE_ERROR((ruby_sourcefile, iobj->line_no,
-				       "unknown operand type: %c", type));
+			COMPILE_ERROR(ruby_sourcefile, iobj->line_no,
+				      "unknown operand type: %c", type);
 			return COMPILE_NG;
 		    }
 		}
@@ -2450,8 +2450,8 @@ insn_set_sc_state(rb_iseq_t *iseq, INSN https://github.com/ruby/ruby/blob/trunk/compile.c#L2450
 		dump_disasm_list((LINK_ELEMENT *)iobj);
 		dump_disasm_list((LINK_ELEMENT *)lobj);
 		printf("\n-- %d, %d\n", lobj->sc_state, nstate);
-		COMPILE_ERROR((ruby_sourcefile, iobj->line_no,
-			       "insn_set_sc_state error\n"));
+		COMPILE_ERROR(ruby_sourcefile, iobj->line_no,
+			      "insn_set_sc_state error\n");
 		return COMPILE_NG;
 	    }
 	}
@@ -2552,8 +2552,8 @@ iseq_set_sequence_stackcaching(rb_iseq_t https://github.com/ruby/ruby/blob/trunk/compile.c#L2552
 			  case SCS_XX:
 			    goto normal_insn;
 			  default:
-			    COMPILE_ERROR((ruby_sourcefile, iobj->line_no,
-					   "unreachable"));
+			    COMPILE_ERROR(ruby_sourcefile, iobj->line_no,
+					  "unreachable");
 			    return COMPILE_NG;
 			}
 			/* remove useless pop */
@@ -3716,7 +3716,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L3716
 	line = nd_line(node);
 
 	if (type != NODE_WHEN) {
-	    COMPILE_ERROR((ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type)));
+	    COMPILE_ERROR(ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type));
 	    debug_node_end();
 	    return COMPILE_NG;
 	}
@@ -4018,7 +4018,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4018
 	}
 	else if (iseq->body->type == ISEQ_TYPE_EVAL) {
 	  break_in_eval:
-	    COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with break"));
+	    COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with break");
 	    debug_node_end();
 	    return COMPILE_NG;
 	}
@@ -4046,7 +4046,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4046
 
 		ip = ip->body->parent_iseq;
 	    }
-	    COMPILE_ERROR((ERROR_ARGS "Invalid break"));
+	    COMPILE_ERROR(ERROR_ARGS "Invalid break");
 	    debug_node_end();
 	    return COMPILE_NG;
 	}
@@ -4084,7 +4084,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4084
 	}
 	else if (iseq->body->type == ISEQ_TYPE_EVAL) {
 	  next_in_eval:
-	    COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
+	    COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with next");
 	}
 	else {
 	    const rb_iseq_t *ip = iseq;
@@ -4118,7 +4118,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4118
 		}
 	    }
 	    else {
-		COMPILE_ERROR((ERROR_ARGS "Invalid next"));
+		COMPILE_ERROR(ERROR_ARGS "Invalid next");
 	    }
 	}
 	break;
@@ -4138,7 +4138,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4138
 	}
 	else if (iseq->body->type == ISEQ_TYPE_EVAL) {
 	  redo_in_eval:
-	    COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
+	    COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with redo");
 	}
 	else if (ISEQ_COMPILE_DATA(iseq)->start_label) {
 	    LABEL *splabel = NEW_LABEL(0);
@@ -4185,7 +4185,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4185
 		}
 	    }
 	    else {
-		COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
+		COMPILE_ERROR(ERROR_ARGS "Invalid redo");
 	    }
 	}
 	break;
@@ -4200,7 +4200,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4200
 	    }
 	}
 	else {
-	    COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
+	    COMPILE_ERROR(ERROR_ARGS "Invalid retry");
 	}
 	break;
       }
@@ -4686,8 +4686,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4686
 	    COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head);
 	    break;
 	  default:
-	    COMPILE_ERROR((ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
-			   ruby_node_name(nd_type(node->nd_head))));
+	    COMPILE_ERROR(ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
+			  ruby_node_name(nd_type(node->nd_head)));
 	    debug_node_end();
 	    return COMPILE_NG;
 	}
@@ -4886,7 +4886,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4886
 		    }
 		}
 		else {
-		    COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
+		    COMPILE_ERROR(ERROR_ARGS "invalid goto/label format");
 		}
 
 
@@ -5119,7 +5119,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L5119
 
 	if (is) {
 	    if (is->body->type == ISEQ_TYPE_TOP) {
-		COMPILE_ERROR((ERROR_ARGS "Invalid return"));
+		COMPILE_ERROR(ERROR_ARGS "Invalid return");
 	    }
 	    else {
 		LABEL *splabel = 0;
@@ -5160,7 +5160,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L5160
 
 	INIT_ANCHOR(args);
 	if (iseq->body->type == ISEQ_TYPE_TOP) {
-	    COMPILE_ERROR((ERROR_ARGS "Invalid yield"));
+	    COMPILE_ERROR(ERROR_ARGS "Invalid yield");
 	    debug_node_end();
 	    return COMPILE_NG;
 	}
@@ -6332,15 +6332,15 @@ iseq_build_from_ary_body(rb_iseq_t *iseq https://github.com/ruby/ruby/blob/trunk/compile.c#L6332
 	    insn = (argc < 0) ? Qnil : RARRAY_AREF(obj, 0);
 	    if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
 		/* TODO: exception */
-		COMPILE_ERROR((ruby_sourcefile, line_no,
-			       "unknown instruction: %+"PRIsVALUE, insn));
+		COMPILE_ERROR(ruby_sourcefile, line_no,
+			      "unknown instruction: %+"PRIsVALUE, insn);
 		ret = COMPILE_NG;
 		break;
 	    }
 
 	    if (argc != insn_len((VALUE)insn_id)-1) {
-		COMPILE_ERROR((ruby_sourcefile, line_no,
-			       "operand size mismatch"));
+		COMPILE_ERROR(ruby_sourcefile, line_no,
+			      "operand size mismatch");
 		ret = COMPILE_NG;
 		break;
 	    }

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

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