diff options
author | ZyX <kp-pav@yandex.ru> | 2016-07-29 21:41:45 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-02-15 02:48:33 +0300 |
commit | efa2682e3b513c4a33d987dc651db5913feff21a (patch) | |
tree | 46736cfd53da15a607a332afc79f8359f50bd455 /src/nvim/charset.c | |
parent | 2a50ff7e2fa724fc748068ba19012239886b74dd (diff) | |
download | rneovim-efa2682e3b513c4a33d987dc651db5913feff21a.tar.gz rneovim-efa2682e3b513c4a33d987dc651db5913feff21a.tar.bz2 rneovim-efa2682e3b513c4a33d987dc651db5913feff21a.zip |
*: Partial string handling refactoring
Main points:
- Replace `char_u` with `char` in some cases.
- Remove `str[len] = NUL` hack in some cases when `str` may be considered
`const`.
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r-- | src/nvim/charset.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 4d150c3230..e33e002787 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1373,17 +1373,17 @@ void getvcols(win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, /// skipwhite: skip over ' ' and '\t'. /// -/// @param q +/// @param[in] q String to skip in. /// /// @return Pointer to character after the skipped whitespace. -char_u* skipwhite(char_u *q) +char_u *skipwhite(const char_u *q) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { - char_u *p = q; + const char_u *p = q; while (ascii_iswhite(*p)) { - // skip to next non-white p++; } - return p; + return (char_u *)p; } /// skip over digits |