PyAPI: replace PyC_FromArray with typed functions
This was meant to be generic but introduced possible type errors and unnecessary complication. Replace with typed PyC_Tuple_PackArray_* functions. Also add PyC_Tuple_Pack_* macro which replaces some uses of Py_BuildValue, with the advantage of not having to parse a string.
This commit is contained in:
@@ -157,8 +157,7 @@ static PyObject *make_app_info(void)
|
||||
#define SetObjItem(obj) \
|
||||
PyStructSequence_SET_ITEM(app_info, pos++, obj)
|
||||
|
||||
SetObjItem(Py_BuildValue("(iii)",
|
||||
BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
|
||||
SetObjItem(PyC_Tuple_Pack_I32(BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
|
||||
SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)",
|
||||
BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user