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

ruby-changes:30398

From: akr <ko1@a...>
Date: Sat, 10 Aug 2013 04:55:32 +0900 (JST)
Subject: [ruby-changes:30398] akr:r42477 (trunk): * bignum.c (big_div_struct): Use size_t.

akr	2013-08-10 04:55:24 +0900 (Sat, 10 Aug 2013)

  New Revision: 42477

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

  Log:
    * bignum.c (big_div_struct): Use size_t.
      (bigdivrem1): Ditto.
      (bigdivrem_num_extra_words): Ditto.
      (bigdivrem_single): Ditto.
      (bigdivrem_normal): Ditto.
      (bary_divmod): Ditto.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42476)
+++ ChangeLog	(revision 42477)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug 10 04:52:21 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (big_div_struct): Use size_t.
+	  (bigdivrem1): Ditto.
+	  (bigdivrem_num_extra_words): Ditto.
+	  (bigdivrem_single): Ditto.
+	  (bigdivrem_normal): Ditto.
+	  (bary_divmod): Ditto.
+
 Fri Aug  9 23:47:15 2013  Kouhei Sutou  <kou@c...>
 
 	* lib/rss/rexmlparser.rb: Remove needless REXML version check.
Index: bignum.c
===================================================================
--- bignum.c	(revision 42476)
+++ bignum.c	(revision 42477)
@@ -136,7 +136,7 @@ typedef void (mulfunc_t)(BDIGIT *zds, si https://github.com/ruby/ruby/blob/trunk/bignum.c#L136
 
 static mulfunc_t bary_mul_toom3_start;
 static mulfunc_t bary_mul_karatsuba_start;
-static BDIGIT bigdivrem_single(BDIGIT *qds, const BDIGIT *xds, long xn, BDIGIT y);
+static BDIGIT bigdivrem_single(BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT y);
 static void bary_divmod(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn);
 
 static VALUE bigmul0(VALUE x, VALUE y);
@@ -2625,7 +2625,7 @@ bary_mul(BDIGIT *zds, size_t zn, const B https://github.com/ruby/ruby/blob/trunk/bignum.c#L2625
 }
 
 struct big_div_struct {
-    long xn, yn, j, ynzero;
+    size_t xn, yn, j, ynzero;
     BDIGIT *yds, *zds;
     volatile VALUE stop;
 };
@@ -2634,9 +2634,9 @@ static void * https://github.com/ruby/ruby/blob/trunk/bignum.c#L2634
 bigdivrem1(void *ptr)
 {
     struct big_div_struct *bds = (struct big_div_struct*)ptr;
-    long yn = bds->yn;
-    long j;
-    long ynzero = bds->ynzero;
+    size_t yn = bds->yn;
+    size_t j;
+    size_t ynzero = bds->ynzero;
     BDIGIT *yds = bds->yds, *zds = bds->zds;
     BDIGIT_DBL_SIGNED num;
     BDIGIT q;
@@ -2674,7 +2674,7 @@ rb_big_stop(void *ptr) https://github.com/ruby/ruby/blob/trunk/bignum.c#L2674
 }
 
 static inline int
-bigdivrem_num_extra_words(long xn, long yn)
+bigdivrem_num_extra_words(size_t xn, size_t yn)
 {
     int ret = xn==yn ? 2 : 1;
     assert(ret <= BIGDIVREM_EXTRA_WORDS);
@@ -2682,9 +2682,9 @@ bigdivrem_num_extra_words(long xn, long https://github.com/ruby/ruby/blob/trunk/bignum.c#L2682
 }
 
 static BDIGIT
-bigdivrem_single(BDIGIT *qds, const BDIGIT *xds, long xn, BDIGIT y)
+bigdivrem_single(BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT y)
 {
-    long i;
+    size_t i;
     BDIGIT_DBL t2;
     t2 = 0;
     i = xn;
@@ -2697,7 +2697,7 @@ bigdivrem_single(BDIGIT *qds, const BDIG https://github.com/ruby/ruby/blob/trunk/bignum.c#L2697
 }
 
 static void
-bigdivrem_normal(BDIGIT *zds, long zn, const BDIGIT *xds, long xn, BDIGIT *yds, long yn, int needs_mod)
+bigdivrem_normal(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, BDIGIT *yds, size_t yn, int needs_mod)
 {
     struct big_div_struct bds;
     BDIGIT q;
@@ -2783,8 +2783,8 @@ bary_divmod(BDIGIT *qds, size_t qn, BDIG https://github.com/ruby/ruby/blob/trunk/bignum.c#L2783
     }
     else {
         int extra_words;
-        long j;
-        long zn;
+        size_t j;
+        size_t zn;
         BDIGIT *zds;
         VALUE tmpz = 0;
         BDIGIT *tds;

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

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