diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-29 22:12:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-29 23:14:28 +0300 |
commit | 25ec4b437fe927205a810470cdc23efd7282c85b (patch) | |
tree | 6d7ba2fe73703915b4b94d3f2dab03fb731e9544 /source/blender/python/mathutils/mathutils.c | |
parent | 18d06e8d21ed8c9a19df4205abcd7ed17eb9af00 (diff) |
Cleanup: style, use braces for the Python API
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); |