]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)
authorVictor Stinner <vstinner@python.org>
Wed, 26 Jun 2024 18:11:21 +0000 (20:11 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Jun 2024 18:11:21 +0000 (20:11 +0200)
commite51e880e75d79687b54a71351266e29ee349b4b8
tree6fe7cc7fbbd9060f0f01bf83aab0b041834aab51
parent9cd2dcbb87fb3c35d8ca3554d9472ac283f62a64
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));
Include/cpython/longintrepr.h
Include/internal/pycore_long.h
Objects/longobject.c