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

ruby-changes:30682

From: akr <ko1@a...>
Date: Sun, 1 Sep 2013 22:38:58 +0900 (JST)
Subject: [ruby-changes:30682] akr:r42761 (trunk): * bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of

akr	2013-09-01 22:38:49 +0900 (Sun, 01 Sep 2013)

  New Revision: 42761

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

  Log:
    * bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of
      mpz_inits and mpz_clears.
      Older GMP don't have them.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42760)
+++ ChangeLog	(revision 42761)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Sep  1 22:37:51 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of
+	  mpz_inits and mpz_clears.
+	  Older GMP don't have them.
+
 Sun Sep  1 21:17:54 2013  Tanaka Akira  <akr@f...>
 
 	* test/net/http/test_http.rb (test_bind_to_local_port): Choose an open
Index: bignum.c
===================================================================
--- bignum.c	(revision 42760)
+++ bignum.c	(revision 42761)
@@ -2262,7 +2262,9 @@ bary_mul_gmp(BDIGIT *zds, size_t zn, con https://github.com/ruby/ruby/blob/trunk/bignum.c#L2262
 
     assert(xn + yn <= zn);
 
-    mpz_inits(x, y, z, 0);
+    mpz_init(x);
+    mpz_init(y);
+    mpz_init(z);
     mpz_import(x, xn, -1, sizeof(BDIGIT), 0, nails, xds);
     if (xds == yds && xn == yn) {
         mpz_mul(z, x, x);
@@ -2273,7 +2275,9 @@ bary_mul_gmp(BDIGIT *zds, size_t zn, con https://github.com/ruby/ruby/blob/trunk/bignum.c#L2275
     }
     mpz_export (zds, &count, -1, sizeof(BDIGIT), 0, nails, z);
     BDIGITS_ZERO(zds+count, zn-count);
-    mpz_clears(x, y, z, 0);
+    mpz_clear(x);
+    mpz_clear(y);
+    mpz_clear(z);
 }
 
 VALUE

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

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