summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorSven Eden <sven.eden@prydeworx.com>2018-10-25 22:57:30 +0200
committerSven Eden <sven.eden@prydeworx.com>2018-11-08 08:02:57 +0100
commit7f32f9ec687306fb78dd275f0a37d07e397ea5e3 (patch)
tree7028b6f97d66058ca09813b4989eb0580b450e4f /src/shared
parentcde7d9c8b5adaa8f7a05c4e32b60668da4499525 (diff)
Prep v240: qsort_r_missing.c : Remove glibc specific bits
Bug: #83 Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/qsort_r_missing.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/shared/qsort_r_missing.c b/src/shared/qsort_r_missing.c
index ae2e63225..8cef9e736 100644
--- a/src/shared/qsort_r_missing.c
+++ b/src/shared/qsort_r_missing.c
@@ -17,8 +17,6 @@
along with elogind; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
-
#include "qsort_r_missing.h"
#if HAVE_QSORT_R == 0
@@ -82,7 +80,7 @@ static void msort_with_tmp ( const struct msort_param* p, void* b, size_t n ) {
char* tmp = p->t;
const size_t s = p->s;
- __compar_d_fn_t cmp = p->cmp;
+ compare_fn_t cmp = p->cmp;
void* arg = p->arg;
switch ( p->var ) {
case 0:
@@ -296,14 +294,14 @@ void qsort_r ( void* b, size_t n, size_t s, compare_fn_t cmp, void* arg ) {
#define SWAP(a, b, size) \
do \
{ \
- size_t __size = (size); \
- char *__a = (a), *__b = (b); \
+ size_t size_ = (size); \
+ char *a_ = (a), *b_ = (b); \
do \
{ \
- char __tmp = *__a; \
- *__a++ = *__b; \
- *__b++ = __tmp; \
- } while (--__size > 0); \
+ char tmp_ = *a_; \
+ *a_++ = *b_; \
+ *b_++ = tmp_; \
+ } while (--size_ > 0); \
} while (0)
/* Discontinue quicksort algorithm when partition gets below this size.