Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")

This shows the text as part of the assertion message.
This commit is contained in:
2021-07-15 18:23:28 +10:00
parent a63a0ee24b
commit 8e8a6b80cf
133 changed files with 217 additions and 209 deletions

View File

@@ -225,7 +225,7 @@ PyObject *BPY_app_handlers_struct(void)
#endif
if (PyType_Ready(&BPyPersistent_Type) < 0) {
BLI_assert(!"error initializing 'bpy.app.handlers.persistent'");
BLI_assert_msg(0, "error initializing 'bpy.app.handlers.persistent'");
}
PyStructSequence_InitType(&BlenderAppCbType, &app_cb_info_desc);

View File

@@ -2728,7 +2728,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self,
break;
}
default:
BLI_assert(!"Invalid array type");
BLI_assert_msg(0, "Invalid array type");
PyErr_SetString(PyExc_TypeError, "not an array type");
Py_DECREF(tuple);
@@ -4375,7 +4375,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
}
default:
/* Should never happen. */
BLI_assert(!"Invalid context type");
BLI_assert_msg(0, "Invalid context type");
PyErr_Format(PyExc_AttributeError,
"bpy_struct: Context type invalid %d, can't get \"%.200s\" from context",
@@ -5389,7 +5389,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
break;
case PROP_RAW_UNSET:
/* Should never happen. */
BLI_assert(!"Invalid array type - set");
BLI_assert_msg(0, "Invalid array type - set");
break;
}
@@ -5453,7 +5453,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
break;
default: /* PROP_RAW_UNSET */
/* Should never happen. */
BLI_assert(!"Invalid array type - get");
BLI_assert_msg(0, "Invalid array type - get");
item = Py_None;
Py_INCREF(item);
break;

View File

@@ -570,7 +570,7 @@ static PyObject *Color_mul(PyObject *v1, PyObject *v2)
}
}
else {
BLI_assert(!"internal error");
BLI_assert_msg(0, "internal error");
}
PyErr_Format(PyExc_TypeError,