diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 8788d7ea88..fae5711b9c 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2149,7 +2149,7 @@ static void f_menu_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) tv_list_alloc_ret(rettv, kListLenMayKnow); int modes = MENU_ALL_MODES; if (argvars[1].v_type == VAR_STRING) { - const char_u *const strmodes = (char_u *)tv_get_string(&argvars[1]); + const char *const strmodes = tv_get_string(&argvars[1]); modes = get_menu_cmd_modes(strmodes, false, NULL, NULL); } menu_get((char_u *)tv_get_string(&argvars[0]), modes, rettv->vval.v_list); @@ -3170,7 +3170,7 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (xpc.xp_context == EXPAND_MENUS) { - set_context_in_menu_cmd(&xpc, (char_u *)"menu", xpc.xp_pattern, false); + set_context_in_menu_cmd(&xpc, "menu", xpc.xp_pattern, false); xpc.xp_pattern_len = STRLEN(xpc.xp_pattern); } diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f63fc8610c..6cc915c8c2 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3518,7 +3518,7 @@ const char * set_one_cmd_context( // EX_XFILE: file names are handled above. if (!(ea.argt & EX_XFILE)) { if (context == EXPAND_MENUS) { - return (const char *)set_context_in_menu_cmd(xp, (char_u *)cmd, + return (const char *)set_context_in_menu_cmd(xp, cmd, (char_u *)arg, forceit); } else if (context == EXPAND_COMMANDS) { return arg; @@ -3598,7 +3598,7 @@ const char * set_one_cmd_context( case CMD_tmenu: case CMD_tunmenu: case CMD_popup: case CMD_emenu: return (const char *)set_context_in_menu_cmd( - xp, (char_u *)cmd, (char_u *)arg, forceit); + xp, cmd, (char_u *)arg, forceit); case CMD_colorscheme: xp->xp_context = EXPAND_COLORS; diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 7094d3be90..ac3b7768e6 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -81,7 +81,7 @@ ex_menu(exarg_T *eap) // kFalse for "menu disable vimmenu_T menuarg; - modes = get_menu_cmd_modes(eap->cmd, eap->forceit, &noremap, &unmenu); + modes = get_menu_cmd_modes((char *)eap->cmd, eap->forceit, &noremap, &unmenu); arg = eap->arg; for (;; ) { @@ -912,7 +912,9 @@ static int expand_emenu; /* TRUE for ":emenu" command */ /* * Work out what to complete when doing command line completion of menu names. */ -char_u *set_context_in_menu_cmd(expand_T *xp, char_u *cmd, char_u *arg, int forceit) +char_u *set_context_in_menu_cmd(expand_T *xp, const char *cmd, char_u *arg, + bool forceit) + FUNC_ATTR_NONNULL_ALL { char_u *after_dot; char_u *p; @@ -1178,7 +1180,7 @@ static bool menu_namecmp(const char_u *const name, const char_u *const mname) /// to whether the command is an "unmenu" command. int get_menu_cmd_modes( - const char_u * cmd, + const char *cmd, bool forceit, int *noremap, int *unmenu