From 25c357124de8905360c44a5a842284089ddec341 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 12 Apr 2022 10:56:51 +0200 Subject: Cover some DNA files with C++ utility macros Solves compilation warning with Clang, and moves manipulation with DNA structures to the designed way for C++. The tests and few other places are update to the new code by Jacques. Ref T96847 Maniphest Tasks: T96847 Differential Revision: https://developer.blender.org/D14625 --- source/blender/editors/render/render_shading.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/render') diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index f5bd60df2b4..46f62354fce 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -2613,7 +2613,7 @@ static void copy_mtex_copybuf(ID *id) } if (mtex && *mtex) { - memcpy(&mtexcopybuf, *mtex, sizeof(MTex)); + mtexcopybuf = blender::dna::shallow_copy(**mtex); mtexcopied = 1; } else { @@ -2649,7 +2649,7 @@ static void paste_mtex_copybuf(ID *id) id_us_min(&(*mtex)->tex->id); } - memcpy(*mtex, &mtexcopybuf, sizeof(MTex)); + **mtex = blender::dna::shallow_copy(mtexcopybuf); id_us_plus((ID *)mtexcopybuf.tex); } -- cgit v1.2.3