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

ruby-changes:7864

From: naruse <ko1@a...>
Date: Tue, 16 Sep 2008 22:23:33 +0900 (JST)
Subject: [ruby-changes:7864] Ruby:r19385 (trunk): * string.c (rb_str_concat): fix rdoc. (codepoint is integer)

naruse	2008-09-16 22:23:16 +0900 (Tue, 16 Sep 2008)

  New Revision: 19385

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

  Log:
    * string.c (rb_str_concat): fix rdoc. (codepoint is integer)
    
    * string.c (rb_str_each_codepoint): use UINT2NUM.

  Modified files:
    trunk/ChangeLog
    trunk/string.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19384)
+++ ChangeLog	(revision 19385)
@@ -1,3 +1,9 @@
+Tue Sep 16 22:21:33 2008  NARUSE, Yui  <naruse@r...>
+
+	* string.c (rb_str_concat): fix rdoc. (codepoint is integer)
+
+	* string.c (rb_str_each_codepoint): use UINT2NUM.
+
 Tue Sep 16 21:48:55 2008  NARUSE, Yui  <naruse@r...>
 
 	* re.c (rb_reg_desc): Regexp#inspect should be US-ASCII.
Index: string.c
===================================================================
--- string.c	(revision 19384)
+++ string.c	(revision 19385)
@@ -1712,13 +1712,13 @@
 
 /*
  *  call-seq:
- *     str << fixnum        => str
- *     str.concat(fixnum)   => str
+ *     str << integer       => str
+ *     str.concat(integer)  => str
  *     str << obj           => str
  *     str.concat(obj)      => str
  *  
  *  Append---Concatenates the given object to <i>str</i>. If the object is a
- *  <code>Fixnum</code>, it is considered as a codepoint, and is converted
+ *  <code>Integer</code>, it is considered as a codepoint, and is converted
  *  to a character before concatenation.
  *     
  *     a = "hello "
@@ -5523,7 +5523,7 @@
 /*
  *  Document-method: each_codepoint
  *  call-seq:
- *     str.each_codepoint {|fixnum| block }    => str
+ *     str.each_codepoint {|integer| block }    => str
  *  
  *  Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
  *  also known as a <i>codepoint</i> when applied to Unicode strings to the
@@ -5553,7 +5553,7 @@
     while (ptr < end) {
 	c = rb_enc_codepoint(ptr, end, enc);
 	n = rb_enc_codelen(c, enc);
-	rb_yield(INT2FIX(c));
+	rb_yield(UINT2NUM(c));
 	ptr += n;
     }
     return str;

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

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