From 982aea88e0d74020c62c2054a45eeafa56c8ca30 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Apr 2022 09:41:28 +1000 Subject: Cleanup: separate format-units for Python argument parsing With the increased use of multi-character format units and keyword-only arguments these are increasingly difficult to make sense of. Split the string onto multiple lines, one per argument. While verbose it's easier to understand and add new arguments. --- source/blender/python/intern/bpy_gizmo_wrap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/python/intern/bpy_gizmo_wrap.c') diff --git a/source/blender/python/intern/bpy_gizmo_wrap.c b/source/blender/python/intern/bpy_gizmo_wrap.c index 88cddac659f..ad235e691c4 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.c +++ b/source/blender/python/intern/bpy_gizmo_wrap.c @@ -51,7 +51,15 @@ static bool bpy_gizmotype_target_property_def(wmGizmoType *gzt, PyObject *item) }; static const char *const _keywords[] = {"id", "type", "array_length", NULL}; - static _PyArg_Parser _parser = {"|$sO&i:register_class", _keywords, 0}; + static _PyArg_Parser _parser = { + "|$" /* Optional keyword only arguments. */ + "s" /* `id` */ + "O&" /* `type` */ + "i" /* `array_length` */ + ":register_class", + _keywords, + 0, + }; if (!_PyArg_ParseTupleAndKeywordsFast(empty_tuple, item, &_parser, -- cgit v1.2.3