diff options
Diffstat (limited to 'mpq/set_num.c')
-rw-r--r-- | mpq/set_num.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mpq/set_num.c b/mpq/set_num.c index 1f011fdc6..4643a7213 100644 --- a/mpq/set_num.c +++ b/mpq/set_num.c @@ -1,6 +1,6 @@ /* mpq_set_num(dest,num) -- Set the numerator of DEST from NUM. -Copyright 1991, 1994, 1995, 2001 Free Software Foundation, Inc. +Copyright 1991, 1994, 1995, 2001, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -21,13 +21,14 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include "gmp-impl.h" void -mpq_set_num (MP_RAT *dest, const MP_INT *num) +mpq_set_num (mpq_ptr dest, mpz_srcptr num) { mp_size_t size = SIZ (num); mp_size_t abs_size = ABS (size); + mp_ptr dp; - MPZ_REALLOC (NUM(dest), abs_size); + dp = MPZ_REALLOC (NUM(dest), abs_size); - MPN_COPY (PTR(NUM(dest)), PTR(num), abs_size); SIZ(NUM(dest)) = size; + MPN_COPY (dp, PTR(num), abs_size); } |