mirror of
https://github.com/neovim/neovim.git
synced 2025-11-26 04:00:45 +00:00
refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -807,7 +807,7 @@ static void init_locale(void)
|
||||
snprintf(localepath, sizeof(localepath), "%s", get_vim_var_str(VV_PROGPATH));
|
||||
char *tail = (char *)path_tail_with_sep((char_u *)localepath);
|
||||
*tail = NUL;
|
||||
tail = (char *)path_tail((char_u *)localepath);
|
||||
tail = path_tail(localepath);
|
||||
xstrlcpy(tail, "share/locale",
|
||||
sizeof(localepath) - (size_t)(tail - localepath));
|
||||
bindtextdomain(PROJECT_NAME, localepath);
|
||||
@@ -1364,7 +1364,7 @@ scripterror:
|
||||
if (parmp->diff_mode && os_isdir(p) && GARGCOUNT > 0
|
||||
&& !os_isdir(alist_name(&GARGLIST[0]))) {
|
||||
char_u *r = (char_u *)concat_fnames((char *)p,
|
||||
(char *)path_tail(alist_name(&GARGLIST[0])), true);
|
||||
path_tail((char *)alist_name(&GARGLIST[0])), true);
|
||||
xfree(p);
|
||||
p = r;
|
||||
}
|
||||
@@ -1470,7 +1470,7 @@ static void init_path(const char *exename)
|
||||
path_guess_exepath(exename, exepath, sizeof(exepath));
|
||||
}
|
||||
set_vim_var_string(VV_PROGPATH, exepath, -1);
|
||||
set_vim_var_string(VV_PROGNAME, (char *)path_tail((char_u *)exename), -1);
|
||||
set_vim_var_string(VV_PROGNAME, path_tail(exename), -1);
|
||||
|
||||
#ifdef WIN32
|
||||
// Append the process start directory to $PATH, so that ":!foo" finds tools
|
||||
@@ -1813,7 +1813,7 @@ static void exe_pre_commands(mparm_T *parmp)
|
||||
|
||||
if (cnt > 0) {
|
||||
curwin->w_cursor.lnum = 0; // just in case..
|
||||
sourcing_name = (char_u *)_("pre-vimrc command line");
|
||||
sourcing_name = _("pre-vimrc command line");
|
||||
current_sctx.sc_sid = SID_CMDARG;
|
||||
for (i = 0; i < cnt; i++) {
|
||||
do_cmdline_cmd(cmds[i]);
|
||||
@@ -1840,7 +1840,7 @@ static void exe_commands(mparm_T *parmp)
|
||||
if (parmp->tagname == NULL && curwin->w_cursor.lnum <= 1) {
|
||||
curwin->w_cursor.lnum = 0;
|
||||
}
|
||||
sourcing_name = (char_u *)"command line";
|
||||
sourcing_name = "command line";
|
||||
current_sctx.sc_sid = SID_CARG;
|
||||
current_sctx.sc_seq = 0;
|
||||
for (i = 0; i < parmp->n_commands; i++) {
|
||||
@@ -2061,16 +2061,16 @@ static int execute_env(char *env)
|
||||
{
|
||||
const char *initstr = os_getenv(env);
|
||||
if (initstr != NULL) {
|
||||
char_u *save_sourcing_name = sourcing_name;
|
||||
char_u *save_sourcing_name = (char_u *)sourcing_name;
|
||||
linenr_T save_sourcing_lnum = sourcing_lnum;
|
||||
sourcing_name = (char_u *)env;
|
||||
sourcing_name = env;
|
||||
sourcing_lnum = 0;
|
||||
const sctx_T save_current_sctx = current_sctx;
|
||||
current_sctx.sc_sid = SID_ENV;
|
||||
current_sctx.sc_seq = 0;
|
||||
current_sctx.sc_lnum = 0;
|
||||
do_cmdline_cmd((char *)initstr);
|
||||
sourcing_name = save_sourcing_name;
|
||||
sourcing_name = (char *)save_sourcing_name;
|
||||
sourcing_lnum = save_sourcing_lnum;
|
||||
current_sctx = save_current_sctx;
|
||||
return OK;
|
||||
@@ -2104,7 +2104,7 @@ static bool file_owned(const char *fname)
|
||||
static void mainerr(const char *errstr, const char *str)
|
||||
FUNC_ATTR_NORETURN
|
||||
{
|
||||
char *prgname = (char *)path_tail((char_u *)argv0);
|
||||
char *prgname = path_tail(argv0);
|
||||
|
||||
signal_stop(); // kill us with CTRL-C here, if you like
|
||||
|
||||
|
||||
Reference in New Issue
Block a user