summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-22 10:25:22 +0100
committerGitHub <noreply@github.com>2018-11-22 10:25:22 +0100
commita42de742e7c20eeb64699b5785543fea65b2e8d3 (patch)
tree1cb5a0b7e6d6e12846b51dbb51a080a781209ec4 /Objects/unicodeobject.c
parentb37672daf61740fe1ff9d805f6d74bc5ef04012b (diff)
downloadcpython-git-a42de742e7c20eeb64699b5785543fea65b2e8d3.tar.gz
bpo-35059: Cast void* to PyObject* (GH-10650)
Don't pass void* to Python macros: use _PyObject_CAST().
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index d22b277a51..01049f54e8 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1171,14 +1171,17 @@ unicode_kind_name(PyObject *unicode)
#ifdef Py_DEBUG
/* Functions wrapping macros for use in debugger */
-char *_PyUnicode_utf8(void *unicode){
+char *_PyUnicode_utf8(void *unicode_raw){
+ PyObject *unicode = _PyObject_CAST(unicode_raw);
return PyUnicode_UTF8(unicode);
}
-void *_PyUnicode_compact_data(void *unicode) {
+void *_PyUnicode_compact_data(void *unicode_raw) {
+ PyObject *unicode = _PyObject_CAST(unicode_raw);
return _PyUnicode_COMPACT_DATA(unicode);
}
-void *_PyUnicode_data(void *unicode){
+void *_PyUnicode_data(void *unicode_raw) {
+ PyObject *unicode = _PyObject_CAST(unicode_raw);
printf("obj %p\n", unicode);
printf("compact %d\n", PyUnicode_IS_COMPACT(unicode));
printf("compact ascii %d\n", PyUnicode_IS_COMPACT_ASCII(unicode));