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().
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index ce2acb5..737e4c3 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -666,7 +666,7 @@
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);
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 072b8c6..ab293f7 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -1434,7 +1434,7 @@
PyObject *keep;
wchar_t *buffer;
- buffer = PyUnicode_AsWideCharString((PyUnicodeObject *)value, NULL);
+ buffer = PyUnicode_AsWideCharString(value, NULL);
if (!buffer) {
Py_DECREF(value);
return NULL;
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 67d16f4..1001dd2 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -246,10 +246,10 @@
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. */
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 912ba17..473d805 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1426,7 +1426,7 @@
if (!PyArg_ParseTuple(args, "U", &unicode))
return NULL;
- buffer = PyUnicode_AsWideCharString((PyUnicodeObject*)unicode, &size);
+ buffer = PyUnicode_AsWideCharString(unicode, &size);
if (buffer == NULL)
return NULL;
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 1a85662..5e6cd6c 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -502,7 +502,7 @@
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;