mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
Fix unused variable and signed/unsigned warnings (GH-15537) (GH-15551)
(cherry picked from commit 0138c4ceab
)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
parent
91020fade6
commit
d5ba8bbdae
3 changed files with 9 additions and 3 deletions
|
@ -456,10 +456,14 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content)
|
|||
}
|
||||
else {
|
||||
PyCompactUnicodeObject *compact = (PyCompactUnicodeObject *)op;
|
||||
#ifndef NDEBUG
|
||||
void *data;
|
||||
#endif
|
||||
|
||||
if (ascii->state.compact == 1) {
|
||||
#ifndef NDEBUG
|
||||
data = compact + 1;
|
||||
#endif
|
||||
_PyObject_ASSERT(op, kind == PyUnicode_1BYTE_KIND
|
||||
|| kind == PyUnicode_2BYTE_KIND
|
||||
|| kind == PyUnicode_4BYTE_KIND);
|
||||
|
@ -468,9 +472,11 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content)
|
|||
_PyObject_ASSERT(op, compact->utf8 != data);
|
||||
}
|
||||
else {
|
||||
#ifndef NDEBUG
|
||||
PyUnicodeObject *unicode = (PyUnicodeObject *)op;
|
||||
|
||||
data = unicode->data.any;
|
||||
#endif
|
||||
if (kind == PyUnicode_WCHAR_KIND) {
|
||||
_PyObject_ASSERT(op, ascii->length == 0);
|
||||
_PyObject_ASSERT(op, ascii->hash == -1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue