diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 1 | ||||
-rw-r--r-- | src/ex_cmds.c | 1 | ||||
-rw-r--r-- | src/ex_getln.c | 1 | ||||
-rw-r--r-- | src/misc2.c | 39 | ||||
-rw-r--r-- | src/normal.c | 1 | ||||
-rw-r--r-- | src/option.c | 1 | ||||
-rw-r--r-- | src/path.c | 2 | ||||
-rw-r--r-- | src/proto.h | 5 | ||||
-rw-r--r-- | src/spell.c | 1 | ||||
-rw-r--r-- | src/syntax.c | 1 |
10 files changed, 9 insertions, 44 deletions
diff --git a/src/eval.c b/src/eval.c index b0ed49a862..ad780e3024 100644 --- a/src/eval.c +++ b/src/eval.c @@ -12,6 +12,7 @@ */ #include <string.h> +#include <stdlib.h> #include "vim.h" #include "eval.h" diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 74335c3991..3d177b86af 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -12,6 +12,7 @@ */ #include <string.h> +#include <stdlib.h> #include "vim.h" #include "version_defs.h" diff --git a/src/ex_getln.c b/src/ex_getln.c index 8eeb782c76..89ff9b6c0e 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -12,6 +12,7 @@ */ #include <string.h> +#include <stdlib.h> #include "vim.h" #include "arabic.h" 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. */ diff --git a/src/normal.c b/src/normal.c index 429dbea7b0..0646a62fcf 100644 --- a/src/normal.c +++ b/src/normal.c @@ -13,6 +13,7 @@ */ #include <string.h> +#include <stdlib.h> #include "vim.h" #include "normal.h" diff --git a/src/option.c b/src/option.c index 9195ceed02..ed66b9f442 100644 --- a/src/option.c +++ b/src/option.c @@ -33,6 +33,7 @@ #define IN_OPTION_C #include <string.h> +#include <stdlib.h> #include "vim.h" #include "option.h" diff --git a/src/path.c b/src/path.c index 0a0907df60..d1b3dcc05c 100644 --- a/src/path.c +++ b/src/path.c @@ -1,3 +1,5 @@ +#include <stdlib.h> + #include "vim.h" #include "path.h" #include "charset.h" diff --git a/src/proto.h b/src/proto.h index ad463bd370..fa538cc2d1 100644 --- a/src/proto.h +++ b/src/proto.h @@ -49,11 +49,6 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs) #ifndef HAVE_STRPBRK /* not generated automatically from misc2.c */ char_u *vim_strpbrk(char_u *s, char_u *charset); #endif -#ifndef HAVE_QSORT -/* Use our own qsort(), don't define the prototype when not used. */ -void qsort(void *base, size_t elm_count, size_t elm_size, - int (*cmp)(const void *, const void *)); -#endif /* Ugly solution for "BalloonEval" not being defined while it's used in some * .pro files. */ diff --git a/src/spell.c b/src/spell.c index 37a3ee6d05..6df0e340a1 100644 --- a/src/spell.c +++ b/src/spell.c @@ -298,6 +298,7 @@ */ #include <string.h> +#include <stdlib.h> #include "vim.h" #include "spell.h" diff --git a/src/syntax.c b/src/syntax.c index 23d893f9e6..73db29bc49 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -12,6 +12,7 @@ */ #include <string.h> +#include <stdlib.h> #include "vim.h" #include "syntax.h" |