diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-01 09:02:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-01 09:02:30 +0300 |
commit | 1779452eb455434ae151fa150e028060ddcf1c26 (patch) | |
tree | 0eb506b32bc40387b3db885cd710e69ca800cf35 /source/blender | |
parent | 45b221834184e6bdc28e83338014ddea6eb1fad0 (diff) |
Cleanup: use swap math funcs
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 9 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/occlusion.c | 4 |
3 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 6e58513e38e..09fbf392590 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -986,15 +986,12 @@ void sort_time_fcurve(FCurve *fcu) /* if either one of both of the points exceeds crosses over the keyframe time... */ if ( (bezt->vec[0][0] > bezt->vec[1][0]) && (bezt->vec[2][0] < bezt->vec[1][0]) ) { /* swap handles if they have switched sides for some reason */ - SWAP(float, bezt->vec[0][0], bezt->vec[2][0]); - SWAP(float, bezt->vec[0][1], bezt->vec[2][1]); + swap_v2_v2(bezt->vec[0], bezt->vec[2]); } else { /* clamp handles */ - if (bezt->vec[0][0] > bezt->vec[1][0]) - bezt->vec[0][0] = bezt->vec[1][0]; - if (bezt->vec[2][0] < bezt->vec[1][0]) - bezt->vec[2][0] = bezt->vec[1][0]; + CLAMP_MAX(bezt->vec[0][0], bezt->vec[1][0]); + CLAMP_MIN(bezt->vec[2][0], bezt->vec[1][0]); } } } diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index b3297db6176..1b9a09bd2c5 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -988,9 +988,7 @@ static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op)) /* only if selected and editable */ if (EBONE_VISIBLE(arm, ebo) && EBONE_EDITABLE(ebo)) { /* swap head and tail coordinates */ - SWAP(float, ebo->head[0], ebo->tail[0]); - SWAP(float, ebo->head[1], ebo->tail[1]); - SWAP(float, ebo->head[2], ebo->tail[2]); + swap_v3_v3(ebo->head, ebo->tail); /* do parent swapping: * - use 'child' as new parent diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index f55dde588cb..d5a45bd1126 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -474,9 +474,7 @@ static void occ_build_split(OcclusionTree *tree, int begin, int end, int *split) if (tree->co[a][axis] > mid) { enda--; SWAP(OccFace, tree->face[a], tree->face[enda]); - SWAP(float, tree->co[a][0], tree->co[enda][0]); - SWAP(float, tree->co[a][1], tree->co[enda][1]); - SWAP(float, tree->co[a][2], tree->co[enda][2]); + swap_v3_v3(tree->co[a], tree->co[enda]); } else a++; |