Use custom SWAP macro for swapping userdef data
Avoids complicating the common case
This commit is contained in:
@@ -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); \
|
||||
|
||||
Reference in New Issue
Block a user