Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Statics
  • Loading branch information
zooba committed Feb 2, 2024
commit cd6754a40677e697035b7ebde91d7f85e7873a00
6 changes: 3 additions & 3 deletions Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ _PyLong_AsByteArray(PyLongObject* v,
static inline int
_fits_in_n_bits(Py_ssize_t v, Py_ssize_t n, int require_sign_bit)
{
if (n > sizeof(Py_ssize_t) * 8) {
if (n > (Py_ssize_t)sizeof(Py_ssize_t) * 8) {
return 1;
}
// If all bits above n are the same, we fit.
Expand Down Expand Up @@ -1251,13 +1251,13 @@ PyLong_AsByteArrayWithOptions(PyObject* vv, void* buffer, size_t n, int options)
return res;
}

static int
int
PyLong_AsByteArray(PyObject* vv, void* buffer, size_t n)
{
return PyLong_AsByteArrayWithOptions(vv, buffer, n, PYLONG_ASBYTEARRAY_SIGNED);
}

static int
int
PyLong_AsUnsignedByteArray(PyObject* vv, void* buffer, size_t n)
{
return PyLong_AsByteArrayWithOptions(vv, buffer, n, PYLONG_ASBYTEARRAY_UNSIGNED);
Expand Down