Cleanup: use const variables where possible in the Python API

This commit is contained in:
2020-08-20 16:10:13 +10:00
parent 8877e3aa62
commit efa7aaa97f
35 changed files with 134 additions and 132 deletions

View File

@@ -228,7 +228,7 @@ static void bpy_pydriver_namespace_clear_self(void)
void BPY_driver_reset(void)
{
PyGILState_STATE gilstate;
bool use_gil = true; /* !PyC_IsInterpreterActive(); */
const bool use_gil = true; /* !PyC_IsInterpreterActive(); */
if (use_gil) {
gilstate = PyGILState_Ensure();
@@ -594,7 +594,7 @@ float BPY_driver_exec(struct PathResolvedRNA *anim_rna,
#endif
{
/* try to get variable value */
float tval = driver_get_variable_value(driver, dvar);
const float tval = driver_get_variable_value(driver, dvar);
driver_arg = PyFloat_FromDouble((double)tval);
}