[Bf-blender-cvs] [008ccacdfc1] master: Cleanup: Use MEM_calloc_arrayN in the Cloth Brush

Pablo Dobarro noreply at git.blender.org
Thu Jul 30 16:24:06 CEST 2020


Commit: 008ccacdfc198c3645916c80f7704c46a9d4ef12
Author: Pablo Dobarro
Date:   Thu Jul 30 15:02:26 2020 +0200
Branches: master
https://developer.blender.org/rB008ccacdfc198c3645916c80f7704c46a9d4ef12

Cleanup: Use MEM_calloc_arrayN in the Cloth Brush

Reviewed By: sergey

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

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

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 a8465ef9454..39cab883100 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -469,12 +469,13 @@ static SculptClothSimulation *cloth_brush_simulation_create(SculptSession *ss,
                                               "cloth length constraints");
   cloth_sim->capacity_length_constraints = CLOTH_LENGTH_CONSTRAINTS_BLOCK;
 
-  cloth_sim->acceleration = MEM_callocN(sizeof(float) * 3 * totverts, "cloth sim acceleration");
-  cloth_sim->pos = MEM_callocN(sizeof(float) * 3 * totverts, "cloth sim pos");
-  cloth_sim->prev_pos = MEM_callocN(sizeof(float) * 3 * totverts, "cloth sim prev pos");
-  cloth_sim->init_pos = MEM_callocN(sizeof(float) * 3 * totverts, "cloth sim init pos");
-  cloth_sim->length_constraint_tweak = MEM_callocN(sizeof(float) * totverts,
-                                                   "cloth sim length tweak");
+  cloth_sim->acceleration = MEM_calloc_arrayN(
+      totverts, 3 * sizeof(float), "cloth sim acceleration");
+  cloth_sim->pos = MEM_calloc_arrayN(totverts, 3 * sizeof(float), "cloth sim pos");
+  cloth_sim->prev_pos = MEM_calloc_arrayN(totverts, 3 * sizeof(float), "cloth sim prev pos");
+  cloth_sim->init_pos = MEM_calloc_arrayN(totverts, 3 * sizeof(float), "cloth sim init pos");
+  cloth_sim->length_constraint_tweak = MEM_calloc_arrayN(
+      totverts, sizeof(float), "cloth sim length tweak");
 
   /* Brush can be NULL for tools that neeed the solver but don't rely on constraint to deformation
    * positions. */



More information about the Bf-blender-cvs mailing list