diff options
author | Stefan Krah <skrah@bytereef.org> | 2013-12-12 17:51:51 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2013-12-12 17:51:51 (GMT) |
commit | da12adac10761439a8a3828958e970db98d7ebc8 (patch) | |
tree | b1fd7cb2a0a8712f03d8828d134e1fe6159f3d4e | |
parent | 0f533acf884f01987bfde9f0cf6dc17c4b9a2f61 (diff) | |
download | cpython-da12adac10761439a8a3828958e970db98d7ebc8.zip cpython-da12adac10761439a8a3828958e970db98d7ebc8.tar.gz cpython-da12adac10761439a8a3828958e970db98d7ebc8.tar.bz2 |
Do not discard const qualifier without a reason.
-rw-r--r-- | Modules/_decimal/libmpdec/mpdecimal.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index d096e96..05fd04d 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -3202,9 +3202,9 @@ mpd_qabs(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, } static inline void -_mpd_ptrswap(mpd_t **a, mpd_t **b) +_mpd_ptrswap(const mpd_t **a, const mpd_t **b) { - mpd_t *t = *a; + const mpd_t *t = *a; *a = *b; *b = t; } @@ -3232,7 +3232,7 @@ static void _mpd_qaddsub(mpd_t *result, const mpd_t *a, const mpd_t *b, uint8_t sign_b, const mpd_context_t *ctx, uint32_t *status) { - mpd_t *big, *small; + const mpd_t *big, *small; MPD_NEW_STATIC(big_aligned,0,0,0,0); MPD_NEW_CONST(tiny,0,0,1,1,1,1); mpd_uint_t carry; @@ -3242,7 +3242,7 @@ _mpd_qaddsub(mpd_t *result, const mpd_t *a, const mpd_t *b, uint8_t sign_b, /* compare exponents */ - big = (mpd_t *)a; small = (mpd_t *)b; + big = a; small = b; if (big->exp != small->exp) { if (small->exp > big->exp) { _mpd_ptrswap(&big, &small); @@ -4421,7 +4421,7 @@ mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, const mpd_context_t *ctx, uint32_t *status) { uint32_t workstatus = 0; - mpd_t *cc = (mpd_t *)c; + const mpd_t *cc = c; if (result == c) { if ((cc = mpd_qncopy(c)) == NULL) { @@ -4435,7 +4435,7 @@ mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, mpd_qadd(result, result, cc, ctx, &workstatus); } - if (cc != c) mpd_del(cc); + if (cc != c) mpd_del((mpd_t *)cc); *status |= workstatus; } @@ -5727,7 +5727,7 @@ static inline void _mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status) { - mpd_t *big = (mpd_t *)a, *small = (mpd_t *)b; + const mpd_t *big = a, *small = b; mpd_uint_t *rdata = NULL; mpd_uint_t rbuf[MPD_MINALLOC_MAX]; mpd_size_t rsize, i; |