From c9e35c2ced92082c86f1ecb9ecd16c6230218c7c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Sep 2022 15:14:13 +1000 Subject: Cleanup: remove redundant double parenthesis --- source/blender/blenlib/intern/BLI_kdopbvh.c | 4 ++-- source/blender/blenlib/intern/math_color.c | 6 +++--- source/blender/blenlib/intern/math_geom.c | 4 ++-- source/blender/blenlib/intern/math_rotation.c | 4 ++-- source/blender/blenlib/intern/task_iterator.c | 4 ++-- source/blender/blenlib/tests/BLI_array_store_test.cc | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index a43b725b6e3..71c48ed994b 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -386,12 +386,12 @@ static void refit_kdop_hull(const BVHTree *tree, BVHNode *node, int start, int e /* for all Axes. */ for (axis_iter = tree->start_axis; axis_iter < tree->stop_axis; axis_iter++) { newmin = node_bv[(2 * axis_iter)]; - if ((newmin < bv[(2 * axis_iter)])) { + if (newmin < bv[(2 * axis_iter)]) { bv[(2 * axis_iter)] = newmin; } newmax = node_bv[(2 * axis_iter) + 1]; - if ((newmax > bv[(2 * axis_iter) + 1])) { + if (newmax > bv[(2 * axis_iter) + 1]) { bv[(2 * axis_iter) + 1] = newmax; } } diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index bdcf52ec521..9058ef43604 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -368,9 +368,9 @@ unsigned int rgb_to_cpack(float r, float g, float b) void cpack_to_rgb(unsigned int col, float *r_r, float *r_g, float *r_b) { - *r_r = ((float)(((col)) & 0xFF)) * (1.0f / 255.0f); - *r_g = ((float)(((col) >> 8) & 0xFF)) * (1.0f / 255.0f); - *r_b = ((float)(((col) >> 16) & 0xFF)) * (1.0f / 255.0f); + *r_r = ((float)(col & 0xFF)) * (1.0f / 255.0f); + *r_g = ((float)((col >> 8) & 0xFF)) * (1.0f / 255.0f); + *r_b = ((float)((col >> 16) & 0xFF)) * (1.0f / 255.0f); } void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3]) diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 773aac95193..03f9b6441be 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -527,7 +527,7 @@ float dist_signed_squared_to_corner_v3v3v3(const float p[3], cross_v3_v3v3(axis, dir_a, dir_b); - if ((len_squared_v3(axis) < FLT_EPSILON)) { + if (len_squared_v3(axis) < FLT_EPSILON) { copy_v3_v3(axis, axis_ref); } else if (dot_v3v3(axis, axis_ref) < 0.0f) { @@ -2208,7 +2208,7 @@ bool isect_planes_v3_fn( int i_test; for (i_test = 0; i_test < planes_len; i_test++) { const float *np_test = planes[i_test]; - if (((dot_v3v3(np_test, co_test) + np_test[3]) > eps_isect)) { + if ((dot_v3v3(np_test, co_test) + np_test[3]) > eps_isect) { /* For low epsilon values the point could intersect its own plane. */ if (!ELEM(i_test, i, j, k)) { break; diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index ae068e3fb19..3f072c153ad 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -2178,8 +2178,8 @@ void quat_apply_track(float quat[4], short axis, short upflag) * up axis is used X->Y, Y->X, Z->X, if this first up axis isn't used then rotate 90d * the strange bit shift below just find the low axis {X:Y, Y:X, Z:X} */ if (upflag != (2 - axis) >> 1) { - float q[4] = {sqrt_1_2, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */ - q[axis + 1] = ((axis == 1)) ? sqrt_1_2 : -sqrt_1_2; /* flip non Y axis */ + float q[4] = {sqrt_1_2, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */ + q[axis + 1] = (axis == 1) ? sqrt_1_2 : -sqrt_1_2; /* flip non Y axis */ mul_qt_qtqt(quat, quat, q); } } diff --git a/source/blender/blenlib/intern/task_iterator.c b/source/blender/blenlib/intern/task_iterator.c index d5afbb2b117..99e966de975 100644 --- a/source/blender/blenlib/intern/task_iterator.c +++ b/source/blender/blenlib/intern/task_iterator.c @@ -26,10 +26,10 @@ * \{ */ /* Allows to avoid using malloc for userdata_chunk in tasks, when small enough. */ -#define MALLOCA(_size) ((_size) <= 8192) ? alloca((_size)) : MEM_mallocN((_size), __func__) +#define MALLOCA(_size) ((_size) <= 8192) ? alloca(_size) : MEM_mallocN((_size), __func__) #define MALLOCA_FREE(_mem, _size) \ if (((_mem) != NULL) && ((_size) > 8192)) { \ - MEM_freeN((_mem)); \ + MEM_freeN(_mem); \ } \ ((void)0) diff --git a/source/blender/blenlib/tests/BLI_array_store_test.cc b/source/blender/blenlib/tests/BLI_array_store_test.cc index 5d05e3be1f3..8e95557466e 100644 --- a/source/blender/blenlib/tests/BLI_array_store_test.cc +++ b/source/blender/blenlib/tests/BLI_array_store_test.cc @@ -607,7 +607,7 @@ static void testbuffer_list_state_random_data(ListBase *lb, MUTATE_TOTAL, }; - switch ((BLI_rng_get_uint(rng) % MUTATE_TOTAL)) { + switch (BLI_rng_get_uint(rng) % MUTATE_TOTAL) { case MUTATE_NOP: { break; } -- cgit v1.2.3