mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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
|
|
@ -666,7 +666,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
|
|||
return 0;
|
||||
#else
|
||||
pa->ffi_type = &ffi_type_pointer;
|
||||
pa->value.p = PyUnicode_AsWideCharString((PyUnicodeObject *)obj, NULL);
|
||||
pa->value.p = PyUnicode_AsWideCharString(obj, NULL);
|
||||
if (pa->value.p == NULL)
|
||||
return -1;
|
||||
pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
|
||||
|
|
|
|||
|
|
@ -1434,7 +1434,7 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size)
|
|||
PyObject *keep;
|
||||
wchar_t *buffer;
|
||||
|
||||
buffer = PyUnicode_AsWideCharString((PyUnicodeObject *)value, NULL);
|
||||
buffer = PyUnicode_AsWideCharString(value, NULL);
|
||||
if (!buffer) {
|
||||
Py_DECREF(value);
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -246,10 +246,10 @@ PyLocale_strcoll(PyObject* self, PyObject* args)
|
|||
if (!PyArg_ParseTuple(args, "UU:strcoll", &os1, &os2))
|
||||
return NULL;
|
||||
/* Convert the unicode strings to wchar[]. */
|
||||
ws1 = PyUnicode_AsWideCharString((PyUnicodeObject*)os1, NULL);
|
||||
ws1 = PyUnicode_AsWideCharString(os1, NULL);
|
||||
if (ws1 == NULL)
|
||||
goto done;
|
||||
ws2 = PyUnicode_AsWideCharString((PyUnicodeObject*)os2, NULL);
|
||||
ws2 = PyUnicode_AsWideCharString(os2, NULL);
|
||||
if (ws2 == NULL)
|
||||
goto done;
|
||||
/* Collate the strings. */
|
||||
|
|
|
|||
|
|
@ -1426,7 +1426,7 @@ unicode_aswidecharstring(PyObject *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "U", &unicode))
|
||||
return NULL;
|
||||
|
||||
buffer = PyUnicode_AsWideCharString((PyUnicodeObject*)unicode, &size);
|
||||
buffer = PyUnicode_AsWideCharString(unicode, &size);
|
||||
if (buffer == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ time_strftime(PyObject *self, PyObject *args)
|
|||
buf.tm_isdst = 1;
|
||||
|
||||
#ifdef HAVE_WCSFTIME
|
||||
format = PyUnicode_AsWideCharString((PyUnicodeObject*)format_arg, NULL);
|
||||
format = PyUnicode_AsWideCharString(format_arg, NULL);
|
||||
if (format == NULL)
|
||||
return NULL;
|
||||
fmt = format;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue