1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bignum.c (bary_mul_gmp): Use mpz_init and mpz_clear instead of

mpz_inits and mpz_clears.
  Older GMP don't have them.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-09-01 13:38:49 +00:00
parent 28130c1c63
commit 4dd7a13a0a
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Sun Sep 1 22:37:51 2013 Tanaka Akira <akr@fsij.org>
* 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@fsij.org>
* test/net/http/test_http.rb (test_bind_to_local_port): Choose an open

View file

@ -2262,7 +2262,9 @@ bary_mul_gmp(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT
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, const BDIGIT *xds, size_t xn, const BDIGIT
}
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