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

ruby-changes:29505

From: akr <ko1@a...>
Date: Sat, 22 Jun 2013 13:12:58 +0900 (JST)
Subject: [ruby-changes:29505] akr:r41557 (trunk): * bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.

akr	2013-06-22 13:12:48 +0900 (Sat, 22 Jun 2013)

  New Revision: 41557

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

  Log:
    * bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.
      (RSHIFTX): Removed.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41556)
+++ ChangeLog	(revision 41557)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun 22 13:07:15 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (CLEAR_LOWBITS): Rewritten without RSHIFTX.
+	  (RSHIFTX): Removed.
+
 Sat Jun 22 10:38:03 2013  Tanaka Akira  <akr@f...>
 
 	* pack.c (num2i32): Removed.
Index: bignum.c
===================================================================
--- bignum.c	(revision 41556)
+++ bignum.c	(revision 41557)
@@ -40,8 +40,7 @@ static VALUE big_three = Qnil; https://github.com/ruby/ruby/blob/trunk/bignum.c#L40
 #endif
 #define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2))
 #define LSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? 0 : ((d) << (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n))))
-#define RSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? ~((d)*0) : RSHIFT((d), (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n))))
-#define CLEAR_LOWBITS(d, numbits) LSHIFTX(RSHIFTX((d), (numbits)), (numbits))
+#define CLEAR_LOWBITS(d, numbits) ((d) & LSHIFTX(~((d)*0), (numbits)))
 #define FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1))
 
 #define BDIGITS(x) (RBIGNUM_DIGITS(x))

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

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