diff options
author | Mark Shannon <mark@hotpy.org> | 2023-01-30 10:03:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 10:03:04 (GMT) |
commit | c1b1f51cd1632f0b77dacd43092fb44ed5e053a9 (patch) | |
tree | da815b0f6e2daddbb013ce2383837c61b3675201 /Modules/_decimal | |
parent | f5a3d91b6c56ddff4644b5a5ac34d8c6d23d7c79 (diff) | |
download | cpython-c1b1f51cd1632f0b77dacd43092fb44ed5e053a9.zip cpython-c1b1f51cd1632f0b77dacd43092fb44ed5e053a9.tar.gz cpython-c1b1f51cd1632f0b77dacd43092fb44ed5e053a9.tar.bz2 |
GH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue struct. (GH-101292)
Diffstat (limited to 'Modules/_decimal')
-rw-r--r-- | Modules/_decimal/_decimal.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index bc97615..5936fba 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -2171,16 +2171,16 @@ dec_from_long(PyTypeObject *type, PyObject *v, } if (len == 1) { - _dec_settriple(dec, sign, *l->ob_digit, 0); + _dec_settriple(dec, sign, *l->long_value.ob_digit, 0); mpd_qfinalize(MPD(dec), ctx, status); return dec; } #if PYLONG_BITS_IN_DIGIT == 30 - mpd_qimport_u32(MPD(dec), l->ob_digit, len, sign, PyLong_BASE, + mpd_qimport_u32(MPD(dec), l->long_value.ob_digit, len, sign, PyLong_BASE, ctx, status); #elif PYLONG_BITS_IN_DIGIT == 15 - mpd_qimport_u16(MPD(dec), l->ob_digit, len, sign, PyLong_BASE, + mpd_qimport_u16(MPD(dec), l->long_value.ob_digit, len, sign, PyLong_BASE, ctx, status); #else #error "PYLONG_BITS_IN_DIGIT should be 15 or 30" @@ -3543,11 +3543,11 @@ dec_as_long(PyObject *dec, PyObject *context, int round) return NULL; } - memcpy(pylong->ob_digit, ob_digit, n * sizeof(digit)); + memcpy(pylong->long_value.ob_digit, ob_digit, n * sizeof(digit)); mpd_free(ob_digit); i = n; - while ((i > 0) && (pylong->ob_digit[i-1] == 0)) { + while ((i > 0) && (pylong->long_value.ob_digit[i-1] == 0)) { i--; } |