[Bf-blender-cvs] [3aa1143d57b] master: Cleanup: redundant parenthesis

Campbell Barton noreply at git.blender.org
Thu Jun 18 06:31:37 CEST 2020


Commit: 3aa1143d57bc8e35622f02e9bc570135a472af77
Author: Campbell Barton
Date:   Thu Jun 18 12:21:38 2020 +1000
Branches: master
https://developer.blender.org/rB3aa1143d57bc8e35622f02e9bc570135a472af77

Cleanup: redundant parenthesis

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

M	source/blender/blenkernel/intern/blender_undo.c
M	source/blender/blenkernel/intern/boids.c
M	source/blender/blenkernel/intern/effect.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/draw/engines/eevee/eevee_engine.c
M	source/blender/editors/armature/armature_relations.c
M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/interface/view2d.c
M	source/blender/editors/interface/view2d_ops.c
M	source/blender/editors/metaball/mball_edit.c
M	source/blender/editors/object/object_modes.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/sculpt_paint/paint_stroke.c
M	source/blender/editors/space_action/space_action.c
M	source/blender/editors/space_clip/clip_dopesheet_draw.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_console/space_console.c
M	source/blender/editors/space_image/image_edit.c
M	source/blender/editors/space_info/space_info.c
M	source/blender/editors/space_nla/space_nla.c
M	source/blender/editors/space_node/node_draw.c
M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/freestyle/intern/python/BPy_Freestyle.cpp
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_define.c
M	source/blender/render/intern/source/pipeline.c
M	source/blender/render/intern/source/render_texture.c
M	source/blender/windowmanager/intern/wm_files.c

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

diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c
index ab382d0e8ff..c8aff345487 100644
--- a/source/blender/blenkernel/intern/blender_undo.c
+++ b/source/blender/blenkernel/intern/blender_undo.c
@@ -109,7 +109,8 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev)
     static int counter = 0;
     char filename[FILE_MAX];
     char numstr[32];
-    int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on undo */
+    /* Don't do file history on undo. */
+    const int fileflags = G.fileflags & ~G_FILE_HISTORY;
 
     /* Calculate current filename. */
     counter++;
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index 6197b9dbefd..639437f8251 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -218,7 +218,7 @@ static int rule_avoid_collision(BoidRule *rule,
                                 BoidValues *val,
                                 ParticleData *pa)
 {
-  const int raycast_flag = BVH_RAYCAST_DEFAULT & ~(BVH_RAYCAST_WATERTIGHT);
+  const int raycast_flag = BVH_RAYCAST_DEFAULT & ~BVH_RAYCAST_WATERTIGHT;
   BoidRuleAvoidCollision *acbr = (BoidRuleAvoidCollision *)rule;
   KDTreeNearest_3d *ptn = NULL;
   ParticleTarget *pt;
@@ -854,7 +854,7 @@ static Object *boid_find_ground(BoidBrainData *bbd,
                                 float ground_co[3],
                                 float ground_nor[3])
 {
-  const int raycast_flag = BVH_RAYCAST_DEFAULT & ~(BVH_RAYCAST_WATERTIGHT);
+  const int raycast_flag = BVH_RAYCAST_DEFAULT & ~BVH_RAYCAST_WATERTIGHT;
   BoidParticle *bpa = pa->boid;
 
   if (bpa->data.mode == eBoidMode_Climbing) {
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index fe2c9ed51b8..7ed04c6976a 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -428,7 +428,7 @@ static float eff_calc_visibility(ListBase *colliders,
                                  EffectorData *efd,
                                  EffectedPoint *point)
 {
-  const int raycast_flag = BVH_RAYCAST_DEFAULT & ~(BVH_RAYCAST_WATERTIGHT);
+  const int raycast_flag = BVH_RAYCAST_DEFAULT & ~BVH_RAYCAST_WATERTIGHT;
   ListBase *colls = colliders;
   ColliderCache *col;
   float norm[3], len = 0.0;
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index eaeef0d52c1..2c3b047af46 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -308,7 +308,7 @@ static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb)
         region->v2d.tot.ymax = 0.0f;
 
         region->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
-        region->v2d.scroll |= (V2D_SCROLL_RIGHT);
+        region->v2d.scroll |= V2D_SCROLL_RIGHT;
         region->v2d.align = V2D_ALIGN_NO_POS_Y;
         region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
         break;
@@ -334,7 +334,7 @@ static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb)
         region->v2d.minzoom = 0.01f;
         region->v2d.maxzoom = 50;
         region->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
-        region->v2d.scroll |= (V2D_SCROLL_RIGHT);
+        region->v2d.scroll |= V2D_SCROLL_RIGHT;
         region->v2d.keepzoom = V2D_LOCKZOOM_Y;
         region->v2d.align = V2D_ALIGN_NO_POS_Y;
         region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c
index b698574f9d7..083d0a82214 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -370,7 +370,7 @@ static void eevee_id_object_update(void *UNUSED(vedata), Object *object)
 {
   EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_get(object);
   if (ped != NULL && ped->dd.recalc != 0) {
-    ped->need_update = (ped->dd.recalc & (ID_RECALC_TRANSFORM)) != 0;
+    ped->need_update = (ped->dd.recalc & ID_RECALC_TRANSFORM) != 0;
     ped->dd.recalc = 0;
   }
   EEVEE_LightEngineData *led = EEVEE_light_data_get(object);
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index fede621f711..8dfb8177ddb 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -754,7 +754,7 @@ static void bone_connect_to_new_parent(ListBase *edbo,
   float offset[3];
 
   if ((selbone->parent) && (selbone->flag & BONE_CONNECTED)) {
-    selbone->parent->flag &= ~(BONE_TIPSEL);
+    selbone->parent->flag &= ~BONE_TIPSEL;
   }
 
   /* make actbone the parent of selbone */
@@ -956,7 +956,7 @@ static void editbone_clear_parent(EditBone *ebone, int mode)
 {
   if (ebone->parent) {
     /* for nice selection */
-    ebone->parent->flag &= ~(BONE_TIPSEL);
+    ebone->parent->flag &= ~BONE_TIPSEL;
   }
 
   if (mode == 1) {
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index eb7c1bc74ea..ccd39429704 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -188,7 +188,7 @@ static void *ed_armature_pick_bone_from_selectbuffer_impl(const bool is_editmode
       Base *base = NULL;
       bool sel;
 
-      hitresult &= ~(BONESEL_ANY);
+      hitresult &= ~BONESEL_ANY;
       /* Determine what the current bone is */
       if (is_editmode == false) {
         base = ED_armature_base_and_pchan_from_select_buffer(bases, bases_len, hitresult, &pchan);
@@ -1302,7 +1302,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
         if ((ebone->flag & BONE_UNSELECTABLE) == 0) {
           ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
           if (ebone->parent) {
-            ebone->parent->flag |= (BONE_TIPSEL);
+            ebone->parent->flag |= BONE_TIPSEL;
           }
         }
         break;
@@ -1317,7 +1317,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
           if ((ebone->flag & BONE_UNSELECTABLE) == 0) {
             ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
             if (ebone->parent) {
-              ebone->parent->flag |= (BONE_TIPSEL);
+              ebone->parent->flag |= BONE_TIPSEL;
             }
           }
         }
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index f9f2d0166d8..2bd83475f00 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2054,7 +2054,7 @@ static void annotation_draw_apply_event(
   /* Key to toggle stabilization. */
   if (event->shift > 0 && p->paintmode == GP_PAINTMODE_DRAW) {
     /* Using permanent stabilization, shift will deactivate the flag. */
-    if (p->flags & (GP_PAINTFLAG_USE_STABILIZER)) {
+    if (p->flags & GP_PAINTFLAG_USE_STABILIZER) {
       if (p->flags & GP_PAINTFLAG_USE_STABILIZER_TEMP) {
         gpencil_draw_toggle_stabilizer_cursor(p, false);
         p->flags &= ~GP_PAINTFLAG_USE_STABILIZER_TEMP;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 42feda0e1bc..3f3f0513184 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4872,7 +4872,7 @@ static void ui_numedit_set_active(uiBut *but)
 
   /* Don't change the cursor once pressed. */
   if ((but->flag & UI_SELECT) == 0) {
-    if ((but->drawflag & (UI_BUT_ACTIVE_LEFT)) || (but->drawflag & (UI_BUT_ACTIVE_RIGHT))) {
+    if ((but->drawflag & UI_BUT_ACTIVE_LEFT) || (but->drawflag & UI_BUT_ACTIVE_RIGHT)) {
       if (data->changed_cursor) {
         WM_cursor_modal_restore(data->window);
         data->changed_cursor = false;
@@ -9947,7 +9947,7 @@ static int ui_handle_menu_event(bContext *C,
           if (ELEM(event->val, KM_PRESS, KM_DBL_CLICK)) {
             if ((is_parent_menu == false) && (U.uiflag & USER_MENUOPENAUTO) == 0) {
               /* for root menus, allow clicking to close */
-              if (block->flag & (UI_BLOCK_OUT_1)) {
+              if (block->flag & UI_BLOCK_OUT_1) {
                 menu->menuretval = UI_RETURN_OK;
               }
               else {
@@ -9955,7 +9955,7 @@ static int ui_handle_menu_event(bContext *C,
               }
             }
             else if (saferct && !BLI_rctf_isect_pt(&saferct->parent, event->x, event->y)) {
-              if (block->flag & (UI_BLOCK_OUT_1)) {
+              if (block->flag & UI_BLOCK_OUT_1) {
                 menu->menuretval = UI_RETURN_OK;
               }
               else {
@@ -10049,7 +10049,7 @@ static int ui_handle_menu_event(bContext *C,
 
           /* strict check, and include the parent rect */
           if (!menu->dotowards && !saferct) {
-            if (block->flag & (UI_BLOCK_OUT_1)) {
+            if (block->flag & UI_BLOCK_OUT_1) {
               menu->menuretval = UI_RETURN_OK;
             }
             else {
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 9a3f1d9fca8..4fff80d5def 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1000,7 +1000,7 @@ void ui_draw_aligned_panel(uiStyle *style,
                            * can't be dragged. This may be changed in future. */
                           show_background);
   const int panel_col = is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK;
-  const bool draw_box_style = (panel->type && panel->type->flag & (PNL_DRAW_BOX));
+  const bool draw_box_style = (panel->type && panel->type->flag & PNL_DRAW_BOX);
 
   /* Use the theme for box widgets for box-style panels. */
   uiWidgetColors *box_wcol = NULL;
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/edit

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list