diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-23 07:18:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-05 02:20:16 +0300 |
commit | 36971ea2764441af99ace23de9f6ee7604342198 (patch) | |
tree | e5bdab7f83762f77d6ad3fec325d777beea0e494 /source/blender/blenkernel | |
parent | 38fdfe757de5715caa2825640dc59c2e7f9cbd73 (diff) |
Use custom SWAP macro for swapping userdef data
Avoids complicating the common case
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index fdfb4628d1a..af46b6ec852 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -248,7 +248,12 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use */ #define DATA_SWAP(id) \ - SWAP(userdef_a->id, userdef_b->id); + { \ + UserDef userdef_tmp; \ + memcpy(&(userdef_tmp.id), &(userdef_a->id), sizeof(userdef_tmp.id)); \ + memcpy(&(userdef_a->id), &(userdef_b->id), sizeof(userdef_tmp.id)); \ + memcpy(&(userdef_b->id), &(userdef_tmp.id), sizeof(userdef_tmp.id)); \ + } #define LIST_SWAP(id) { \ SWAP(ListBase, userdef_a->id, userdef_b->id); \ |