summaryrefslogtreecommitdiff
path: root/src/stdlib/qsort_nr.c
AgeCommit message (Collapse)AuthorLines
2022-05-06fix constraint violation in qsort wrapper around qsort_rRich Felker-1/+1
function pointer types do not implicitly convert to void *. a cast is required here.
2021-09-23add qsort_r and make qsort a wrapper around itÉrico Nogueira-0/+14
we make qsort a wrapper by providing a wrapper_cmp function that uses the extra argument as a function pointer. should be optimized to a tail call on most architectures, as long as it's built with -fomit-frame-pointer, so the performance impact should be minimal. to keep the git history clean, for now qsort_r is implemented in qsort.c and qsort is implemented in qsort_nr.c. qsort.c also received a few trivial cleanups, including replacing (*cmp)() calls with cmp(). qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper itself.