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

ruby-changes:27535

From: nagachika <ko1@a...>
Date: Tue, 5 Mar 2013 00:53:31 +0900 (JST)
Subject: [ruby-changes:27535] nagachika:r39587 (ruby_2_0_0): merge revision(s) 39329: [Backport #8011]

nagachika	2013-03-05 00:50:02 +0900 (Tue, 05 Mar 2013)

  New Revision: 39587

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

  Log:
    merge revision(s) 39329: [Backport #8011]
    
    enumerator.c: suppress warnings
    
    * enumerator.c (lazy_zip_arrays_func, lazy_zip_func, lazy_take_func),
      (lazy_drop_func, lazy_drop_while_func): suppress uninitialized
      instance vriable warnings.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/enumerator.c
    branches/ruby_2_0_0/test/ruby/test_lazy_enumerator.rb
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/enumerator.c
===================================================================
--- ruby_2_0_0/enumerator.c	(revision 39586)
+++ ruby_2_0_0/enumerator.c	(revision 39587)
@@ -1631,7 +1631,7 @@ lazy_zip_arrays_func(VALUE val, VALUE ar https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/enumerator.c#L1631
     long i, count;
 
     yielder = argv[0];
-    memo = rb_ivar_get(yielder, id_memo);
+    memo = rb_attr_get(yielder, id_memo);
     count = NIL_P(memo) ? 0 : NUM2LONG(memo);
 
     ary = rb_ary_new2(RARRAY_LEN(arrays) + 1);
@@ -1651,7 +1651,7 @@ lazy_zip_func(VALUE val, VALUE zip_args, https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/enumerator.c#L1651
     long i;
 
     yielder = argv[0];
-    arg = rb_ivar_get(yielder, id_memo);
+    arg = rb_attr_get(yielder, id_memo);
     if (NIL_P(arg)) {
 	arg = rb_ary_new2(RARRAY_LEN(zip_args));
 	for (i = 0; i < RARRAY_LEN(zip_args); i++) {
@@ -1708,7 +1708,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/enumerator.c#L1708
 lazy_take_func(VALUE val, VALUE args, int argc, VALUE *argv)
 {
     long remain;
-    VALUE memo = rb_ivar_get(argv[0], id_memo);
+    VALUE memo = rb_attr_get(argv[0], id_memo);
     if (NIL_P(memo)) {
 	memo = args;
     }
@@ -1791,7 +1791,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/enumerator.c#L1791
 lazy_drop_func(VALUE val, VALUE args, int argc, VALUE *argv)
 {
     long remain;
-    VALUE memo = rb_ivar_get(argv[0], id_memo);
+    VALUE memo = rb_attr_get(argv[0], id_memo);
     if (NIL_P(memo)) {
 	memo = args;
     }
@@ -1820,7 +1820,7 @@ lazy_drop(VALUE obj, VALUE n) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/enumerator.c#L1820
 static VALUE
 lazy_drop_while_func(VALUE val, VALUE args, int argc, VALUE *argv)
 {
-    VALUE memo = rb_ivar_get(argv[0], id_memo);
+    VALUE memo = rb_attr_get(argv[0], id_memo);
     if (NIL_P(memo) && !RTEST(rb_yield_values2(argc - 1, &argv[1]))) {
 	rb_ivar_set(argv[0], id_memo, memo = Qtrue);
     }
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 39586)
+++ ruby_2_0_0/version.h	(revision 39587)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-03-05"
-#define RUBY_PATCHLEVEL 16
+#define RUBY_PATCHLEVEL 17
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_0_0/test/ruby/test_lazy_enumerator.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_lazy_enumerator.rb	(revision 39586)
+++ ruby_2_0_0/test/ruby/test_lazy_enumerator.rb	(revision 39587)
@@ -463,4 +463,13 @@ EOS https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_lazy_enumerator.rb#L463
     end
     assert_equal Enumerator::Lazy, [].lazy.chunk{}.class, bug7507
   end
+
+  def test_no_warnings
+    le = (1..3).lazy
+    assert_warning("") {le.zip([4,5,6]).force}
+    assert_warning("") {le.zip(4..6).force}
+    assert_warning("") {le.take(1).force}
+    assert_warning("") {le.drop(1).force}
+    assert_warning("") {le.drop_while{false}.force}
+  end
 end

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39329


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

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