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

ruby-changes:34557

From: nagachika <ko1@a...>
Date: Tue, 1 Jul 2014 23:36:13 +0900 (JST)
Subject: [ruby-changes:34557] nagachika:r46638 (trunk): * numeric.c (num_step_scan_args): table argument of rb_get_kwargs() is

nagachika	2014-07-01 23:36:03 +0900 (Tue, 01 Jul 2014)

  New Revision: 46638

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

  Log:
    * numeric.c (num_step_scan_args): table argument of rb_get_kwargs() is
      array of IDs, not Symbols. [ruby-dev:48353] [Bug #9811]

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46637)
+++ ChangeLog	(revision 46638)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul  1 23:30:51 2014  CHIKANAGA Tomoyuki  <nagachika@r...>
+
+	* numeric.c (num_step_scan_args): table argument of rb_get_kwargs() is
+	  array of IDs, not Symbols. [ruby-dev:48353] [Bug #9811]
+
 Tue Jul  1 16:18:22 2014  Akinori MUSHA  <knu@i...>
 
 	* ext/digest/lib/digest/hmac.rb, test/digest/test_digest_hmac.rb:
Index: numeric.c
===================================================================
--- numeric.c	(revision 46637)
+++ numeric.c	(revision 46638)
@@ -122,7 +122,7 @@ VALUE rb_cFixnum; https://github.com/ruby/ruby/blob/trunk/numeric.c#L122
 VALUE rb_eZeroDivError;
 VALUE rb_eFloatDomainError;
 
-static VALUE sym_to, sym_by;
+static ID id_to, id_by;
 
 void
 rb_num_zerodiv(void)
@@ -1997,8 +1997,8 @@ num_step_scan_args(int argc, const VALUE https://github.com/ruby/ruby/blob/trunk/numeric.c#L1997
     if (!NIL_P(hash)) {
 	ID keys[2];
 	VALUE values[2];
-	keys[0] = sym_to;
-	keys[1] = sym_by;
+	keys[0] = id_to;
+	keys[1] = id_by;
 	rb_get_kwargs(hash, keys, 0, 2, values);
 	if (values[0] != Qundef) {
 	    if (argc > 0) rb_raise(rb_eArgError, "to is given twice");
@@ -4235,8 +4235,8 @@ Init_Numeric(void) https://github.com/ruby/ruby/blob/trunk/numeric.c#L4235
     rb_define_method(rb_cFloat, "next_float", flo_next_float, 0);
     rb_define_method(rb_cFloat, "prev_float", flo_prev_float, 0);
 
-    sym_to = ID2SYM(rb_intern("to"));
-    sym_by = ID2SYM(rb_intern("by"));
+    id_to = rb_intern("to");
+    id_by = rb_intern("by");
 }
 
 #undef rb_float_value

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

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