Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-04-12 11:56:51 +0300
committerSergey Sharybin <sergey@blender.org>2022-04-13 12:48:12 +0300
commit25c357124de8905360c44a5a842284089ddec341 (patch)
treed7f7de7c459d622366ba5b0a7caec720c97f35c7 /source/blender/blenkernel/intern/curve.cc
parentda66c0519fce9bff981370868a359e64198552bc (diff)
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
Diffstat (limited to 'source/blender/blenkernel/intern/curve.cc')
-rw-r--r--source/blender/blenkernel/intern/curve.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/curve.cc b/source/blender/blenkernel/intern/curve.cc
index 2d72ad28d18..6815b4d7486 100644
--- a/source/blender/blenkernel/intern/curve.cc
+++ b/source/blender/blenkernel/intern/curve.cc
@@ -665,7 +665,7 @@ Nurb *BKE_nurb_duplicate(const Nurb *nu)
if (newnu == nullptr) {
return nullptr;
}
- memcpy(newnu, nu, sizeof(Nurb));
+ *newnu = blender::dna::shallow_copy(*nu);
if (nu->bezt) {
newnu->bezt = (BezTriple *)MEM_malloc_arrayN(nu->pntsu, sizeof(BezTriple), "duplicateNurb2");
@@ -699,7 +699,7 @@ Nurb *BKE_nurb_duplicate(const Nurb *nu)
Nurb *BKE_nurb_copy(Nurb *src, int pntsu, int pntsv)
{
Nurb *newnu = (Nurb *)MEM_mallocN(sizeof(Nurb), "copyNurb");
- memcpy(newnu, src, sizeof(Nurb));
+ *newnu = blender::dna::shallow_copy(*src);
if (pntsu == 1) {
SWAP(int, pntsu, pntsv);