diff options
author | Scott Prager <splinterofchaos@gmail.com> | 2014-12-01 11:42:07 -0500 |
---|---|---|
committer | Scott Prager <splinterofchaos@gmail.com> | 2014-12-06 14:41:21 -0500 |
commit | 4964d65362ca80ba8508cb5f2a03b49510c63631 (patch) | |
tree | 7b6406329341ec14c5e84557dd3c76510bf22cab /src | |
parent | 279c519e33ec7f2b7e12cbd9a3b6c184427c881a (diff) | |
download | rneovim-4964d65362ca80ba8508cb5f2a03b49510c63631.tar.gz rneovim-4964d65362ca80ba8508cb5f2a03b49510c63631.tar.bz2 rneovim-4964d65362ca80ba8508cb5f2a03b49510c63631.zip |
strings: Remove NONNUL_ALL from NULL-taking functions.
vim_strup() is only used in a couple places, with no NULLs possible, so
keep the attribute and remove the NULL check.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/strings.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 20008bca16..1e619b1c6e 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -237,13 +237,9 @@ char_u *vim_strnsave_up(const char_u *string, size_t len) void vim_strup(char_u *p) FUNC_ATTR_NONNULL_ALL { - char_u *p2; char_u c; - - if (p != NULL) { - p2 = p; - while ((c = *p2) != NUL) - *p2++ = (char_u)((c < 'a' || c > 'z') ? c : c - 0x20); + while ((c = *p) != NUL) { + *p++ = (char_u)(c < 'a' || c > 'z' ? c : c - 0x20); } } @@ -525,7 +521,7 @@ void sort_strings(char_u **files, int count) * When "s" is NULL false is returned. */ bool has_non_ascii(const char_u *s) - FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE + FUNC_ATTR_PURE { const char_u *p; |