diff options
author | Michael Reed <m.reed@mykolab.com> | 2015-05-13 15:29:49 -0400 |
---|---|---|
committer | Michael Reed <m.reed@mykolab.com> | 2015-05-13 15:29:49 -0400 |
commit | 5e60180a1ecd6dd41889f8dc90864a36bf0a4650 (patch) | |
tree | e4c221b80a416691c4387c2b53a439c2611633d8 /src | |
parent | af4b0a76a757f44ea7fbfc8e1c863952adc6ac1e (diff) | |
download | rneovim-5e60180a1ecd6dd41889f8dc90864a36bf0a4650.tar.gz rneovim-5e60180a1ecd6dd41889f8dc90864a36bf0a4650.tar.bz2 rneovim-5e60180a1ecd6dd41889f8dc90864a36bf0a4650.zip |
Remove char_u: ex_docmd:do_cmdline_cmd()
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/vim.c | 6 | ||||
-rw-r--r-- | src/nvim/diff.c | 6 | ||||
-rw-r--r-- | src/nvim/digraph.c | 2 | ||||
-rw-r--r-- | src/nvim/edit.c | 6 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 12 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 12 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 20 | ||||
-rw-r--r-- | src/nvim/farsi.c | 10 | ||||
-rw-r--r-- | src/nvim/main.c | 49 | ||||
-rw-r--r-- | src/nvim/memory.c | 24 | ||||
-rw-r--r-- | src/nvim/normal.c | 14 | ||||
-rw-r--r-- | src/nvim/spell.c | 2 | ||||
-rw-r--r-- | src/nvim/syntax.c | 8 | ||||
-rw-r--r-- | src/nvim/tag.c | 2 | ||||
-rw-r--r-- | src/nvim/terminal.c | 2 | ||||
-rw-r--r-- | src/nvim/window.c | 20 |
16 files changed, 94 insertions, 101 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 1204c9e1d1..22bdbc2ee5 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -41,7 +41,7 @@ void vim_command(String str, Error *err) { // Run the command try_start(); - do_cmdline_cmd((char_u *) str.data); + do_cmdline_cmd(str.data); update_screen(VALID); try_end(err); } @@ -124,9 +124,9 @@ String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, String vim_command_output(String str, Error *err) { - do_cmdline_cmd((char_u *)"redir => v:command_output"); + do_cmdline_cmd("redir => v:command_output"); vim_command(str, err); - do_cmdline_cmd((char_u *)"redir END"); + do_cmdline_cmd("redir END"); if (err->set) { return (String) STRING_INIT; diff --git a/src/nvim/diff.c b/src/nvim/diff.c index b21bc1f2f4..7c1a9de623 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -978,7 +978,7 @@ void ex_diffpatch(exarg_T *eap) // Do filetype detection with the new name. if (au_has_group((char_u *)"filetypedetect")) { - do_cmdline_cmd((char_u *)":doau filetypedetect BufRead"); + do_cmdline_cmd(":doau filetypedetect BufRead"); } } } @@ -1087,7 +1087,7 @@ void diff_win_options(win_T *wp, int addbuf) // make sure topline is not halfway through a fold changed_window_setting_win(wp); if (vim_strchr(p_sbo, 'h') == NULL) { - do_cmdline_cmd((char_u *)"set sbo+=hor"); + do_cmdline_cmd("set sbo+=hor"); } // Saved the current values, to be restored in ex_diffoff(). @@ -1173,7 +1173,7 @@ void ex_diffoff(exarg_T *eap) // Remove "hor" from from 'scrollopt' if there are no diff windows left. if (!diffwin && (vim_strchr(p_sbo, 'h') != NULL)) { - do_cmdline_cmd((char_u *)"set sbo-=hor"); + do_cmdline_cmd("set sbo-=hor"); } } diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 63329c878c..9525024c1b 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1743,7 +1743,7 @@ char_u* keymap_init(void) // Stop any active keymap and clear the table. Also remove // b:keymap_name, as no keymap is active now. keymap_unload(); - do_cmdline_cmd((char_u *)"unlet! b:keymap_name"); + do_cmdline_cmd("unlet! b:keymap_name"); } else { char *buf; size_t buflen; diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 674d4aa512..682a9146f3 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -1049,9 +1049,9 @@ doESCkey: * cursor. */ if (bt_quickfix(curbuf) && c == CAR) { if (curwin->w_llist_ref == NULL) /* quickfix window */ - do_cmdline_cmd((char_u *)".cc"); + do_cmdline_cmd(".cc"); else /* location list window */ - do_cmdline_cmd((char_u *)".ll"); + do_cmdline_cmd(".ll"); break; } if (cmdwin_type != 0) { @@ -2342,7 +2342,7 @@ void ins_compl_show_pum(void) return; /* Dirty hard-coded hack: remove any matchparen highlighting. */ - do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif"); + do_cmdline_cmd("if exists('g:loaded_matchparen')|3match none|endif"); /* Update the screen before drawing the popup menu over it. */ update_screen(0); diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 8cfb2ce2a0..67ff1605f0 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5252,7 +5252,7 @@ void fix_help_buffer(void) */ void ex_exusage(exarg_T *eap) { - do_cmdline_cmd((char_u *)"help ex-cmd-index"); + do_cmdline_cmd("help ex-cmd-index"); } /* @@ -5260,7 +5260,7 @@ void ex_exusage(exarg_T *eap) */ void ex_viusage(exarg_T *eap) { - do_cmdline_cmd((char_u *)"help normal-index"); + do_cmdline_cmd("help normal-index"); } @@ -5973,11 +5973,9 @@ void ex_sign(exarg_T *eap) beginline(BL_WHITE); } else - { /* ... not currently in a window */ - char_u *cmd; - - cmd = xmalloc(STRLEN(buf->b_fname) + 25); - sprintf((char *)cmd, "e +%" PRId64 " %s", + { // ... not currently in a window + char *cmd = xmalloc(STRLEN(buf->b_fname) + 25); + sprintf(cmd, "e +%" PRId64 " %s", (int64_t)lnum, buf->b_fname); do_cmdline_cmd(cmd); xfree(cmd); diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 08d84c2440..b4c159b0db 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -310,7 +310,7 @@ void ex_debug(exarg_T *eap) int debug_break_level_save = debug_break_level; debug_break_level = 9999; - do_cmdline_cmd(eap->arg); + do_cmdline_cmd((char *)eap->arg); debug_break_level = debug_break_level_save; } @@ -2025,14 +2025,13 @@ void ex_compiler(exarg_T *eap) if (*eap->arg == NUL) { /* List all compiler scripts. */ - do_cmdline_cmd((char_u *)"echo globpath(&rtp, 'compiler/*.vim')"); + do_cmdline_cmd("echo globpath(&rtp, 'compiler/*.vim')"); /* ) keep the indenter happy... */ } else { buf = xmalloc(STRLEN(eap->arg) + 14); if (eap->forceit) { /* ":compiler! {name}" sets global options */ - do_cmdline_cmd((char_u *) - "command -nargs=* CompilerSet set <args>"); + do_cmdline_cmd("command -nargs=* CompilerSet set <args>"); } else { /* ":compiler! {name}" sets local options. * To remain backwards compatible "current_compiler" is always @@ -2043,8 +2042,7 @@ void ex_compiler(exarg_T *eap) old_cur_comp = get_var_value((char_u *)"g:current_compiler"); if (old_cur_comp != NULL) old_cur_comp = vim_strsave(old_cur_comp); - do_cmdline_cmd((char_u *) - "command -nargs=* CompilerSet setlocal <args>"); + do_cmdline_cmd("command -nargs=* CompilerSet setlocal <args>"); } do_unlet((char_u *)"g:current_compiler", TRUE); do_unlet((char_u *)"b:current_compiler", TRUE); @@ -2054,7 +2052,7 @@ void ex_compiler(exarg_T *eap) EMSG2(_("E666: compiler not supported: %s"), eap->arg); xfree(buf); - do_cmdline_cmd((char_u *)":delcommand CompilerSet"); + do_cmdline_cmd(":delcommand CompilerSet"); /* Set "b:current_compiler" from "current_compiler". */ p = get_var_value((char_u *)"g:current_compiler"); diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1b616bb579..b3502b42d9 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -289,9 +289,9 @@ do_exmode ( /* * Execute a simple command line. Used for translated commands like "*". */ -int do_cmdline_cmd(char_u *cmd) +int do_cmdline_cmd(char *cmd) { - return do_cmdline(cmd, NULL, NULL, + return do_cmdline((char_u *)cmd, NULL, NULL, DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED); } @@ -4357,7 +4357,7 @@ static void ex_buffer(exarg_T *eap) goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2); } if (eap->do_ecmd_cmd != NULL) { - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); } } } @@ -4370,7 +4370,7 @@ static void ex_bmodified(exarg_T *eap) { goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2); if (eap->do_ecmd_cmd != NULL) { - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); } } @@ -4382,7 +4382,7 @@ static void ex_bnext(exarg_T *eap) { goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2); if (eap->do_ecmd_cmd != NULL) { - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); } } @@ -4396,7 +4396,7 @@ static void ex_bprevious(exarg_T *eap) { goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2); if (eap->do_ecmd_cmd != NULL) { - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); } } @@ -4410,7 +4410,7 @@ static void ex_brewind(exarg_T *eap) { goto_buffer(eap, DOBUF_FIRST, FORWARD, 0); if (eap->do_ecmd_cmd != NULL) { - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); } } @@ -4422,7 +4422,7 @@ static void ex_blast(exarg_T *eap) { goto_buffer(eap, DOBUF_LAST, BACKWARD, 0); if (eap->do_ecmd_cmd != NULL) { - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); } } @@ -6622,7 +6622,7 @@ do_exedit ( readonlymode = n; } else { if (eap->do_ecmd_cmd != NULL) - do_cmdline_cmd(eap->do_ecmd_cmd); + do_cmdline_cmd((char *)eap->do_ecmd_cmd); n = curwin->w_arg_idx_invalid; check_arg_idx(curwin); if (n != curwin->w_arg_idx_invalid) @@ -9423,7 +9423,7 @@ static void ex_terminal(exarg_T *eap) snprintf(ex_cmd, sizeof(ex_cmd), ":enew%s | call termopen(%s%s%s) | startinsert", eap->forceit==TRUE ? "!" : "", lquote, name, rquote); - do_cmdline_cmd((uint8_t *)ex_cmd); + do_cmdline_cmd(ex_cmd); if (name != (char *)p_sh) { xfree(name); diff --git a/src/nvim/farsi.c b/src/nvim/farsi.c index 80ef7cbc13..47a132c0d0 100644 --- a/src/nvim/farsi.c +++ b/src/nvim/farsi.c @@ -1588,8 +1588,8 @@ void conv_to_pvim(void) } // Following lines contains Farsi encoded character. - do_cmdline_cmd((char_u *)"%s/\202\231/\232/g"); - do_cmdline_cmd((char_u *)"%s/\201\231/\370\334/g"); + do_cmdline_cmd("%s/\202\231/\232/g"); + do_cmdline_cmd("%s/\201\231/\370\334/g"); // Assume the screen has been messed up: clear it and redraw. redraw_later(CLEAR); @@ -1603,7 +1603,7 @@ void conv_to_pstd(void) int lnum, llen, i; // Following line contains Farsi encoded character. - do_cmdline_cmd((char_u *)"%s/\232/\202\231/g"); + do_cmdline_cmd("%s/\232/\202\231/g"); for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum) { ptr = ml_get((linenr_T)lnum); llen = (int)STRLEN(ptr); @@ -2044,11 +2044,11 @@ void farsi_fkey(cmdarg_T *cap) if (p_altkeymap) { if (curwin->w_farsi & W_R_L) { p_fkmap = 0; - do_cmdline_cmd((char_u *)"set norl"); + do_cmdline_cmd("set norl"); MSG(""); } else { p_fkmap = 1; - do_cmdline_cmd((char_u *)"set rl"); + do_cmdline_cmd("set rl"); MSG(""); } diff --git a/src/nvim/main.c b/src/nvim/main.c index 4da654e9f4..14781c4886 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -84,10 +84,10 @@ typedef struct { char_u *use_vimrc; /* vimrc from -u argument */ int n_commands; /* no. of commands from + or -c */ - char_u *commands[MAX_ARG_CMDS]; /* commands from + or -c arg. */ + char *commands[MAX_ARG_CMDS]; // commands from + or -c arg char_u cmds_tofree[MAX_ARG_CMDS]; /* commands that need free() */ int n_pre_commands; /* no. of commands from --cmd */ - char_u *pre_commands[MAX_ARG_CMDS]; /* commands from --cmd argument */ + char *pre_commands[MAX_ARG_CMDS]; // commands from --cmd argument int edit_type; /* type of editing to do */ char_u *tagname; /* tag from -t argument */ @@ -286,15 +286,14 @@ int main(int argc, char **argv) } // open terminals when opening files that start with term:// - do_cmdline_cmd((uint8_t *) - "autocmd BufReadCmd term://* " - ":call termopen( " - // Capture the command string - "matchstr(expand(\"<amatch>\"), " - "'\\c\\mterm://\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), " - // capture the working directory - "{'cwd': get(matchlist(expand(\"<amatch>\"), " - "'\\c\\mterm://\\(.\\{-}\\)//'), 1, '')})"); + do_cmdline_cmd("autocmd BufReadCmd term://* " + ":call termopen( " + // Capture the command string + "matchstr(expand(\"<amatch>\"), " + "'\\c\\mterm://\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), " + // capture the working directory + "{'cwd': get(matchlist(expand(\"<amatch>\"), " + "'\\c\\mterm://\\(.\\{-}\\)//'), 1, '')})"); /* Execute --cmd arguments. */ exe_pre_commands(¶ms); @@ -872,9 +871,9 @@ static void command_line_scan(mparm_T *parmp) mainerr(ME_EXTRA_CMD, NULL); argv_idx = -1; /* skip to next argument */ if (argv[0][1] == NUL) - parmp->commands[parmp->n_commands++] = (char_u *)"$"; + parmp->commands[parmp->n_commands++] = "$"; else - parmp->commands[parmp->n_commands++] = (char_u *)&(argv[0][1]); + parmp->commands[parmp->n_commands++] = &(argv[0][1]); } /* * Optional argument. @@ -1116,7 +1115,7 @@ static void command_line_scan(mparm_T *parmp) if (argv[0][argv_idx] != NUL) { if (parmp->n_commands >= MAX_ARG_CMDS) mainerr(ME_EXTRA_CMD, NULL); - parmp->commands[parmp->n_commands++] = (char_u *)argv[0] + parmp->commands[parmp->n_commands++] = argv[0] + argv_idx; argv_idx = -1; break; @@ -1174,10 +1173,10 @@ static void command_line_scan(mparm_T *parmp) p = xmalloc(STRLEN(a) + 4); sprintf((char *)p, "so %s", a); parmp->cmds_tofree[parmp->n_commands] = TRUE; - parmp->commands[parmp->n_commands++] = p; - } else - parmp->commands[parmp->n_commands++] = - (char_u *)argv[0]; + parmp->commands[parmp->n_commands++] = (char *)p; + } else { + parmp->commands[parmp->n_commands++] = argv[0]; + } break; case '-': @@ -1185,8 +1184,7 @@ static void command_line_scan(mparm_T *parmp) /* "--cmd {command}" execute command */ if (parmp->n_pre_commands >= MAX_ARG_CMDS) mainerr(ME_EXTRA_CMD, NULL); - parmp->pre_commands[parmp->n_pre_commands++] = - (char_u *)argv[0]; + parmp->pre_commands[parmp->n_pre_commands++] = argv[0]; } /* "--startuptime <file>" already handled */ break; @@ -1376,9 +1374,9 @@ static char_u *get_fname(mparm_T *parmp) /* Temporarily add '(' and ')' to 'isfname'. These are valid * filename characters but are excluded from 'isfname' to make * "gf" work on a file name in parenthesis (e.g.: see vim.h). */ - do_cmdline_cmd((char_u *)":set isf+=(,)"); + do_cmdline_cmd(":set isf+=(,)"); alist_expand(NULL, 0); - do_cmdline_cmd((char_u *)":set isf&"); + do_cmdline_cmd(":set isf&"); } #endif return alist_name(&GARGLIST[0]); @@ -1438,7 +1436,7 @@ static void handle_tag(char_u *tagname) swap_exists_did_quit = FALSE; vim_snprintf((char *)IObuff, IOSIZE, "ta %s", tagname); - do_cmdline_cmd(IObuff); + do_cmdline_cmd((char *)IObuff); TIME_MSG("jumping to tag"); /* If the user doesn't want to edit the file then we quit here. */ @@ -1715,7 +1713,7 @@ static void edit_buffers(mparm_T *parmp) */ static void exe_pre_commands(mparm_T *parmp) { - char_u **cmds = parmp->pre_commands; + char **cmds = parmp->pre_commands; int cnt = parmp->n_pre_commands; int i; @@ -1904,12 +1902,11 @@ process_env ( int is_viminit /* when TRUE, called for VIMINIT */ ) { - char_u *initstr; char_u *save_sourcing_name; linenr_T save_sourcing_lnum; scid_T save_sid; - initstr = (char_u *)os_getenv((char *)env); + char *initstr = (char *)os_getenv((char *)env); if (initstr != NULL && *initstr != NUL) { if (is_viminit) vimrc_found(NULL, NULL); diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 8628661a98..85d56e3b90 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -498,9 +498,9 @@ void free_all_mem(void) /* Close all tabs and windows. Reset 'equalalways' to avoid redraws. */ p_ea = FALSE; if (first_tabpage->tp_next != NULL) - do_cmdline_cmd((char_u *)"tabonly!"); + do_cmdline_cmd("tabonly!"); if (firstwin != lastwin) - do_cmdline_cmd((char_u *)"only!"); + do_cmdline_cmd("only!"); /* Free all spell info. */ spell_free_all(); @@ -509,18 +509,18 @@ void free_all_mem(void) ex_comclear(NULL); /* Clear menus. */ - do_cmdline_cmd((char_u *)"aunmenu *"); - do_cmdline_cmd((char_u *)"menutranslate clear"); + do_cmdline_cmd("aunmenu *"); + do_cmdline_cmd("menutranslate clear"); /* Clear mappings, abbreviations, breakpoints. */ - do_cmdline_cmd((char_u *)"lmapclear"); - do_cmdline_cmd((char_u *)"xmapclear"); - do_cmdline_cmd((char_u *)"mapclear"); - do_cmdline_cmd((char_u *)"mapclear!"); - do_cmdline_cmd((char_u *)"abclear"); - do_cmdline_cmd((char_u *)"breakdel *"); - do_cmdline_cmd((char_u *)"profdel *"); - do_cmdline_cmd((char_u *)"set keymap="); + do_cmdline_cmd("lmapclear"); + do_cmdline_cmd("xmapclear"); + do_cmdline_cmd("mapclear"); + do_cmdline_cmd("mapclear!"); + do_cmdline_cmd("abclear"); + do_cmdline_cmd("breakdel *"); + do_cmdline_cmd("profdel *"); + do_cmdline_cmd("set keymap="); free_titles(); free_findfile(); diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 3cf3636e23..7b42467184 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -4172,11 +4172,11 @@ static void nv_Zet(cmdarg_T *cap) if (!checkclearopq(cap->oap)) { switch (cap->nchar) { /* "ZZ": equivalent to ":x". */ - case 'Z': do_cmdline_cmd((char_u *)"x"); + case 'Z': do_cmdline_cmd("x"); break; /* "ZQ": equivalent to ":q!" (Elvis compatible). */ - case 'Q': do_cmdline_cmd((char_u *)"q!"); + case 'Q': do_cmdline_cmd("q!"); break; default: clearopbeep(cap->oap); @@ -4392,7 +4392,7 @@ static void nv_ident(cmdarg_T *cap) add_to_history(HIST_SEARCH, buf, true, NUL); (void)normal_search(cap, cmdchar == '*' ? '/' : '?', buf, 0); } else - do_cmdline_cmd(buf); + do_cmdline_cmd((char *)buf); xfree(buf); } @@ -4704,9 +4704,9 @@ static void nv_down(cmdarg_T *cap) /* In a quickfix window a <CR> jumps to the error under the cursor. */ if (bt_quickfix(curbuf) && cap->cmdchar == CAR) if (curwin->w_llist_ref == NULL) - do_cmdline_cmd((char_u *)".cc"); /* quickfix window */ + do_cmdline_cmd(".cc"); /* quickfix window */ else - do_cmdline_cmd((char_u *)".ll"); /* location list window */ + do_cmdline_cmd(".ll"); /* location list window */ else { /* In the cmdline window a <CR> executes the command. */ if (cmdwin_type != 0 && cap->cmdchar == CAR) @@ -6018,7 +6018,7 @@ static void nv_suspend(cmdarg_T *cap) clearop(cap->oap); if (VIsual_active) end_visual_mode(); /* stop Visual mode */ - do_cmdline_cmd((char_u *)"st"); + do_cmdline_cmd("st"); } /* @@ -6045,7 +6045,7 @@ static void nv_g_cmd(cmdarg_T *cap) break; case '&': - do_cmdline_cmd((char_u *)"%s//~/&"); + do_cmdline_cmd("%s//~/&"); break; /* diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 6c6c4eb72a..91db9be282 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -12901,7 +12901,7 @@ void ex_spelldump(exarg_T *eap) get_option_value((char_u*)"spl", &dummy, &spl, OPT_LOCAL); // Create a new empty buffer in a new window. - do_cmdline_cmd((char_u *)"new"); + do_cmdline_cmd("new"); // enable spelling locally in the new window set_option_value((char_u*)"spell", TRUE, (char_u*)"", OPT_LOCAL); diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 0bee42c4a9..d0491ab42b 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -3268,7 +3268,7 @@ static void syn_cmd_reset(exarg_T *eap, int syncing) eap->nextcmd = check_nextcmd(eap->arg); if (!eap->skip) { set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"reset"); - do_cmdline_cmd((char_u *)"runtime! syntax/syncolor.vim"); + do_cmdline_cmd("runtime! syntax/syncolor.vim"); do_unlet((char_u *)"g:syntax_cmd", TRUE); } } @@ -3291,12 +3291,12 @@ static void syn_cmd_off(exarg_T *eap, int syncing) static void syn_cmd_onoff(exarg_T *eap, char *name) { - char_u buf[100]; + char buf[100]; eap->nextcmd = check_nextcmd(eap->arg); if (!eap->skip) { - STRCPY(buf, "so "); - vim_snprintf((char *)buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name); + strcpy(buf, "so "); + vim_snprintf(buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name); do_cmdline_cmd(buf); } } diff --git a/src/nvim/tag.c b/src/nvim/tag.c index a087986685..27834e2577 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -2511,7 +2511,7 @@ jumpto_tag ( check_cursor(); } else { curwin->w_cursor.lnum = 1; /* start command in line 1 */ - do_cmdline_cmd(pbuf); + do_cmdline_cmd((char *)pbuf); retval = OK; } diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 8ee47b2642..9195004a54 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -412,7 +412,7 @@ end: ui_busy_stop(); if (close) { term->opts.close_cb(term->opts.data); - do_cmdline_cmd((uint8_t *)"bwipeout!"); + do_cmdline_cmd("bwipeout!"); } } diff --git a/src/nvim/window.c b/src/nvim/window.c index c97dc22741..ef6b53fe2e 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -87,7 +87,7 @@ do_window ( linenr_T lnum = -1; int type = FIND_DEFINE; size_t len; - char_u cbuf[40]; + char cbuf[40]; if (Prenum == 0) Prenum1 = 1; @@ -124,7 +124,7 @@ do_window ( case Ctrl_HAT: case '^': CHECK_CMDWIN reset_VIsual_and_resel(); /* stop Visual mode */ - cmd_with_count("split #", cbuf, sizeof(cbuf), Prenum); + cmd_with_count("split #", (char_u *)cbuf, sizeof(cbuf), Prenum); do_cmdline_cmd(cbuf); break; @@ -135,12 +135,12 @@ do_window ( newwindow: if (Prenum) /* window height */ - vim_snprintf((char *)cbuf, sizeof(cbuf) - 5, "%" PRId64, (int64_t)Prenum); + vim_snprintf(cbuf, sizeof(cbuf) - 5, "%" PRId64, (int64_t)Prenum); else cbuf[0] = NUL; if (nchar == 'v' || nchar == Ctrl_V) - STRCAT(cbuf, "v"); - STRCAT(cbuf, "new"); + strcat(cbuf, "v"); + strcat(cbuf, "new"); do_cmdline_cmd(cbuf); break; @@ -148,7 +148,7 @@ newwindow: case Ctrl_Q: case 'q': reset_VIsual_and_resel(); /* stop Visual mode */ - cmd_with_count("quit", cbuf, sizeof(cbuf), Prenum); + cmd_with_count("quit", (char_u *)cbuf, sizeof(cbuf), Prenum); do_cmdline_cmd(cbuf); break; @@ -156,7 +156,7 @@ newwindow: case Ctrl_C: case 'c': reset_VIsual_and_resel(); /* stop Visual mode */ - cmd_with_count("close", cbuf, sizeof(cbuf), Prenum); + cmd_with_count("close", (char_u *)cbuf, sizeof(cbuf), Prenum); do_cmdline_cmd(cbuf); break; @@ -164,7 +164,7 @@ newwindow: case Ctrl_Z: case 'z': CHECK_CMDWIN reset_VIsual_and_resel(); /* stop Visual mode */ - do_cmdline_cmd((char_u *)"pclose"); + do_cmdline_cmd("pclose"); break; /* cursor to preview window */ @@ -182,7 +182,7 @@ newwindow: case Ctrl_O: case 'o': CHECK_CMDWIN reset_VIsual_and_resel(); /* stop Visual mode */ - cmd_with_count("only", cbuf, sizeof(cbuf), Prenum); + cmd_with_count("only", (char_u *)cbuf, sizeof(cbuf), Prenum); do_cmdline_cmd(cbuf); break; @@ -430,7 +430,7 @@ wingotofile: * cursor in a new window. */ if (bt_quickfix(curbuf)) { - sprintf((char *)cbuf, "split +%" PRId64 "%s", + sprintf(cbuf, "split +%" PRId64 "%s", (int64_t)curwin->w_cursor.lnum, (curwin->w_llist_ref == NULL) ? "cc" : "ll"); do_cmdline_cmd(cbuf); |