mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
PyUnicode_AsWideCharString() takes a PyObject*, not a PyUnicodeObject*
All unicode functions uses PyObject* except PyUnicode_AsWideChar(). Fix the prototype for the new function PyUnicode_AsWideCharString().
This commit is contained in:
parent
ef12810f0c
commit
beb4135b8c
9 changed files with 14 additions and 14 deletions
|
@ -1275,7 +1275,7 @@ PyUnicode_AsWideChar(PyUnicodeObject *unicode,
|
|||
}
|
||||
|
||||
wchar_t*
|
||||
PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
|
||||
PyUnicode_AsWideCharString(PyObject *unicode,
|
||||
Py_ssize_t *size)
|
||||
{
|
||||
wchar_t* buffer;
|
||||
|
@ -1286,7 +1286,7 @@ PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
buflen = unicode_aswidechar(unicode, NULL, 0);
|
||||
buflen = unicode_aswidechar((PyUnicodeObject *)unicode, NULL, 0);
|
||||
if (PY_SSIZE_T_MAX / sizeof(wchar_t) < buflen) {
|
||||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
|
@ -1297,7 +1297,7 @@ PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
|
|||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
buflen = unicode_aswidechar(unicode, buffer, buflen);
|
||||
buflen = unicode_aswidechar((PyUnicodeObject *)unicode, buffer, buflen);
|
||||
if (size != NULL)
|
||||
*size = buflen;
|
||||
return buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue