mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)
Remove the const qualifier of the argument of functions: * _PyLong_IsCompact() * _PyLong_CompactValue() Py_TYPE() argument is not const. Fix the compiler warning: Include/cpython/longintrepr.h: In function ‘_PyLong_CompactValue’: Include/pyport.h:19:31: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual] (...) Include/cpython/longintrepr.h:133:30: note: in expansion of macro ‘Py_TYPE’ assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS));
This commit is contained in:
parent
9cd2dcbb87
commit
e51e880e75
3 changed files with 6 additions and 6 deletions
|
@ -240,7 +240,7 @@ static inline int
|
|||
_PyLong_CompactSign(const PyLongObject *op)
|
||||
{
|
||||
assert(PyLong_Check(op));
|
||||
assert(_PyLong_IsCompact(op));
|
||||
assert(_PyLong_IsCompact((PyLongObject *)op));
|
||||
return 1 - (op->long_value.lv_tag & SIGN_MASK);
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ static inline int
|
|||
_PyLong_NonCompactSign(const PyLongObject *op)
|
||||
{
|
||||
assert(PyLong_Check(op));
|
||||
assert(!_PyLong_IsCompact(op));
|
||||
assert(!_PyLong_IsCompact((PyLongObject *)op));
|
||||
return 1 - (op->long_value.lv_tag & SIGN_MASK);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue