aboutsummaryrefslogtreecommitdiff
path: root/src/nvim
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-13 00:14:46 +0200
committerGitHub <noreply@github.com>2022-05-13 00:14:46 +0200
commitaf9c1e572dc1015b7b8f2a8a09d527f54ca080d3 (patch)
treea6e3279c3e56e24812644ffed88b7990a5e52244 /src/nvim
parente2d3e73748f8dd4a6d7acbfda2d765d1a02dcfb8 (diff)
parent85aae12a6dea48621ea2d24a946b3e7b86f9014d (diff)
downloadrneovim-af9c1e572dc1015b7b8f2a8a09d527f54ca080d3.tar.gz
rneovim-af9c1e572dc1015b7b8f2a8a09d527f54ca080d3.tar.bz2
rneovim-af9c1e572dc1015b7b8f2a8a09d527f54ca080d3.zip
Merge pull request #18489 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
Diffstat (limited to 'src/nvim')
-rw-r--r--src/nvim/autocmd.c80
-rw-r--r--src/nvim/buffer.c22
-rw-r--r--src/nvim/change.c2
-rw-r--r--src/nvim/charset.c6
-rw-r--r--src/nvim/context.c6
-rw-r--r--src/nvim/debugger.c10
-rw-r--r--src/nvim/diff.c20
-rw-r--r--src/nvim/digraph.c2
-rw-r--r--src/nvim/edit.c18
-rw-r--r--src/nvim/eval.c29
-rw-r--r--src/nvim/eval/funcs.c66
-rw-r--r--src/nvim/eval/typval_encode.h4
-rw-r--r--src/nvim/eval/userfunc.c22
-rw-r--r--src/nvim/event/socket.c2
-rw-r--r--src/nvim/ex_cmds.c12
-rw-r--r--src/nvim/ex_cmds2.c52
-rw-r--r--src/nvim/ex_cmds_defs.h2
-rw-r--r--src/nvim/ex_docmd.c98
-rw-r--r--src/nvim/ex_eval.c2
-rw-r--r--src/nvim/ex_getln.c84
-rw-r--r--src/nvim/ex_getln.h2
-rw-r--r--src/nvim/ex_session.c2
-rw-r--r--src/nvim/file_search.c6
-rw-r--r--src/nvim/fileio.c474
-rw-r--r--src/nvim/getchar.c10
-rw-r--r--src/nvim/globals.h8
-rw-r--r--src/nvim/hardcopy.c4
-rw-r--r--src/nvim/if_cscope.c16
-rw-r--r--src/nvim/lua/executor.c4
-rw-r--r--src/nvim/main.c18
-rw-r--r--src/nvim/mbyte.c6
-rw-r--r--src/nvim/memline.c20
-rw-r--r--src/nvim/menu.c8
-rw-r--r--src/nvim/message.c4
-rw-r--r--src/nvim/ops.c26
-rw-r--r--src/nvim/option.c4
-rw-r--r--src/nvim/os/env.c14
-rw-r--r--src/nvim/os/shell.c2
-rw-r--r--src/nvim/os/users.c4
-rw-r--r--src/nvim/path.c35
-rw-r--r--src/nvim/quickfix.c8
-rw-r--r--src/nvim/sign.c16
-rw-r--r--src/nvim/spell.c20
-rw-r--r--src/nvim/spellfile.c28
-rw-r--r--src/nvim/syntax.c34
-rw-r--r--src/nvim/tag.c10
-rw-r--r--src/nvim/undo.c2
-rw-r--r--src/nvim/window.c27
48 files changed, 672 insertions, 679 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index c5b576b106..51a0521231 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1521,11 +1521,10 @@ bool apply_autocmds(event_T event, char_u *fname, char_u *fname_io, bool force,
/// @param exarg Ex command arguments
///
/// @return true if some commands were executed.
-bool apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, bool force, buf_T *buf,
+bool apply_autocmds_exarg(event_T event, char *fname, char *fname_io, bool force, buf_T *buf,
exarg_T *eap)
{
- return apply_autocmds_group(event, (char *)fname, (char *)fname_io, force, AUGROUP_ALL, buf,
- eap);
+ return apply_autocmds_group(event, fname, fname_io, force, AUGROUP_ALL, buf, eap);
}
/// Like apply_autocmds(), but handles the caller's retval. If the script
@@ -1541,14 +1540,14 @@ bool apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, bool f
/// @param[in,out] retval caller's retval
///
/// @return true if some autocommands were executed
-bool apply_autocmds_retval(event_T event, char_u *fname, char_u *fname_io, bool force, buf_T *buf,
+bool apply_autocmds_retval(event_T event, char *fname, char *fname_io, bool force, buf_T *buf,
int *retval)
{
if (should_abort(*retval)) {
return false;
}
- bool did_cmd = apply_autocmds_group(event, (char *)fname, (char *)fname_io, force,
+ bool did_cmd = apply_autocmds_group(event, fname, fname_io, force,
AUGROUP_ALL, buf, NULL);
if (did_cmd && aborting()) {
*retval = FAIL;
@@ -1659,9 +1658,9 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
}
// Save the autocmd_* variables and info about the current buffer.
- char *save_autocmd_fname = (char *)autocmd_fname;
+ char *save_autocmd_fname = autocmd_fname;
int save_autocmd_bufnr = autocmd_bufnr;
- char *save_autocmd_match = (char *)autocmd_match;
+ char *save_autocmd_match = autocmd_match;
int save_autocmd_busy = autocmd_busy;
int save_autocmd_nested = autocmd_nested;
bool save_changed = curbuf->b_changed;
@@ -1675,18 +1674,18 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
|| event == EVENT_OPTIONSET || event == EVENT_MODECHANGED) {
autocmd_fname = NULL;
} else if (fname != NULL && !ends_excmd(*fname)) {
- autocmd_fname = (char_u *)fname;
+ autocmd_fname = fname;
} else if (buf != NULL) {
- autocmd_fname = buf->b_ffname;
+ autocmd_fname = (char *)buf->b_ffname;
} else {
autocmd_fname = NULL;
}
} else {
- autocmd_fname = (char_u *)fname_io;
+ autocmd_fname = fname_io;
}
if (autocmd_fname != NULL) {
// Allocate MAXPATHL for when eval_vars() resolves the fullpath.
- autocmd_fname = vim_strnsave(autocmd_fname, MAXPATHL);
+ autocmd_fname = xstrnsave(autocmd_fname, MAXPATHL);
}
// Set the buffer number to be used for <abuf>.
@@ -1754,11 +1753,11 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
#endif
// Set the name to be used for <amatch>.
- autocmd_match = (char_u *)fname;
+ autocmd_match = fname;
// Don't redraw while doing autocommands.
RedrawingDisabled++;
- char *save_sourcing_name = (char *)sourcing_name;
+ char *save_sourcing_name = sourcing_name;
sourcing_name = NULL; // don't free this one
linenr_T save_sourcing_lnum = sourcing_lnum;
sourcing_lnum = 0; // no line number here
@@ -1793,7 +1792,7 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
did_filetype = true;
}
- char *tail = (char *)path_tail((char_u *)fname);
+ char *tail = path_tail(fname);
// Find first autocommand that matches
AutoPatCmd patcmd;
@@ -1860,12 +1859,12 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
filechangeshell_busy = false;
autocmd_nested = save_autocmd_nested;
xfree(sourcing_name);
- sourcing_name = (char_u *)save_sourcing_name;
+ sourcing_name = save_sourcing_name;
sourcing_lnum = save_sourcing_lnum;
xfree(autocmd_fname);
- autocmd_fname = (char_u *)save_autocmd_fname;
+ autocmd_fname = save_autocmd_fname;
autocmd_bufnr = save_autocmd_bufnr;
- autocmd_match = (char_u *)save_autocmd_match;
+ autocmd_match = save_autocmd_match;
current_sctx = save_current_sctx;
restore_funccal();
if (do_profiling == PROF_YES) {
@@ -1933,7 +1932,7 @@ void block_autocmds(void)
{
// Remember the value of v:termresponse.
if (!is_autocmd_blocked()) {
- old_termresponse = (char *)get_vim_var_str(VV_TERMRESPONSE);
+ old_termresponse = get_vim_var_str(VV_TERMRESPONSE);
}
autocmd_blocked++;
}
@@ -1946,7 +1945,7 @@ void unblock_autocmds(void)
// the autocommands now. Esp. useful when executing a shell command
// during startup (nvim -d).
if (!is_autocmd_blocked()
- && get_vim_var_str(VV_TERMRESPONSE) != (char_u *)old_termresponse) {
+ && get_vim_var_str(VV_TERMRESPONSE) != old_termresponse) {
apply_autocmds(EVENT_TERMRESPONSE, NULL, NULL, false, curbuf);
}
}
@@ -1979,9 +1978,9 @@ void auto_next_pat(AutoPatCmd *apc, int stop_at_last)
if (ap->buflocal_nr == 0
? match_file_pat(NULL,
&ap->reg_prog,
- (char_u *)apc->fname,
- (char_u *)apc->sfname,
- (char_u *)apc->tail,
+ apc->fname,
+ apc->sfname,
+ apc->tail,
ap->allow_dirs)
: ap->buflocal_nr == apc->arg_bufnr) {
const char *const name = event_nr2name(apc->event);
@@ -1991,7 +1990,7 @@ void auto_next_pat(AutoPatCmd *apc, int stop_at_last)
= (STRLEN(s) + strlen(name) + (size_t)ap->patlen + 1);
sourcing_name = xmalloc(sourcing_name_len);
- snprintf((char *)sourcing_name, sourcing_name_len, s, name, ap->pat);
+ snprintf(sourcing_name, sourcing_name_len, s, name, ap->pat);
if (p_verbose >= 8) {
verbose_enter();
smsg(_("Executing %s"), sourcing_name);
@@ -2064,7 +2063,7 @@ static bool call_autocmd_callback(const AutoCmd *ac, const AutoPatCmd *apc)
/// Get next autocommand command.
/// Called by do_cmdline() to get the next line for ":if".
/// @return allocated string, or NULL for end of autocommands.
-char_u *getnextac(int c, void *cookie, int indent, bool do_concat)
+char *getnextac(int c, void *cookie, int indent, bool do_concat)
{
// These arguments are required for do_cmdline.
(void)c;
@@ -2155,7 +2154,7 @@ char_u *getnextac(int c, void *cookie, int indent, bool do_concat)
acp->nextcmd = ac->next;
}
- return (char_u *)retval;
+ return retval;
}
/// Return true if there is a matching autocommand for "fname".
@@ -2165,12 +2164,13 @@ char_u *getnextac(int c, void *cookie, int indent, bool do_concat)
/// @param event event that occurred.
/// @param sfname filename the event occurred in.
/// @param buf buffer the file is open in
-bool has_autocmd(event_T event, char_u *sfname, buf_T *buf) FUNC_ATTR_WARN_UNUSED_RESULT
+bool has_autocmd(event_T event, char *sfname, buf_T *buf)
+ FUNC_ATTR_WARN_UNUSED_RESULT
{
- char *tail = (char *)path_tail(sfname);
+ char *tail = path_tail(sfname);
bool retval = false;
- char *fname = FullName_save((char *)sfname, false);
+ char *fname = FullName_save(sfname, false);
if (fname == NULL) {
return false;
}
@@ -2188,9 +2188,9 @@ bool has_autocmd(event_T event, char_u *sfname, buf_T *buf) FUNC_ATTR_WARN_UNUSE
&& (ap->buflocal_nr == 0
? match_file_pat(NULL,
&ap->reg_prog,
- (char_u *)fname,
+ fname,
sfname,
- (char_u *)tail,
+ tail,
ap->allow_dirs)
: buf != NULL && ap->buflocal_nr == buf->b_fnum)) {
retval = true;
@@ -2208,12 +2208,12 @@ bool has_autocmd(event_T event, char_u *sfname, buf_T *buf) FUNC_ATTR_WARN_UNUSE
// Function given to ExpandGeneric() to obtain the list of autocommand group
// names.
-char_u *expand_get_augroup_name(expand_T *xp, int idx)
+char *expand_get_augroup_name(expand_T *xp, int idx)
{
// Required for ExpandGeneric
(void)xp;
- return (char_u *)augroup_name(idx + 1);
+ return augroup_name(idx + 1);
}
/// @param doautocmd true for :doauto*, false for :autocmd
@@ -2263,7 +2263,7 @@ char *set_context_in_autocmd(expand_T *xp, char *arg, int doautocmd)
}
// Function given to ExpandGeneric() to obtain the list of event names.
-char_u *expand_get_event_name(expand_T *xp, int idx)
+char *expand_get_event_name(expand_T *xp, int idx)
{
// xp is a required parameter to be used with ExpandGeneric
(void)xp;
@@ -2273,14 +2273,14 @@ char_u *expand_get_event_name(expand_T *xp, int idx)
if (name != NULL) {
// skip when not including groups or skip deleted entries
if (!autocmd_include_groups || name == get_deleted_augroup()) {
- return (char_u *)"";
+ return "";
}
- return (char_u *)name;
+ return name;
}
// List event names
- return (char_u *)event_names[idx - next_augroup_id].name;
+ return event_names[idx - next_augroup_id].name;
}
/// Check whether given autocommand is supported
@@ -2373,7 +2373,7 @@ bool au_exists(const char *const arg) FUNC_ATTR_WARN_UNUSED_RESULT
&& (group == AUGROUP_ALL || ap->group == group)
&& (pattern == NULL
|| (buflocal_buf == NULL
- ? FNAMECMP(ap->pat, (char_u *)pattern) == 0
+ ? FNAMECMP(ap->pat, pattern) == 0
: ap->buflocal_nr == buflocal_buf->b_fnum))) {
retval = true;
break;
@@ -2410,7 +2410,7 @@ int aupat_get_buflocal_nr(char *pat, int patlen)
}
// "<buffer=123>"
- if (skipdigits((char_u *)pat + 8) == (char_u *)pat + patlen - 1) {
+ if (skipdigits(pat + 8) == pat + patlen - 1) {
return atoi(pat + 8);
}
}
@@ -2434,10 +2434,10 @@ void aupat_normalize_buflocal_pat(char *dest, char *pat, int patlen, int bufloca
buflocal_nr);
}
-int autocmd_delete_event(int group, event_T event, char_u *pat)
+int autocmd_delete_event(int group, event_T event, char *pat)
FUNC_ATTR_NONNULL_ALL
{
- return do_autocmd_event(event, (char *)pat, false, false, "", true, group);
+ return do_autocmd_event(event, pat, false, false, "", true, group);
}
/// Deletes an autocmd by ID.
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 2c9f997ac1..18c8a2c250 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -111,8 +111,8 @@ static int read_buffer(int read_stdin, exarg_T *eap, int flags)
// the end. This makes it possible to retry when 'fileformat' or
// 'fileencoding' was guessed wrong.
line_count = curbuf->b_ml.ml_line_count;
- retval = readfile(read_stdin ? NULL : curbuf->b_ffname,
- read_stdin ? NULL : curbuf->b_fname,
+ retval = readfile(read_stdin ? NULL : (char *)curbuf->b_ffname,
+ read_stdin ? NULL : (char *)curbuf->b_fname,
line_count, (linenr_T)0, (linenr_T)MAXLNUM, eap,
flags | READ_BUFFER, silent);
if (retval == OK) {
@@ -229,7 +229,7 @@ int open_buffer(int read_stdin, exarg_T *eap, int flags)
}
#endif
- retval = readfile(curbuf->b_ffname, curbuf->b_fname,
+ retval = readfile((char *)curbuf->b_ffname, (char *)curbuf->b_fname,
(linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap,
flags | READ_NEW | (read_fifo ? READ_FIFO : 0), silent);
#ifdef UNIX
@@ -3175,7 +3175,7 @@ void maketitle(void)
SPACE_FOR_FNAME + 1);
buf_p += MIN(size, SPACE_FOR_FNAME);
} else {
- buf_p += transstr_buf((const char *)path_tail(curbuf->b_fname),
+ buf_p += transstr_buf((const char *)path_tail((char *)curbuf->b_fname),
buf_p, SPACE_FOR_FNAME + 1, true);
}
@@ -3285,7 +3285,7 @@ void maketitle(void)
if (buf_spname(curbuf) != NULL) {
buf_p = buf_spname(curbuf);
} else { // use file name only in icon
- buf_p = path_tail(curbuf->b_ffname);
+ buf_p = (char_u *)path_tail((char *)curbuf->b_ffname);
}
*icon_str = NUL;
// Truncate name at 100 bytes.
@@ -3841,7 +3841,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san
if (opt != STL_FILENAME) {
str = (char *)NameBuff;
} else {
- str = (char *)path_tail(NameBuff);
+ str = path_tail((char *)NameBuff);
}
break;
case STL_VIM_EXPR: // '{'
@@ -3909,7 +3909,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san
// Check if the evaluated result is a number.
// If so, convert the number to an int and free the string.
if (str != NULL && *str != 0) {
- if (*skipdigits((char_u *)str) == NUL) {
+ if (*skipdigits(str) == NUL) {
num = atoi(str);
XFREE_CLEAR(str);
itemisflag = false;
@@ -5201,9 +5201,9 @@ static int chk_modeline(linenr_T lnum, int flags)
s = linecopy = vim_strsave(s); // copy the line, it will change
save_sourcing_lnum = sourcing_lnum;
- save_sourcing_name = sourcing_name;
+ save_sourcing_name = (char_u *)sourcing_name;
sourcing_lnum = lnum; // prepare for emsg()
- sourcing_name = (char_u *)"modelines";
+ sourcing_name = "modelines";
end = false;
while (end == false) {
@@ -5259,7 +5259,7 @@ static int chk_modeline(linenr_T lnum, int flags)
}
sourcing_lnum = save_sourcing_lnum;
- sourcing_name = save_sourcing_name;
+ sourcing_name = (char *)save_sourcing_name;
xfree(linecopy);
@@ -5594,7 +5594,7 @@ bool buf_contents_changed(buf_T *buf)
aucmd_prepbuf(&aco, newbuf);
if (ml_open(curbuf) == OK
- && readfile(buf->b_ffname, buf->b_fname,
+ && readfile((char *)buf->b_ffname, (char *)buf->b_fname,
(linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM,
&ea, READ_NEW | READ_DUMMY, false) == OK) {
// compare the two files line by line
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 767e6d3837..b15e90e0bc 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -557,7 +557,7 @@ void ins_char(int c)
if (buf[0] == 0) {
buf[0] = '\n';
}
- ins_char_bytes(buf, n);
+ ins_char_bytes((char_u *)buf, n);
}
void ins_char_bytes(char_u *buf, size_t charlen)
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 5b93973f54..4f6033cbfa 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -1187,16 +1187,16 @@ intptr_t getwhitecols(const char_u *p)
/// @param[in] q String to skip digits in.
///
/// @return Pointer to the character after the skipped digits.
-char_u *skipdigits(const char_u *q)
+char *skipdigits(const char *q)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
FUNC_ATTR_NONNULL_RET
{
- const char_u *p = q;
+ const char *p = q;
while (ascii_isdigit(*p)) {
// skip to next non-digit
p++;
}
- return (char_u *)p;
+ return (char *)p;
}
/// skip over binary digits
diff --git a/src/nvim/context.c b/src/nvim/context.c
index 0e0d8fdfde..db26667009 100644
--- a/src/nvim/context.c
+++ b/src/nvim/context.c
@@ -129,8 +129,8 @@ bool ctx_restore(Context *ctx, const int flags)
free_ctx = true;
}
- char_u *op_shada;
- get_option_value("shada", NULL, (char **)&op_shada, OPT_GLOBAL);
+ char *op_shada;
+ get_option_value("shada", NULL, &op_shada, OPT_GLOBAL);
set_option_value("shada", 0L, "!,'100,%", OPT_GLOBAL);
if (flags & kCtxRegs) {
@@ -157,7 +157,7 @@ bool ctx_restore(Context *ctx, const int flags)
ctx_free(ctx);
}
- set_option_value("shada", 0L, (char *)op_shada, OPT_GLOBAL);
+ set_option_value("shada", 0L, op_shada, OPT_GLOBAL);
xfree(op_shada);
return true;
diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c
index 6fab70d4c2..0f76c3e884 100644
--- a/src/nvim/debugger.c
+++ b/src/nvim/debugger.c
@@ -60,7 +60,7 @@ void do_debug(char_u *cmd)
int save_ignore_script = 0;
int n;
char_u *cmdline = NULL;
- char_u *p;
+ char *p;
char *tail = NULL;
static int last_cmd = 0;
#define CMD_CONT 1
@@ -141,7 +141,7 @@ void do_debug(char_u *cmd)
// If this is a debug command, set "last_cmd".
// If not, reset "last_cmd".
// For a blank line use previous command.
- p = (char_u *)skipwhite((char *)cmdline);
+ p = skipwhite((char *)cmdline);
if (*p != NUL) {
switch (*p) {
case 'c':
@@ -200,7 +200,7 @@ void do_debug(char_u *cmd)
if (last_cmd != 0) {
// Check that the tail matches.
p++;
- while (*p != NUL && *p == (char_u)(*tail)) {
+ while (*p != NUL && *p == *tail) {
p++;
tail++;
}
@@ -242,8 +242,8 @@ void do_debug(char_u *cmd)
if (*p == NUL) {
do_showbacktrace(cmd);
} else {
- p = (char_u *)skipwhite((char *)p);
- do_setdebugtracelevel(p);
+ p = skipwhite(p);
+ do_setdebugtracelevel((char_u *)p);
}
continue;
case CMD_UP:
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 55992f3fae..dcc9b51431 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -744,7 +744,7 @@ static int diff_write_buffer(buf_T *buf, diffin_T *din)
for (char_u *s = ml_get_buf(buf, lnum, false); *s != NUL;) {
if (diff_flags & DIFF_ICASE) {
int c;
- char_u cbuf[MB_MAXBYTES + 1];
+ char cbuf[MB_MAXBYTES + 1];
if (*s == NL) {
c = NUL;
@@ -794,7 +794,7 @@ static int diff_write(buf_T *buf, diffin_T *din)
// Writing the buffer is an implementation detail of performing the diff,
// so it shouldn't update the '[ and '] marks.
cmdmod.lockmarks = true;
- int r = buf_write(buf, din->din_fname, NULL,
+ int r = buf_write(buf, (char *)din->din_fname, NULL,
(linenr_T)1, buf->b_ml.ml_line_count,
NULL, false, false, false, true);
cmdmod.lockmarks = save_lockmarks;
@@ -1178,7 +1178,7 @@ void ex_diffpatch(exarg_T *eap)
}
// Write the current buffer to "tmp_orig".
- if (buf_write(curbuf, tmp_orig, NULL,
+ if (buf_write(curbuf, (char *)tmp_orig, NULL,
(linenr_T)1, curbuf->b_ml.ml_line_count,
NULL, false, false, false, true) == FAIL) {
goto theend;
@@ -1982,8 +1982,8 @@ static int diff_cmp(char_u *s1, char_u *s2)
return mb_stricmp((const char *)s1, (const char *)s2);
}
- char_u *p1 = s1;
- char_u *p2 = s2;
+ char *p1 = (char *)s1;
+ char *p2 = (char *)s2;
// Ignore white space changes and possibly ignore case.
while (*p1 != NUL && *p2 != NUL) {
@@ -1991,11 +1991,11 @@ static int diff_cmp(char_u *s1, char_u *s2)
&& ascii_iswhite(*p1) && ascii_iswhite(*p2))
|| ((diff_flags & DIFF_IWHITEALL)
&& (ascii_iswhite(*p1) || ascii_iswhite(*p2)))) {
- p1 = (char_u *)skipwhite((char *)p1);
- p2 = (char_u *)skipwhite((char *)p2);
+ p1 = skipwhite(p1);
+ p2 = skipwhite(p2);
} else {
int l;
- if (!diff_equal_char(p1, p2, &l)) {
+ if (!diff_equal_char((char_u *)p1, (char_u *)p2, &l)) {
break;
}
p1 += l;
@@ -2004,8 +2004,8 @@ static int diff_cmp(char_u *s1, char_u *s2)
}
// Ignore trailing white space.
- p1 = (char_u *)skipwhite((char *)p1);
- p2 = (char_u *)skipwhite((char *)p2);
+ p1 = skipwhite(p1);
+ p2 = skipwhite(p2);
if ((*p1 != NUL) || (*p2 != NUL)) {
return 1;
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index da96379700..43ea32fc09 100644
--- a/src/nvim/digraph.c
+++ b/src/nvim/digraph.c
@@ -2087,7 +2087,7 @@ void ex_loadkeymap(exarg_T *eap)
// Get each line of the sourced file, break at the end.
for (;;) {
- char_u *line = eap->getline(0, eap->cookie, 0, true);
+ char *line = eap->getline(0, eap->cookie, 0, true);
if (line == NULL) {
break;
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 20bbc23ac4..c2e61271c7 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1325,14 +1325,14 @@ normalchar:
if (!p_paste) {
// Trigger InsertCharPre.
- char_u *str = do_insert_char_pre(s->c);
- char_u *p;
+ char *str = (char *)do_insert_char_pre(s->c);
+ char *p;
if (str != NULL) {
if (*str != NUL && stop_arrow() != FAIL) {
// Insert the new value of v:char literally.
for (p = str; *p != NUL; MB_PTR_ADV(p)) {
- s->c = utf_ptr2char((char *)p);
+ s->c = utf_ptr2char(p);
if (s->c == CAR || s->c == K_KENTER || s->c == NL) {
ins_eol(s->c);
} else {
@@ -3505,11 +3505,11 @@ static void ins_compl_addleader(int c)
return;
}
if ((cc = utf_char2len(c)) > 1) {
- char_u buf[MB_MAXBYTES + 1];
+ char buf[MB_MAXBYTES + 1];
utf_char2bytes(c, (char *)buf);
buf[cc] = NUL;
- ins_char_bytes(buf, (size_t)cc);
+ ins_char_bytes((char_u *)buf, (size_t)cc);
} else {
ins_char(c);
}
@@ -5939,11 +5939,11 @@ void insertchar(int c, int flags, int second_indent)
int cc;
if ((cc = utf_char2len(c)) > 1) {
- char_u buf[MB_MAXBYTES + 1];
+ char buf[MB_MAXBYTES + 1];
utf_char2bytes(c, (char *)buf);
buf[cc] = NUL;
- ins_char_bytes(buf, (size_t)cc);
+ ins_char_bytes((char_u *)buf, (size_t)cc);
AppendCharToRedobuff(c);
} else {
ins_char(c);
@@ -6840,7 +6840,7 @@ char_u *add_char2buf(int c, char_u *s)
char_u temp[MB_MAXBYTES + 1];
const int len = utf_char2bytes(c, (char *)temp);
for (int i = 0; i < len; i++) {
- c = temp[i];
+ c = (uint8_t)temp[i];
// Need to escape K_SPECIAL like in the typeahead buffer.
if (c == K_SPECIAL) {
*s++ = K_SPECIAL;
@@ -9460,7 +9460,7 @@ static char_u *do_insert_char_pre(int c)
// character. Only use it when changed, otherwise continue with the
// original character to avoid breaking autoindent.
if (STRCMP(buf, get_vim_var_str(VV_CHAR)) != 0) {
- res = vim_strsave(get_vim_var_str(VV_CHAR));
+ res = vim_strsave((char