[Bf-blender-cvs] [342bdbc1769] master: Fix warnings in cloth brush int casts

Pablo Dobarro noreply at git.blender.org
Thu Oct 1 20:47:43 CEST 2020


Commit: 342bdbc1769fa31c734d7c38ab67be3428c9d234
Author: Pablo Dobarro
Date:   Thu Oct 1 19:58:52 2020 +0200
Branches: master
https://developer.blender.org/rB342bdbc1769fa31c734d7c38ab67be3428c9d234

Fix warnings in cloth brush int casts

Use POINTER_AS_INT instead

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9083

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

M	source/blender/editors/sculpt_paint/sculpt_cloth.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c
index 7b14f48c6a8..61455cc28bb 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -277,7 +277,7 @@ static void do_cloth_brush_build_constraints_task_cb_ex(
   const Brush *brush = data->brush;
   PBVHNode *node = data->nodes[n];
 
-  const int node_index = (int)(BLI_ghash_lookup(data->cloth_sim->node_state_index, node));
+  const int node_index = POINTER_AS_INT(BLI_ghash_lookup(data->cloth_sim->node_state_index, node));
   if (data->cloth_sim->node_state[node_index] != SCULPT_CLOTH_NODE_UNINITIALIZED) {
     /* The simulation already contains constraints for this node. */
     return;
@@ -693,7 +693,7 @@ static void do_cloth_brush_solve_simulation_task_cb_ex(
   SculptClothSimulation *cloth_sim = data->cloth_sim;
   const float time_step = data->cloth_time_step;
 
-  const int node_index = (int)(BLI_ghash_lookup(data->cloth_sim->node_state_index, node));
+  const int node_index = POINTER_AS_INT(BLI_ghash_lookup(data->cloth_sim->node_state_index, node));
   if (data->cloth_sim->node_state[node_index] != SCULPT_CLOTH_NODE_ACTIVE) {
     return;
   }
@@ -1062,7 +1062,7 @@ void SCULPT_cloth_sim_activate_nodes(SculptClothSimulation *cloth_sim,
 {
   /* Activate the nodes inside the simulation area. */
   for (int n = 0; n < totnode; n++) {
-    const int node_index = (int)(BLI_ghash_lookup(cloth_sim->node_state_index, nodes[n]));
+    const int node_index = POINTER_AS_INT(BLI_ghash_lookup(cloth_sim->node_state_index, nodes[n]));
     cloth_sim->node_state[node_index] = SCULPT_CLOTH_NODE_ACTIVE;
   }
 }



More information about the Bf-blender-cvs mailing list