mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
*: 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`.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user