refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
Dundar Goc
2022-07-19 15:30:57 +02:00
parent 9511faa819
commit 824a729628
35 changed files with 454 additions and 496 deletions

View File

@@ -1015,7 +1015,7 @@ static int execreg_lastc = NUL;
/// with a \. Lines that start with a comment "\ character are ignored.
/// @returns the concatenated line. The index of the line that should be
/// processed next is returned in idx.
static char_u *execreg_line_continuation(char_u **lines, size_t *idx)
static char_u *execreg_line_continuation(char **lines, size_t *idx)
{
size_t i = *idx;
assert(i > 0);
@@ -1030,7 +1030,7 @@ static char_u *execreg_line_continuation(char_u **lines, size_t *idx)
// Any line not starting with \ or "\ is the start of the
// command.
while (--i > 0) {
p = (char_u *)skipwhite((char *)lines[i]);
p = (char_u *)skipwhite(lines[i]);
if (*p != '\\' && (p[0] != '"' || p[1] != '\\' || p[2] != ' ')) {
break;
}
@@ -1038,9 +1038,9 @@ static char_u *execreg_line_continuation(char_u **lines, size_t *idx)
const size_t cmd_start = i;
// join all the lines
ga_concat(&ga, (char *)lines[cmd_start]);
ga_concat(&ga, lines[cmd_start]);
for (size_t j = cmd_start + 1; j <= cmd_end; j++) {
p = (char_u *)skipwhite((char *)lines[j]);
p = (char_u *)skipwhite(lines[j]);
if (*p == '\\') {
// Adjust the growsize to the current length to
// speed up concatenating many lines.
@@ -1153,7 +1153,7 @@ int do_execreg(int regname, int colon, int addcr, int silent)
if (colon && i > 0) {
p = (char_u *)skipwhite((char *)str);
if (*p == '\\' || (p[0] == '"' && p[1] == '\\' && p[2] == ' ')) {
str = execreg_line_continuation((char_u **)reg->y_array, &i);
str = execreg_line_continuation(reg->y_array, &i);
free_str = true;
}
}