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

ruby-changes:5454

From: shyouhei <ko1@a...>
Date: Sun, 8 Jun 2008 04:27:58 +0900 (JST)
Subject: [ruby-changes:5454] Ruby:r16957 (ruby_1_8_6): merge revision(s) 14036:14039:

shyouhei	2008-06-08 04:27:49 +0900 (Sun, 08 Jun 2008)

  New Revision: 16957

  Modified files:
    branches/ruby_1_8_6/bignum.c
    branches/ruby_1_8_6/sprintf.c
    branches/ruby_1_8_6/version.h

  Log:
    merge revision(s) 14036:14039:
    * bignum.c (rb_big2str0): do not clobber space for sign.
    * sprintf.c (remove_sign_bits): extends sign bit first.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=16957&r2=16956&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/sprintf.c?r1=16957&r2=16956&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/bignum.c?r1=16957&r2=16956&diff_format=u

Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 16956)
+++ ruby_1_8_6/version.h	(revision 16957)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2008-06-08"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20080608
-#define RUBY_PATCHLEVEL 150
+#define RUBY_PATCHLEVEL 151
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_6/bignum.c
===================================================================
--- ruby_1_8_6/bignum.c	(revision 16956)
+++ ruby_1_8_6/bignum.c	(revision 16957)
@@ -706,7 +706,7 @@
 	while (k--) {
 	    s[--j] = ruby_digitmap[num % base];
 	    num /= base;
-	    if (!trim && j < 1) break;
+	    if (!trim && j <= 1) break;
 	    if (trim && i == 0 && num == 0) break;
 	}
     }
Index: ruby_1_8_6/sprintf.c
===================================================================
--- ruby_1_8_6/sprintf.c	(revision 16956)
+++ ruby_1_8_6/sprintf.c	(revision 16957)
@@ -18,6 +18,8 @@
 #include <math.h>
 
 #define BIT_DIGITS(N)   (((N)*146)/485 + 1)  /* log2(10) =~ 146/485 */
+#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
+#define EXTENDSIGN(n, l) (((~0 << (n)) >> (((n)*(l)) % BITSPERDIG)) & ~(~0 << (n)))
 
 static void fmt_setup _((char*,int,int,int,int));
 
@@ -36,7 +38,7 @@
 	}
     }
     else if (base == 8) {
-	if (*t == '3') t++;
+	*t |= EXTENDSIGN(3, strlen(t));
 	while (*t == '7') {
 	    t++;
 	}

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

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