summaryrefslogtreecommitdiff
path: root/src/tsort.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-03-11 16:43:58 -0700
committerRussell Belfer <rb@github.com>2013-03-11 16:43:58 -0700
commit62beacd300a6d3c62943723928f45ef852485e62 (patch)
tree88ec71b10d83cc0133ee39c3802f012fd4e2df83 /src/tsort.c
parenta5eea2d7b760ebef0d2f397d763ec8eff32f38cd (diff)
downloadlibgit2-62beacd300a6d3c62943723928f45ef852485e62.tar.gz
Sorting function cleanup and MinGW fix
Clean up some sorting function stuff including fixing qsort_r on MinGW, common function pointer type for comparison, and basic insertion sort implementation (which we, regrettably, fall back on for MinGW).
Diffstat (limited to 'src/tsort.c')
-rw-r--r--src/tsort.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tsort.c b/src/tsort.c
index 97473be91..4885e435b 100644
--- a/src/tsort.c
+++ b/src/tsort.c
@@ -24,7 +24,7 @@
#endif
static int binsearch(
- void **dst, const void *x, size_t size, git__tsort_r_cmp cmp, void *payload)
+ void **dst, const void *x, size_t size, git__sort_r_cmp cmp, void *payload)
{
int l, c, r;
void *lx, *cx;
@@ -71,7 +71,7 @@ static int binsearch(
/* Binary insertion sort, but knowing that the first "start" entries are sorted. Used in timsort. */
static void bisort(
- void **dst, size_t start, size_t size, git__tsort_r_cmp cmp, void *payload)
+ void **dst, size_t start, size_t size, git__sort_r_cmp cmp, void *payload)
{
size_t i;
void *x;
@@ -102,7 +102,7 @@ struct tsort_run {
struct tsort_store {
size_t alloc;
- git__tsort_r_cmp cmp;
+ git__sort_r_cmp cmp;
void *payload;
void **storage;
};
@@ -334,7 +334,7 @@ static ssize_t collapse(void **dst, struct tsort_run *stack, ssize_t stack_curr,
while (0)
void git__tsort_r(
- void **dst, size_t size, git__tsort_r_cmp cmp, void *payload)
+ void **dst, size_t size, git__sort_r_cmp cmp, void *payload)
{
struct tsort_store _store, *store = &_store;
struct tsort_run run_stack[128];