diff options
Diffstat (limited to 'Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c')
-rw-r--r-- | Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c b/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c index 78cd1034473..48ce1072ba2 100644 --- a/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c +++ b/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c @@ -32,7 +32,7 @@ see https://www.gnu.org/licenses/. */ /* NOTE: All functions in this file which are not declared in mini-gmp.h are internal, and are not intended to be compatible - neither with GMP nor with future versions of mini-gmp. */ + with GMP or with future versions of mini-gmp. */ /* Much of the material copied from GMP files, including: gmp-impl.h, longlong.h, mpn/generic/add_n.c, mpn/generic/addmul_1.c, @@ -790,7 +790,7 @@ mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0) qh' = floor( (b^3 - 1) / u) - b = floor ((b^3 - b u - 1) / u = floor( (b (~u) + b-1) / u), - + and the remainder r = b (~u) + b-1 - qh (b uh + ul) @@ -3418,7 +3418,7 @@ gmp_lucas_mod (mpz_t V, mpz_t Qk, long Q, gmp_lucas_step_k_2k (V, Qk, n); /* A step k->k+1 is performed if the bit in $n$ is 1 */ - /* mpz_tstbit(n,bs) or the the bit is 0 in $n$ but */ + /* mpz_tstbit(n,bs) or the bit is 0 in $n$ but */ /* should be 1 in $n+1$ (bs == b0) */ if (b0 == bs || mpz_tstbit (n, bs)) { @@ -4381,6 +4381,8 @@ mpz_out_str (FILE *stream, int base, const mpz_t x) size_t len; str = mpz_get_str (NULL, base, x); + if (!str) + return 0; len = strlen (str); len = fwrite (str, 1, len, stream); gmp_free (str); @@ -4488,7 +4490,7 @@ mpz_export (void *r, size_t *countp, int order, size_t size, int endian, ptrdiff_t word_step; /* The current (partial) limb. */ mp_limb_t limb; - /* The number of bytes left to to in this limb. */ + /* The number of bytes left to do in this limb. */ size_t bytes; /* The index where the limb was read. */ mp_size_t i; |