mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix compilation error on Windows
Fix also a compiler warning.
This commit is contained in:
parent
d2a915dbf6
commit
2fd82278cb
1 changed files with 3 additions and 2 deletions
|
@ -509,9 +509,10 @@ resize_copy(PyObject *unicode, Py_ssize_t length)
|
||||||
}
|
}
|
||||||
return copy;
|
return copy;
|
||||||
} else {
|
} else {
|
||||||
|
PyUnicodeObject *w;
|
||||||
assert(_PyUnicode_WSTR(unicode) != NULL);
|
assert(_PyUnicode_WSTR(unicode) != NULL);
|
||||||
assert(_PyUnicode_DATA_ANY(unicode) == NULL);
|
assert(_PyUnicode_DATA_ANY(unicode) == NULL);
|
||||||
PyUnicodeObject *w = _PyUnicode_New(length);
|
w = _PyUnicode_New(length);
|
||||||
if (w == NULL)
|
if (w == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
copy_length = _PyUnicode_WSTR_LENGTH(unicode);
|
copy_length = _PyUnicode_WSTR_LENGTH(unicode);
|
||||||
|
@ -6521,7 +6522,7 @@ decode_mbcs(PyUnicodeObject **v,
|
||||||
else {
|
else {
|
||||||
/* Extend unicode object */
|
/* Extend unicode object */
|
||||||
n = PyUnicode_GET_SIZE(*v);
|
n = PyUnicode_GET_SIZE(*v);
|
||||||
if (PyUnicode_Resize(v, n + usize) < 0)
|
if (PyUnicode_Resize((PyObject**)v, n + usize) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue