From 7c9131d11eb01a70db440fac7bb3f4b3833d544a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 7 Oct 2020 14:27:33 +0200 Subject: Refactor `BKE_id_copy_ex` to return the new ID pointer. Note that possibility to pass the new ID pointer as parameter was kept, as this is needed for some rather specific cases (like in depsgraph/COW, when copying into already allocated memory). Part of T71219. --- source/blender/blenkernel/intern/displist.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/displist.c') diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 8fdd6ee69d9..c37da9a9365 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1071,8 +1071,8 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, if (modified) { if (vertCos) { - Mesh *temp_mesh; - BKE_id_copy_ex(NULL, &modified->id, (ID **)&temp_mesh, LIB_ID_COPY_LOCALIZE); + Mesh *temp_mesh = (Mesh *)BKE_id_copy_ex( + NULL, &modified->id, NULL, LIB_ID_COPY_LOCALIZE); BKE_id_free(NULL, modified); modified = temp_mesh; @@ -1115,8 +1115,7 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, if (vertCos) { if (modified) { - Mesh *temp_mesh; - BKE_id_copy_ex(NULL, &modified->id, (ID **)&temp_mesh, LIB_ID_COPY_LOCALIZE); + Mesh *temp_mesh = (Mesh *)BKE_id_copy_ex(NULL, &modified->id, NULL, LIB_ID_COPY_LOCALIZE); BKE_id_free(NULL, modified); modified = temp_mesh; -- cgit v1.2.3