summaryrefslogtreecommitdiff
path: root/mpz/combit.c
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2012-05-26 15:57:43 +0200
committerTorbjorn Granlund <tege@gmplib.org>2012-05-26 15:57:43 +0200
commiteb3632bb2177f6ea7d2f41c9722458c10159c013 (patch)
tree624a47bf95ce22460938a693f797937f5d6003cb /mpz/combit.c
parent27ac5bf5c349d49c7103674b4a366afb6ad51cca (diff)
downloadgmp-eb3632bb2177f6ea7d2f41c9722458c10159c013.tar.gz
Use MPZ_REALLOC return value when possible.
Diffstat (limited to 'mpz/combit.c')
-rw-r--r--mpz/combit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mpz/combit.c b/mpz/combit.c
index 8a0ce3a93..a912941a0 100644
--- a/mpz/combit.c
+++ b/mpz/combit.c
@@ -1,6 +1,6 @@
/* mpz_combit -- complement a specified bit.
-Copyright 2002, 2003 Free Software Foundation, Inc.
+Copyright 2002, 2003, 2012 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -31,8 +31,7 @@ mpz_combit (mpz_ptr d, mp_bitcnt_t bit_index)
if (limb_index >= dsize)
{
- MPZ_REALLOC(d, limb_index + 1);
- dp = LIMBS(d);
+ dp = MPZ_REALLOC(d, limb_index + 1);
MPN_ZERO(dp + dsize, limb_index + 1 - dsize);
dsize = limb_index + 1;
@@ -62,8 +61,7 @@ mpz_combit (mpz_ptr d, mp_bitcnt_t bit_index)
mp_limb_t c;
/* Clearing the bit increases the magitude. We might need a carry. */
- MPZ_REALLOC(d, dsize + 1);
- dp = LIMBS(d);
+ dp = MPZ_REALLOC(d, dsize + 1);
__GMPN_ADD_1 (c, dp+limb_index, dp+limb_index,
dsize - limb_index, bit);