| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@erlend-aasland: Ok, here is a shorter PR. I left the PyUnicode_KIND() macro unchanged since converting it to a static inline function introduces new compiler warning if the return type is int, but also if the return type is unsigned int! The compiler doesn't emit warnings on the macro, only with a static inline function. |
Sorry, something went wrong.
Convert unicodeobject.h macros to static inline functions: * PyUnicode_CHECK_INTERNED() * PyUnicode_DATA(), _PyUnicode_COMPACT_DATA(), _PyUnicode_NONCOMPACT_DATA() * PyUnicode_GET_LENGTH() * PyUnicode_IS_ASCII() * PyUnicode_IS_COMPACT() * PyUnicode_IS_COMPACT_ASCII() * PyUnicode_IS_READY() Reorder functions to declare functions before their first usage. Static inline functions are wrapped into macros which casts "PyObject*" with _PyObject_CAST() to prevent introducing new compiler warnings when passing "const PyObject*".
There was a problem hiding this comment.
Looks good! I left some small nitpick comments.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Convert unicodeobject.h macros to static inline functions:
_PyUnicode_NONCOMPACT_DATA()
Reorder functions to declare functions before their first usage.
Static inline functions are wrapped into macros which casts
"PyObject*" with _PyObject_CAST() to prevent introducing new compiler
warnings when passing "const PyObject*".