Skip to content
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions Include/cpython/longintrepr.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ _PyLong_IsCompact(const PyLongObject* op) {
}

static inline int
PyLong_CheckCompact(const PyObject *op)
PyLong_CheckCompact(PyObject *op)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use PyObject * here because PyLong_CheckExact casts to PyObject * which discards the const qualifier.

{
return PyLong_CheckExact(op) && _PyLong_IsCompact((PyLongObject *)op);
return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op);
}

#define PyUnstable_Long_IsCompact _PyLong_IsCompact
Expand Down
Loading