mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -1583,7 +1583,7 @@ static void foldAddMarker(buf_T *buf, pos_T pos, const char *marker, size_t mark
|
||||
|
||||
// Allocate a new line: old-line + 'cms'-start + marker + 'cms'-end
|
||||
char *line = ml_get_buf(buf, lnum, false);
|
||||
size_t line_len = STRLEN(line);
|
||||
size_t line_len = strlen(line);
|
||||
size_t added = 0;
|
||||
|
||||
if (u_save(lnum - 1, lnum + 1) == OK) {
|
||||
@@ -3249,14 +3249,14 @@ void f_foldtext(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
}
|
||||
|
||||
// Find interesting text in this line.
|
||||
char_u *s = (char_u *)skipwhite(ml_get(lnum));
|
||||
char *s = skipwhite(ml_get(lnum));
|
||||
// skip C comment-start
|
||||
if (s[0] == '/' && (s[1] == '*' || s[1] == '/')) {
|
||||
s = (char_u *)skipwhite((char *)s + 2);
|
||||
if (*skipwhite((char *)s) == NUL && lnum + 1 < foldend) {
|
||||
s = (char_u *)skipwhite(ml_get(lnum + 1));
|
||||
s = skipwhite(s + 2);
|
||||
if (*skipwhite(s) == NUL && lnum + 1 < foldend) {
|
||||
s = skipwhite(ml_get(lnum + 1));
|
||||
if (*s == '*') {
|
||||
s = (char_u *)skipwhite((char *)s + 1);
|
||||
s = skipwhite(s + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3265,7 +3265,7 @@ void f_foldtext(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
size_t len = strlen(txt)
|
||||
+ strlen(dashes) // for %s
|
||||
+ 20 // for %3ld
|
||||
+ STRLEN(s); // concatenated
|
||||
+ strlen(s); // concatenated
|
||||
char *r = xmalloc(len);
|
||||
snprintf(r, len, txt, dashes, count);
|
||||
len = strlen(r);
|
||||
|
Reference in New Issue
Block a user