diff options
Diffstat (limited to 'source/blender/python/mathutils/mathutils.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index f577ef3b441..41738ced41a 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -105,15 +105,17 @@ Py_hash_t mathutils_array_hash(const float *array, size_t array_len) i = 0; while (--len >= 0) { y = _Py_HashDouble((double)(array[i++])); - if (y == -1) + if (y == -1) { return -1; + } x = (x ^ y) * mult; /* the cast might truncate len; that doesn't change hash stability */ mult += (Py_hash_t)(82520UL + len + len); } x += 97531UL; - if (x == (Py_uhash_t)-1) + if (x == (Py_uhash_t)-1) { x = -2; + } return x; } @@ -392,8 +394,9 @@ int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int flo { int x; for (x = 0; x < size; x++) { - if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) + if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) { return 0; + } } return 1; } @@ -425,8 +428,10 @@ unsigned char Mathutils_RegisterCallback(Mathutils_Callback *cb) /* find the first free slot */ for (i = 0; mathutils_callbacks[i]; i++) { - if (mathutils_callbacks[i] == cb) /* already registered? */ + if (mathutils_callbacks[i] == cb) { + /* already registered? */ return i; + } } BLI_assert(i + 1 < MATHUTILS_TOT_CB); @@ -611,18 +616,24 @@ PyMODINIT_FUNC PyInit_mathutils(void) PyObject *submodule; PyObject *sys_modules = PyImport_GetModuleDict(); - if (PyType_Ready(&vector_Type) < 0) + if (PyType_Ready(&vector_Type) < 0) { return NULL; - if (PyType_Ready(&matrix_Type) < 0) + } + if (PyType_Ready(&matrix_Type) < 0) { return NULL; - if (PyType_Ready(&matrix_access_Type) < 0) + } + if (PyType_Ready(&matrix_access_Type) < 0) { return NULL; - if (PyType_Ready(&euler_Type) < 0) + } + if (PyType_Ready(&euler_Type) < 0) { return NULL; - if (PyType_Ready(&quaternion_Type) < 0) + } + if (PyType_Ready(&quaternion_Type) < 0) { return NULL; - if (PyType_Ready(&color_Type) < 0) + } + if (PyType_Ready(&color_Type) < 0) { return NULL; + } mod = PyModule_Create(&M_Mathutils_module_def); |