From f79856f9fb12d47d08e14a1e0edaee9e638362c0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Jun 2020 14:29:59 +1000 Subject: Cleanup: minor changes to deform functions - Use 'float (*)[3]' to avoid casts. - Remove unnecessary float[3] copy in gpencil_deform_verts. - Use MEM_SAFE_FREE - Use const arguments. --- source/blender/modifiers/intern/MOD_armature.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_armature.c') diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 214c6dbe9dc..800de546a5a 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -74,7 +74,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla ArmatureModifierData *tamd = (ArmatureModifierData *)target; BKE_modifier_copydata_generic(md, target, flag); - tamd->prevCos = NULL; + tamd->vert_coords_prev = NULL; } static void requiredDataMask(Object *UNUSED(ob), @@ -152,15 +152,12 @@ static void deformVerts(ModifierData *md, NULL, numVerts, amd->deformflag, - (float(*)[3])amd->prevCos, + amd->vert_coords_prev, amd->defgrp_name, mesh); /* free cache */ - if (amd->prevCos) { - MEM_freeN(amd->prevCos); - amd->prevCos = NULL; - } + MEM_SAFE_FREE(amd->vert_coords_prev); } static void deformVertsEM(ModifierData *md, @@ -186,15 +183,12 @@ static void deformVertsEM(ModifierData *md, NULL, numVerts, amd->deformflag, - (float(*)[3])amd->prevCos, + amd->vert_coords_prev, amd->defgrp_name, mesh_src); /* free cache */ - if (amd->prevCos) { - MEM_freeN(amd->prevCos); - amd->prevCos = NULL; - } + MEM_SAFE_FREE(amd->vert_coords_prev); if (mesh_src != mesh) { BKE_id_free(NULL, mesh_src); -- cgit v1.2.3