[Bf-blender-cvs] [2d7957727c9] master: Fix: Incorrect conversion from C bitfield syntax

Hans Goudey noreply at git.blender.org
Thu Apr 28 18:19:22 CEST 2022


Commit: 2d7957727c9be8af2689f1cff1ebed590238cb8e
Author: Hans Goudey
Date:   Thu Apr 28 11:18:56 2022 -0500
Branches: master
https://developer.blender.org/rB2d7957727c9be8af2689f1cff1ebed590238cb8e

Fix: Incorrect conversion from C bitfield syntax

Recent cleanups 9a8669ac81b99b2 and 1c790555a02bfc3
incorrectly interpereted the bitfield width syntax as a default
value. Also resolve two other compilation warnings.

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

M	source/blender/bmesh/intern/bmesh_mesh_convert.h
M	source/blender/editors/space_sequencer/space_sequencer.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/transform/transform_snap_object.cc

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

diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.h b/source/blender/bmesh/intern/bmesh_mesh_convert.h
index cc1ad71549d..e2871dc04d3 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_convert.h
+++ b/source/blender/bmesh/intern/bmesh_mesh_convert.h
@@ -18,12 +18,12 @@ void BM_mesh_cd_flag_apply(BMesh *bm, char cd_flag);
 char BM_mesh_cd_flag_from_bmesh(BMesh *bm);
 
 struct BMeshFromMeshParams {
-  bool calc_face_normal : true;
-  bool calc_vert_normal : true;
+  bool calc_face_normal;
+  bool calc_vert_normal;
   /* add a vertex CD_SHAPE_KEYINDEX layer */
-  bool add_key_index : true;
+  bool add_key_index;
   /* set vertex coordinates from the shapekey */
-  bool use_shapekey : true;
+  bool use_shapekey;
   /* define the active shape key (index + 1) */
   int active_shapekey;
   struct CustomData_MeshMasks cd_mask_extra;
@@ -43,7 +43,7 @@ void BM_mesh_bm_from_me(BMesh *bm, const struct Mesh *me, const struct BMeshFrom
 
 struct BMeshToMeshParams {
   /** Update object hook indices & vertex parents. */
-  bool calc_object_remap : true;
+  bool calc_object_remap;
   /**
    * This re-assigns shape-key indices. Only do if the BMesh will have continued use
    * to update the mesh & shape key in the future.
@@ -53,12 +53,12 @@ struct BMeshToMeshParams {
    * so a second flush or edit-mode exit doesn't run with indices
    * that have become invalid from updating the shape-key, see T71865.
    */
-  bool update_shapekey_indices : true;
+  bool update_shapekey_indices;
   /**
    * Instead of copying the basis shape-key into the #MVert array,
    * copy the #BMVert.co directly to #MVert.co (used for reading undo data).
    */
-  bool active_shapekey_to_mvert : true;
+  bool active_shapekey_to_mvert;
   struct CustomData_MeshMasks cd_mask_extra;
 };
 /**
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 8e4bd61f600..26479629ec3 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -586,18 +586,15 @@ static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
   strip_boundbox.ymax = max_ff(sseq->runtime.timeline_clamp_custom_range, strip_boundbox.ymax);
 
   rctf view_clamped = v2d->cur;
-  bool do_clamp = false;
 
   const float range_y = BLI_rctf_size_y(&view_clamped);
   if (view_clamped.ymax > strip_boundbox.ymax) {
     view_clamped.ymax = strip_boundbox.ymax;
     view_clamped.ymin = max_ff(strip_boundbox.ymin, strip_boundbox.ymax - range_y);
-    do_clamp = true;
   }
   if (view_clamped.ymin < strip_boundbox.ymin) {
     view_clamped.ymin = strip_boundbox.ymin;
     view_clamped.ymax = min_ff(strip_boundbox.ymax, strip_boundbox.ymin + range_y);
-    do_clamp = true;
   }
 }
 
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index b39557929f8..a02058fde6b 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -694,6 +694,7 @@ static void view3d_ob_drop_matrix_from_snap(V3DSnapCursorState *snap_state,
 {
   V3DSnapCursorData *snap_data = ED_view3d_cursor_snap_data_get();
   BLI_assert(snap_state->draw_box || snap_state->draw_plane);
+  UNUSED_VARS_NDEBUG(snap_state);
   copy_m4_m3(obmat_final, snap_data->plane_omat);
   copy_v3_v3(obmat_final[3], snap_data->loc);
 
diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc
index 27b8e858f32..fade7f47d9c 100644
--- a/source/blender/editors/transform/transform_snap_object.cc
+++ b/source/blender/editors/transform/transform_snap_object.cc
@@ -70,9 +70,9 @@ struct SnapData_Mesh {
   BVHTreeFromMesh treedata_mesh;
 
   const MPoly *poly;
-  bool has_looptris = true;
-  bool has_loose_edge = true;
-  bool has_loose_vert = true;
+  bool has_looptris;
+  bool has_loose_edge;
+  bool has_loose_vert;
 
   void clear()
   {



More information about the Bf-blender-cvs mailing list