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

ruby-changes:49685

From: shyouhei <ko1@a...>
Date: Sat, 13 Jan 2018 19:47:39 +0900 (JST)
Subject: [ruby-changes:49685] shyouhei:r61802 (trunk): __VA_ARGS__ is a C99ism

shyouhei	2018-01-13 19:47:33 +0900 (Sat, 13 Jan 2018)

  New Revision: 61802

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

  Log:
    __VA_ARGS__ is a C99ism
    
    give up CALL_ATTRIBUTE macro.

  Modified files:
    trunk/tool/ruby_vm/views/_attributes.erb
    trunk/tool/ruby_vm/views/_insn_stack_increase.erb
Index: tool/ruby_vm/views/_attributes.erb
===================================================================
--- tool/ruby_vm/views/_attributes.erb	(revision 61801)
+++ tool/ruby_vm/views/_attributes.erb	(revision 61802)
@@ -10,8 +10,6 @@ typedef unsigned long lindex_t; https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_attributes.erb#L10
 typedef VALUE GENTRY;
 typedef rb_iseq_t *ISEQ;
 
-#define CALL_ATTRIBUTE(name, insn, ...) attr_ ## name ## _ ## insn(__VA_ARGS__)
-
 % attrs = RubyVM::Instructions.map(&:attributes).flatten
 %
 % attrs.each do |a|
Index: tool/ruby_vm/views/_insn_stack_increase.erb
===================================================================
--- tool/ruby_vm/views/_insn_stack_increase.erb	(revision 61801)
+++ tool/ruby_vm/views/_insn_stack_increase.erb	(revision 61802)
@@ -35,11 +35,10 @@ insn_stack_increase_dispatch(enum ruby_v https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_insn_stack_increase.erb#L35
 % RubyVM::Instructions.each do |i|
 %   next unless i.has_attribute?('sp_inc')
     case <%= i.bin %>:
-        return CALL_ATTRIBUTE(sp_inc, <%= i.name %><%=
+        return attr_sp_inc_<%= i.name %>(<%=
           i.opes.map.with_index do |v, j|
-            k = i.cast_from_VALUE v, "opes[#{j}]"
-            next ", #{k}"
-          end.join
+            i.cast_from_VALUE v, "opes[#{j}]"
+          end.join(", ")
         %>);
 % end
     }

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

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