From 91d0825b5556150c017dad767f7971bb6a731aec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 31 Mar 2018 19:25:27 +0200 Subject: BLI_sort_utils: add pointer sorting callback Also rename Pointer -> Ptr --- source/blender/blenlib/BLI_sort_utils.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/BLI_sort_utils.h') diff --git a/source/blender/blenlib/BLI_sort_utils.h b/source/blender/blenlib/BLI_sort_utils.h index e08f4e5ac83..f6bd80b30d3 100644 --- a/source/blender/blenlib/BLI_sort_utils.h +++ b/source/blender/blenlib/BLI_sort_utils.h @@ -32,7 +32,7 @@ * \note keep \a sort_value first, * so cmp functions can be reused. */ -struct SortPointerByFloat { +struct SortPtrByFloat { float sort_value; void *data; }; @@ -42,7 +42,7 @@ struct SortIntByFloat { int data; }; -struct SortPointerByInt { +struct SortPtrByInt { int sort_value; void *data; }; @@ -58,4 +58,7 @@ int BLI_sortutil_cmp_float_reverse(const void *a_, const void *b_); int BLI_sortutil_cmp_int(const void *a_, const void *b_); int BLI_sortutil_cmp_int_reverse(const void *a_, const void *b_); +int BLI_sortutil_cmp_ptr(const void *a_, const void *b_); +int BLI_sortutil_cmp_ptr_reverse(const void *a_, const void *b_); + #endif /* __BLI_SORT_UTILS_H__ */ -- cgit v1.2.3