[Bf-blender-cvs] [34477bbfcde] master: Cleanup: remove redundant parenthesis

Campbell Barton noreply at git.blender.org
Mon Sep 26 06:25:34 CEST 2022


Commit: 34477bbfcde34d0b27f04eccdddd0a093d8be1c0
Author: Campbell Barton
Date:   Mon Sep 26 14:23:52 2022 +1000
Branches: master
https://developer.blender.org/rB34477bbfcde34d0b27f04eccdddd0a093d8be1c0

Cleanup: remove redundant parenthesis

===================================================================

M	intern/ghost/intern/GHOST_SystemWayland.cpp
M	intern/ghost/intern/GHOST_SystemX11.cpp
M	source/blender/blenkernel/intern/kelvinlet.c
M	source/blender/blenlib/intern/array_store.c
M	source/blender/bmesh/intern/bmesh_polygon_edgenet.c
M	source/blender/bmesh/tools/bmesh_bevel.c
M	source/blender/bmesh/tools/bmesh_decimate_dissolve.c
M	source/blender/bmesh/tools/bmesh_intersect.c
M	source/blender/bmesh/tools/bmesh_path_region.c
M	source/blender/editors/animation/anim_filter.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_primitive.c
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/editors/space_file/filelist.cc
M	source/blender/editors/space_outliner/outliner_tree.cc
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/space_view3d/view3d_gizmo_ruler.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_convert_object.c
M	source/blender/editors/transform/transform_snap_object.cc
M	source/blender/geometry/intern/uv_parametrizer.cc
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/io/collada/ArmatureImporter.cpp
M	source/blender/python/intern/bpy_rna.c
M	source/blender/render/intern/pipeline.cc
M	source/blender/sequencer/intern/image_cache.c

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 4082cab4ccd..48401abd6b6 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -3141,7 +3141,7 @@ bool GHOST_SystemWayland::processEvents(bool waitForEvent)
     wl_display_roundtrip(d->display);
   }
 
-  if ((getEventManager()->getNumEvents() > 0)) {
+  if (getEventManager()->getNumEvents() > 0) {
     any_processed = true;
   }
 
@@ -3219,7 +3219,7 @@ GHOST_TSuccess GHOST_SystemWayland::getButtons(GHOST_Buttons &buttons) const
 
 char *GHOST_SystemWayland::getClipboard(bool /*selection*/) const
 {
-  char *clipboard = static_cast<char *>(malloc((selection.size() + 1)));
+  char *clipboard = static_cast<char *>(malloc(selection.size() + 1));
   memcpy(clipboard, selection.data(), selection.size() + 1);
   return clipboard;
 }
@@ -3656,12 +3656,12 @@ static void cursor_visible_set(GWL_Seat *seat,
   if (set_mode == CURSOR_VISIBLE_ALWAYS_SET) {
     /* Pass. */
   }
-  else if ((set_mode == CURSOR_VISIBLE_ONLY_SHOW)) {
+  else if (set_mode == CURSOR_VISIBLE_ONLY_SHOW) {
     if (!use_visible) {
       return;
     }
   }
-  else if ((set_mode == CURSOR_VISIBLE_ONLY_HIDE)) {
+  else if (set_mode == CURSOR_VISIBLE_ONLY_HIDE) {
     if (use_visible) {
       return;
     }
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index bb47cc54127..6b468f041c1 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -660,7 +660,7 @@ bool GHOST_SystemX11::processEvents(bool waitForEvent)
       }
 
       /* dispatch event to XIM server */
-      if ((XFilterEvent(&xevent, (Window) nullptr) == True)) {
+      if (XFilterEvent(&xevent, (Window) nullptr) == True) {
         /* do nothing now, the event is consumed by XIM. */
         continue;
       }
@@ -673,7 +673,7 @@ bool GHOST_SystemX11::processEvents(bool waitForEvent)
       }
       else if (xevent.type == KeyPress) {
         if ((xevent.xkey.keycode == m_last_release_keycode) &&
-            ((xevent.xkey.time <= m_last_release_time))) {
+            (xevent.xkey.time <= m_last_release_time)) {
           continue;
         }
       }
diff --git a/source/blender/blenkernel/intern/kelvinlet.c b/source/blender/blenkernel/intern/kelvinlet.c
index 73a84f06ad8..4ccd848b9d7 100644
--- a/source/blender/blenkernel/intern/kelvinlet.c
+++ b/source/blender/blenkernel/intern/kelvinlet.c
@@ -154,7 +154,7 @@ static void kelvinlet_scale(float disp[3],
   sub_v3_v3v3(radius_vertex, vertex_co, location);
   const float radius = len_v3(radius_vertex);
   const float radius_e = sqrtf(pow2f(radius) + pow2f(p->radius_scaled[0]));
-  const float u = (2.0f * p->b - p->a) * ((1.0f / pow3f(radius_e))) +
+  const float u = (2.0f * p->b - p->a) * (1.0f / pow3f(radius_e)) +
                   ((3.0f * pow2f(p->radius_scaled[0])) / (2.0f * pow5f(radius_e)));
   const float fade = u * p->c;
   mul_v3_v3fl(disp, radius_vertex, fade * p->f);
@@ -181,7 +181,7 @@ static void kelvinlet_twist(float disp[3],
   sub_v3_v3v3(radius_vertex, vertex_co, location);
   const float radius = len_v3(radius_vertex);
   const float radius_e = sqrtf(pow2f(radius) + pow2f(p->radius_scaled[0]));
-  const float u = -p->a * ((1.0f / pow3f(radius_e))) +
+  const float u = -p->a * (1.0f / pow3f(radius_e)) +
                   ((3.0f * pow2f(p->radius_scaled[0])) / (2.0f * pow5f(radius_e)));
   const float fade = u * p->c;
   cross_v3_v3v3(q_r, normal, radius_vertex);
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c
index bb57dc18534..65518427656 100644
--- a/source/blender/blenlib/intern/array_store.c
+++ b/source/blender/blenlib/intern/array_store.c
@@ -805,7 +805,7 @@ static void hash_array_from_cref(const BArrayInfo *info,
 static void hash_accum(hash_key *hash_array, const size_t hash_array_len, size_t iter_steps)
 {
   /* _very_ unlikely, can happen if you select a chunk-size of 1 for example. */
-  if (UNLIKELY((iter_steps > hash_array_len))) {
+  if (UNLIKELY(iter_steps > hash_array_len)) {
     iter_steps = hash_array_len;
   }
 
@@ -1403,7 +1403,7 @@ BArrayStore *BLI_array_store_create(uint stride, uint chunk_count)
   /* Triangle number, identifying now much read-ahead we need:
    * https://en.wikipedia.org/wiki/Triangular_number (+ 1) */
   bs->info.accum_read_ahead_len =
-      (uint)((((bs->info.accum_steps * (bs->info.accum_steps + 1))) / 2) + 1);
+      (uint)(((bs->info.accum_steps * (bs->info.accum_steps + 1)) / 2) + 1);
   bs->info.accum_read_ahead_bytes = bs->info.accum_read_ahead_len * stride;
 #else
   bs->info.accum_read_ahead_bytes = BCHUNK_HASH_LEN * stride;
diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
index 29bd066f33c..81793ee9995 100644
--- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
+++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
@@ -1273,7 +1273,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm,
         BMVert *v_other;
 
         /* NOTE: remapping will _never_ map a vertex to an already mapped vertex. */
-        while (UNLIKELY((v_other = bm_face_split_edgenet_partial_connect(bm, v_delimit, f)))) {
+        while (UNLIKELY(v_other = bm_face_split_edgenet_partial_connect(bm, v_delimit, f))) {
           struct TempVertPair *tvp = BLI_memarena_alloc(mem_arena, sizeof(*tvp));
           tvp->next = temp_vert_pairs.list;
           tvp->v_orig = v_delimit;
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index b08051341be..a141a9a1dda 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -6285,7 +6285,7 @@ static void find_bevel_edge_order(BMesh *bm, BevVert *bv, BMEdge *first_bme)
     BMLoop *l;
     BM_ITER_ELEM (l, &iter, bme, BM_LOOPS_OF_EDGE) {
       BMFace *f = l->f;
-      if ((l->prev->e == bme2 || l->next->e == bme2)) {
+      if (l->prev->e == bme2 || l->next->e == bme2) {
         if (!bestf || l->v == bv->v) {
           bestf = f;
         }
diff --git a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
index e209918d6e3..8a11815bd4c 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
@@ -451,7 +451,7 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm,
     }
 
     while ((BLI_heap_is_empty(vheap) == false) &&
-           (BLI_heap_node_value((vnode_top = BLI_heap_top(vheap))) < angle_limit)) {
+           (BLI_heap_node_value(vnode_top = BLI_heap_top(vheap)) < angle_limit)) {
       BMEdge *e_new = NULL;
       BMVert *v;
 
diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c
index 8e1dfbebe47..dd2915e6616 100644
--- a/source/blender/bmesh/tools/bmesh_intersect.c
+++ b/source/blender/bmesh/tools/bmesh_intersect.c
@@ -1490,7 +1490,7 @@ bool BM_mesh_intersect(BMesh *bm,
   (void)use_separate;
 #endif /* USE_SEPARATE */
 
-  if ((boolean_mode != BMESH_ISECT_BOOLEAN_NONE)) {
+  if (boolean_mode != BMESH_ISECT_BOOLEAN_NONE) {
     BVHTree *tree_pair[2] = {tree_a, tree_b};
 
     /* group vars */
diff --git a/source/blender/bmesh/tools/bmesh_path_region.c b/source/blender/bmesh/tools/bmesh_path_region.c
index 1e464108b84..a90bf87ebb0 100644
--- a/source/blender/bmesh/tools/bmesh_path_region.c
+++ b/source/blender/bmesh/tools/bmesh_path_region.c
@@ -228,7 +228,7 @@ static LinkNode *mesh_calc_path_region_elem(BMesh *bm,
             /* Walk along the chain, fill in values until we reach a vertex with 3+ edges. */
             {
               BMEdge *e_chain = e;
-              while (BM_vert_is_edge_pair_manifold(v_b) && ((depths[side][v_b_index] == -1))) {
+              while (BM_vert_is_edge_pair_manifold(v_b) && (depths[side][v_b_index] == -1)) {
                 depths[side][v_b_index] = pass;
 
                 BMEdge *e_chain_next = BM_DISK_EDGE_NEXT(e_chain, v_b);
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 5b4d436b0e0..e0df7328c74 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1341,7 +1341,7 @@ static size_t animfilter_fcurves(ListBase *anim_data,
    *    Back to step 2 :)
    */
   for (fcu = first;
-       ((fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id)));
+       (fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id));
        fcu = fcu->next) {
     if (UNLIKELY(fcurve_type == ANIMTYPE_NLACURVE)) {
       /* NLA Control Curve - Basically the same as normal F-Curves,
@@ -1602,7 +1602,7 @@ static size_t animfilter_nla_controls(
 
   /* add control curves from each NLA strip... */
   /* NOTE: ANIMTYPE_FCURVES are created here, to avoid duplicating the code needed */
-  BEGIN_ANIMFILTER_SUBCHANNELS (((adt->flag & ADT_NLA_SKEYS_COLLAPSED) == 0)) {
+  BEGIN_ANIMFILTER_SUBCHANNELS ((adt->flag & ADT_NLA_SKEYS_COLLAPSED) == 0) {
     NlaTrack *nlt;
     NlaStrip *strip;
 
@@ -1892,7 +1892,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
       }
 
       /* check selection and object type filters */
-      if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & BASE_SELECTED))) {
+      if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !(base->flag & BASE_SELECTED)) {
         /* only selected should be shown */
         continue;
       }
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 81b1c096d76..9e828ebd501 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -1377,12 +1377,12 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
     for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
       /* break connections for unseen bones */
       if (((arm->layer & ebone->layer) &&
-           ((ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | B

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list