diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-02 11:24:02 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-02 11:24:02 -0300 |
commit | cab8cf970c09ea465d30e11eb356e2e5d37dc544 (patch) | |
tree | 5d274c892e4d53f5e976ae8f6f58aba030785e02 /src/nvim/strings.c | |
parent | 52a9a5b0b0c53a1481d901f39ed0d1e7e86c3853 (diff) | |
parent | 4aecb71b0e819aa84a430dacdab2146229c410a5 (diff) | |
download | rneovim-cab8cf970c09ea465d30e11eb356e2e5d37dc544.tar.gz rneovim-cab8cf970c09ea465d30e11eb356e2e5d37dc544.tar.bz2 rneovim-cab8cf970c09ea465d30e11eb356e2e5d37dc544.zip |
Merge pull request #710 'Automatically generate declarations'
Diffstat (limited to 'src/nvim/strings.c')
-rw-r--r-- | src/nvim/strings.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 70fa43be2c..8c82186e15 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -43,7 +43,7 @@ /* * Copy "string" into newly allocated memory. */ -char_u *vim_strsave(char_u *string) +char_u *vim_strsave(char_u *string) FUNC_ATTR_NONNULL_RET { return (char_u *)xstrdup((char *)string); } @@ -54,7 +54,7 @@ char_u *vim_strsave(char_u *string) * The allocated memory always has size "len + 1", also when "string" is * shorter. */ -char_u *vim_strnsave(char_u *string, int len) +char_u *vim_strnsave(char_u *string, int len) FUNC_ATTR_NONNULL_RET { return (char_u *)strncpy(xmallocz(len), (char *)string, len); } @@ -487,9 +487,10 @@ int vim_isspace(int x) /* * Sort an array of strings. */ -static int -sort_compare(const void *s1, const void *s2); +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "strings.c.generated.h" +#endif static int sort_compare(const void *s1, const void *s2) { return STRCMP(*(char **)s1, *(char **)s2); @@ -519,7 +520,7 @@ int has_non_ascii(char_u *s) * Concatenate two strings and return the result in allocated memory. * Returns NULL when out of memory. */ -char_u *concat_str(char_u *str1, char_u *str2) +char_u *concat_str(char_u *str1, char_u *str2) FUNC_ATTR_NONNULL_RET { size_t l = STRLEN(str1); char_u *dest = xmalloc(l + STRLEN(str2) + 1); |