diff options
author | oni-link <knil.ino@gmail.com> | 2014-03-31 22:20:59 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-31 21:24:59 -0300 |
commit | f9b5ca8b857b425635557dda9e587a7c43d1739a (patch) | |
tree | 24d338cfc352d6efef0b6abbc4956609ca207fe4 /src/misc2.c | |
parent | 7b14caf6044769483bb6fef9ee8dc71003f91494 (diff) | |
download | rneovim-f9b5ca8b857b425635557dda9e587a7c43d1739a.tar.gz rneovim-f9b5ca8b857b425635557dda9e587a7c43d1739a.tar.bz2 rneovim-f9b5ca8b857b425635557dda9e587a7c43d1739a.zip |
Remove feature HAVE_QSORT
qsort conforms to C99, so we don't need our own version.
Diffstat (limited to 'src/misc2.c')
-rw-r--r-- | src/misc2.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/misc2.c b/src/misc2.c index 703ec6d304..30ebb88b66 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1701,45 +1701,6 @@ int vim_chdir(char_u *new_dir) return r; } -#ifndef HAVE_QSORT -/* - * Our own qsort(), for systems that don't have it. - * It's simple and slow. From the K&R C book. - */ -void qsort(base, elm_count, elm_size, cmp) -void *base; -size_t elm_count; -size_t elm_size; -int (*cmp)(const void *, const void *); -{ - char_u *buf; - char_u *p1; - char_u *p2; - int i, j; - int gap; - - buf = alloc((unsigned)elm_size); - if (buf == NULL) - return; - - for (gap = elm_count / 2; gap > 0; gap /= 2) - for (i = gap; i < elm_count; ++i) - for (j = i - gap; j >= 0; j -= gap) { - /* Compare the elements. */ - p1 = (char_u *)base + j * elm_size; - p2 = (char_u *)base + (j + gap) * elm_size; - if ((*cmp)((void *)p1, (void *)p2) <= 0) - break; - /* Exchange the elements. */ - memmove(buf, p1, elm_size); - memmove(p1, p2, elm_size); - memmove(p2, buf, elm_size); - } - - vim_free(buf); -} -#endif - /* * Sort an array of strings. */ |