aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/if_cscope.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-28 02:17:51 +0300
committerZyX <kp-pav@yandex.ru>2017-03-29 10:08:46 +0300
commita1d590a08bd9d40d0e20a9907381573c2d069738 (patch)
tree3a896ce0e15e28f6a74e61c2007dae373f845e04 /src/nvim/if_cscope.c
parent114eaa15f009cbd3e3deb177a2a67affa430fbb8 (diff)
downloadrneovim-a1d590a08bd9d40d0e20a9907381573c2d069738.tar.gz
rneovim-a1d590a08bd9d40d0e20a9907381573c2d069738.tar.bz2
rneovim-a1d590a08bd9d40d0e20a9907381573c2d069738.zip
*: Use const char * in set_one_cmd_context
Also renames functions added in master and renamed here.
Diffstat (limited to 'src/nvim/if_cscope.c')
-rw-r--r--src/nvim/if_cscope.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 550d256de5..b647b8146a 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -140,31 +140,30 @@ char_u *get_cscope_name(expand_T *xp, int idx)
/*
* Handle command line completion for :cscope command.
*/
-void set_context_in_cscope_cmd(expand_T *xp, char_u *arg, cmdidx_T cmdidx)
+void set_context_in_cscope_cmd(expand_T *xp, const char *arg, cmdidx_T cmdidx)
{
- char_u *p;
-
- /* Default: expand subcommands */
+ // Default: expand subcommands.
xp->xp_context = EXPAND_CSCOPE;
- xp->xp_pattern = arg;
- expand_what = (cmdidx == CMD_scscope)
- ? EXP_SCSCOPE_SUBCMD : EXP_CSCOPE_SUBCMD;
+ xp->xp_pattern = (char_u *)arg;
+ expand_what = ((cmdidx == CMD_scscope)
+ ? EXP_SCSCOPE_SUBCMD : EXP_CSCOPE_SUBCMD);
/* (part of) subcommand already typed */
if (*arg != NUL) {
- p = skiptowhite(arg);
- if (*p != NUL) { /* past first word */
- xp->xp_pattern = skipwhite(p);
- if (*skiptowhite(xp->xp_pattern) != NUL)
+ const char *p = (const char *)skiptowhite((const char_u *)arg);
+ if (*p != NUL) { // Past first word.
+ xp->xp_pattern = skipwhite((const char_u *)p);
+ if (*skiptowhite(xp->xp_pattern) != NUL) {
xp->xp_context = EXPAND_NOTHING;
- else if (STRNICMP(arg, "add", p - arg) == 0)
+ } else if (STRNICMP(arg, "add", p - arg) == 0) {
xp->xp_context = EXPAND_FILES;
- else if (STRNICMP(arg, "kill", p - arg) == 0)
+ } else if (STRNICMP(arg, "kill", p - arg) == 0) {
expand_what = EXP_CSCOPE_KILL;
- else if (STRNICMP(arg, "find", p - arg) == 0)
+ } else if (STRNICMP(arg, "find", p - arg) == 0) {
expand_what = EXP_CSCOPE_FIND;
- else
+ } else {
xp->xp_context = EXPAND_NOTHING;
+ }
}
}
}