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

ruby-changes:27435

From: nobu <ko1@a...>
Date: Mon, 25 Feb 2013 13:54:37 +0900 (JST)
Subject: [ruby-changes:27435] nobu:r39487 (trunk): string.c: STRING_ENUMERATORS_WANTARRAY

nobu	2013-02-25 13:54:27 +0900 (Mon, 25 Feb 2013)

  New Revision: 39487

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

  Log:
    string.c: STRING_ENUMERATORS_WANTARRAY
    
    * string.c (STRING_ENUMERATORS_WANTARRAY): name preprocessing
      codition.

  Modified files:
    trunk/string.c

Index: string.c
===================================================================
--- string.c	(revision 39486)
+++ string.c	(revision 39487)
@@ -29,6 +29,8 @@ https://github.com/ruby/ruby/blob/trunk/string.c#L29
 #include <unistd.h>
 #endif
 
+#define STRING_ENUMERATORS_WANTARRAY 0 /* next major */
+
 #define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 
 #undef rb_str_new_cstr
@@ -6115,7 +6117,7 @@ rb_str_enumerate_lines(int argc, VALUE * https://github.com/ruby/ruby/blob/trunk/string.c#L6117
 
     if (rb_block_given_p()) {
 	if (wantarray) {
-#if 0 /* next major */
+#if STRING_ENUMERATORS_WANTARRAY
 	    rb_warn("given block not used");
 	    ary = rb_ary_new();
 #else
@@ -6297,7 +6299,7 @@ rb_str_enumerate_bytes(VALUE str, int wa https://github.com/ruby/ruby/blob/trunk/string.c#L6299
 
     if (rb_block_given_p()) {
 	if (wantarray) {
-#if 0 /* next major */
+#if STRING_ENUMERATORS_WANTARRAY
 	    rb_warn("given block not used");
 	    ary = rb_ary_new();
 #else
@@ -6390,7 +6392,7 @@ rb_str_enumerate_chars(VALUE str, int wa https://github.com/ruby/ruby/blob/trunk/string.c#L6392
 
     if (rb_block_given_p()) {
 	if (wantarray) {
-#if 0 /* next major */
+#if STRING_ENUMERATORS_WANTARRAY
 	    rb_warn("given block not used");
 	    ary = rb_ary_new();
 #else
@@ -6493,7 +6495,7 @@ rb_str_enumerate_codepoints(VALUE str, i https://github.com/ruby/ruby/blob/trunk/string.c#L6495
 
     if (rb_block_given_p()) {
 	if (wantarray) {
-#if 0 /* next major */
+#if STRING_ENUMERATORS_WANTARRAY
 	    rb_warn("given block not used");
 	    ary = rb_ary_new();
 #else

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

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