mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-35059: Cast void* to PyObject* (GH-10650)
Don't pass void* to Python macros: use _PyObject_CAST().
This commit is contained in:
parent
b37672daf6
commit
a42de742e7
4 changed files with 17 additions and 11 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue