Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenlib/intern/sort_utils.c
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenlib/intern/sort_utils.c')
-rw-r--r--source/blender/blenlib/intern/sort_utils.c104
1 files changed, 70 insertions, 34 deletions
diff --git a/source/blender/blenlib/intern/sort_utils.c b/source/blender/blenlib/intern/sort_utils.c
index 3220f753397..09babd3d424 100644
--- a/source/blender/blenlib/intern/sort_utils.c
+++ b/source/blender/blenlib/intern/sort_utils.c
@@ -23,70 +23,106 @@
* Utility functions for sorting common types.
*/
-#include "BLI_sort_utils.h" /* own include */
+#include "BLI_sort_utils.h" /* own include */
struct SortAnyByFloat {
- float sort_value;
+ float sort_value;
};
struct SortAnyByInt {
- int sort_value;
+ int sort_value;
};
struct SortAnyByPtr {
- const void *sort_value;
+ const void *sort_value;
};
int BLI_sortutil_cmp_float(const void *a_, const void *b_)
{
- const struct SortAnyByFloat *a = a_;
- const struct SortAnyByFloat *b = b_;
- if (a->sort_value > b->sort_value) { return 1; }
- else if (a->sort_value < b->sort_value) { return -1; }
- else { return 0; }
+ const struct SortAnyByFloat *a = a_;
+ const struct SortAnyByFloat *b = b_;
+ if (a->sort_value > b->sort_value) {
+ return 1;
+ }
+ else if (a->sort_value < b->sort_value) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
}
int BLI_sortutil_cmp_float_reverse(const void *a_, const void *b_)
{
- const struct SortAnyByFloat *a = a_;
- const struct SortAnyByFloat *b = b_;
- if (a->sort_value < b->sort_value) { return 1; }
- else if (a->sort_value > b->sort_value) { return -1; }
- else { return 0; }
+ const struct SortAnyByFloat *a = a_;
+ const struct SortAnyByFloat *b = b_;
+ if (a->sort_value < b->sort_value) {
+ return 1;
+ }
+ else if (a->sort_value > b->sort_value) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
}
int BLI_sortutil_cmp_int(const void *a_, const void *b_)
{
- const struct SortAnyByInt *a = a_;
- const struct SortAnyByInt *b = b_;
- if (a->sort_value > b->sort_value) { return 1; }
- else if (a->sort_value < b->sort_value) { return -1; }
- else { return 0; }
+ const struct SortAnyByInt *a = a_;
+ const struct SortAnyByInt *b = b_;
+ if (a->sort_value > b->sort_value) {
+ return 1;
+ }
+ else if (a->sort_value < b->sort_value) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
}
int BLI_sortutil_cmp_int_reverse(const void *a_, const void *b_)
{
- const struct SortAnyByInt *a = a_;
- const struct SortAnyByInt *b = b_;
- if (a->sort_value < b->sort_value) { return 1; }
- else if (a->sort_value > b->sort_value) { return -1; }
- else { return 0; }
+ const struct SortAnyByInt *a = a_;
+ const struct SortAnyByInt *b = b_;
+ if (a->sort_value < b->sort_value) {
+ return 1;
+ }
+ else if (a->sort_value > b->sort_value) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
}
int BLI_sortutil_cmp_ptr(const void *a_, const void *b_)
{
- const struct SortAnyByPtr *a = a_;
- const struct SortAnyByPtr *b = b_;
- if (a->sort_value > b->sort_value) { return 1; }
- else if (a->sort_value < b->sort_value) { return -1; }
- else { return 0; }
+ const struct SortAnyByPtr *a = a_;
+ const struct SortAnyByPtr *b = b_;
+ if (a->sort_value > b->sort_value) {
+ return 1;
+ }
+ else if (a->sort_value < b->sort_value) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
}
int BLI_sortutil_cmp_ptr_reverse(const void *a_, const void *b_)
{
- const struct SortAnyByPtr *a = a_;
- const struct SortAnyByPtr *b = b_;
- if (a->sort_value < b->sort_value) { return 1; }
- else if (a->sort_value > b->sort_value) { return -1; }
- else { return 0; }
+ const struct SortAnyByPtr *a = a_;
+ const struct SortAnyByPtr *b = b_;
+ if (a->sort_value < b->sort_value) {
+ return 1;
+ }
+ else if (a->sort_value > b->sort_value) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
}