[Bf-blender-cvs] [b8b57d2] master: BLI_listbase: match arg order with BLI_qsort_r

Campbell Barton noreply at git.blender.org
Thu Jun 11 13:54:29 CEST 2015


Commit: b8b57d2da99acca0d68035315b159174a8570271
Author: Campbell Barton
Date:   Thu Jun 11 15:07:14 2015 +1000
Branches: master
https://developer.blender.org/rBb8b57d2da99acca0d68035315b159174a8570271

BLI_listbase: match arg order with BLI_qsort_r

===================================================================

M	source/blender/blenlib/BLI_listbase.h
M	source/blender/blenlib/intern/listbase.c
M	source/blender/blenlib/intern/scanfill_utils.c
M	source/blender/editors/mesh/editmesh_knife.c
M	source/blender/editors/transform/transform_conversions.c

===================================================================

diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index 2e01f74..9dfa800 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -68,7 +68,7 @@ void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1);
 void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1);
 void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1);
 void BLI_listbase_sort(struct ListBase *listbase, int (*cmp)(const void *, const void *)) ATTR_NONNULL(1, 2);
-void BLI_listbase_sort_r(ListBase *listbase, void *thunk, int (*cmp)(void *, const void *, const void *)) ATTR_NONNULL(1, 3);
+void BLI_listbase_sort_r(ListBase *listbase, int (*cmp)(void *, const void *, const void *), void *thunk) ATTR_NONNULL(1, 2);
 void BLI_freelist(struct ListBase *listbase) ATTR_NONNULL(1);
 int  BLI_listbase_count_ex(const struct ListBase *listbase, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
 int  BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index f267cd7..0bc6355 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -233,7 +233,7 @@ void BLI_listbase_sort(ListBase *listbase, int (*cmp)(const void *, const void *
 	}
 }
 
-void BLI_listbase_sort_r(ListBase *listbase, void *thunk, int (*cmp)(void *, const void *, const void *))
+void BLI_listbase_sort_r(ListBase *listbase, int (*cmp)(void *, const void *, const void *), void *thunk)
 {
 	Link *current = NULL;
 	Link *previous = NULL;
diff --git a/source/blender/blenlib/intern/scanfill_utils.c b/source/blender/blenlib/intern/scanfill_utils.c
index d0420a3..059d5cb 100644
--- a/source/blender/blenlib/intern/scanfill_utils.c
+++ b/source/blender/blenlib/intern/scanfill_utils.c
@@ -267,7 +267,7 @@ static bool scanfill_preprocess_self_isect(
 				}
 
 				if (BLI_listbase_is_single(e_ls) == false) {
-					BLI_listbase_sort_r(e_ls, eed->v2->co, edge_isect_ls_sort_cb);
+					BLI_listbase_sort_r(e_ls, edge_isect_ls_sort_cb, eed->v2->co);
 				}
 
 				/* move original edge to filledgebase and add replacement
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index b7e1128..8775160 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2828,7 +2828,7 @@ static void knife_make_cuts(KnifeTool_OpData *kcd)
 	for (lst = BLI_smallhash_iternew(ehash, &hiter, (uintptr_t *)&e); lst;
 	     lst = BLI_smallhash_iternext(&hiter, (uintptr_t *)&e))
 	{
-		BLI_listbase_sort_r(lst, e->v1->co, sort_verts_by_dist_cb);
+		BLI_listbase_sort_r(lst, sort_verts_by_dist_cb, e->v1->co);
 
 		for (ref = lst->first; ref; ref = ref->next) {
 			kfv = ref->ref;
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 4da3fa8..cd893a4 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -3188,7 +3188,7 @@ static void posttrans_gpd_clean(bGPdata *gpd)
 		bGPDframe *gpf, *gpfn;
 		bool is_double = false;
 
-		BLI_listbase_sort_r(&gpl->frames, &is_double, gpf_cmp_frame);
+		BLI_listbase_sort_r(&gpl->frames, gpf_cmp_frame, &is_double);
 
 		if (is_double) {
 			for (gpf = gpl->frames.first; gpf; gpf = gpfn) {
@@ -3215,7 +3215,7 @@ static void posttrans_mask_clean(Mask *mask)
 		MaskLayerShape *masklay_shape, *masklay_shape_next;
 		bool is_double = false;
 
-		BLI_listbase_sort_r(&masklay->splines_shapes, &is_double, masklay_shape_cmp_frame);
+		BLI_listbase_sort_r(&masklay->splines_shapes, masklay_shape_cmp_frame, &is_double);
 
 		if (is_double) {
 			for (masklay_shape = masklay->splines_shapes.first; masklay_shape; masklay_shape = masklay_shape_next) {




More information about the Bf-blender-cvs mailing list