aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/if_cscope.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-08-30 23:23:09 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-08-30 23:23:09 -0600
commit968aa6e3ed0497ea99f123c74c5fd0f3880ccc63 (patch)
tree32ac91852b82d040012d40a3f54f772723509968 /src/nvim/if_cscope.c
parent242f75745009b3a0a2108d98ce6c02b6e13aac3f (diff)
parentf4274d0f62625683486d3912dcd6e8e45877c6a4 (diff)
downloadrneovim-968aa6e3ed0497ea99f123c74c5fd0f3880ccc63.tar.gz
rneovim-968aa6e3ed0497ea99f123c74c5fd0f3880ccc63.tar.bz2
rneovim-968aa6e3ed0497ea99f123c74c5fd0f3880ccc63.zip
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'src/nvim/if_cscope.c')
-rw-r--r--src/nvim/if_cscope.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 689d1fce0d..9413abb2e1 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -153,10 +153,10 @@ void set_context_in_cscope_cmd(expand_T *xp, const char *arg, cmdidx_T cmdidx)
// (part of) subcommand already typed
if (*arg != NUL) {
- const char *p = (const char *)skiptowhite((const char_u *)arg);
+ const char *p = (const char *)skiptowhite(arg);
if (*p != NUL) { // Past first word.
xp->xp_pattern = skipwhite(p);
- if (*skiptowhite((char_u *)xp->xp_pattern) != NUL) {
+ if (*skiptowhite(xp->xp_pattern) != NUL) {
xp->xp_context = EXPAND_NOTHING;
} else if (STRNICMP(arg, "add", p - arg) == 0) {
xp->xp_context = EXPAND_FILES;
@@ -203,19 +203,19 @@ static void do_cscope_general(exarg_T *eap, int make_split)
/// Implementation of ":cscope" and ":lcscope"
void ex_cscope(exarg_T *eap)
{
- do_cscope_general(eap, FALSE);
+ do_cscope_general(eap, false);
}
/// Implementation of ":scscope". Same as ex_cscope(), but splits window, too.
void ex_scscope(exarg_T *eap)
{
- do_cscope_general(eap, TRUE);
+ do_cscope_general(eap, true);
}
/// Implementation of ":cstag"
void ex_cstag(exarg_T *eap)
{
- int ret = FALSE;
+ int ret = false;
if (*eap->arg == NUL) {
(void)emsg(_("E562: Usage: cstag <ident>"));
@@ -278,7 +278,7 @@ void ex_cstag(exarg_T *eap)
/// This simulates a vim_fgets(), but for cscope, returns the next line
/// from the cscope output. should only be called from find_tags()
///
-/// @return true if eof, FALSE otherwise
+/// @return true if eof, false otherwise
bool cs_fgets(char_u *buf, int size)
FUNC_ATTR_NONNULL_ALL
{
@@ -423,7 +423,7 @@ static int cs_add_common(char *arg1, char *arg2, char *flags)
// get the filename (arg1), expand it, and try to stat it
fname = xmalloc(MAXPATHL + 1);
- expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL);
+ expand_env(arg1, fname, MAXPATHL);
size_t len = STRLEN(fname);
fbuf = fname;
(void)modify_fname(":p", false, &usedlen, &fname, &fbuf, &len);
@@ -445,7 +445,7 @@ staterr:
// get the prepend path (arg2), expand it, and see if it exists
if (arg2 != NULL) {
ppath = xmalloc(MAXPATHL + 1);
- expand_env((char_u *)arg2, (char_u *)ppath, MAXPATHL);
+ expand_env(arg2, ppath, MAXPATHL);
if (!os_path_exists((char_u *)ppath)) {
goto staterr;
}
@@ -757,14 +757,14 @@ err_closing:
#endif
// expand the cscope exec for env var's
prog = xmalloc(MAXPATHL + 1);
- expand_env(p_csprg, (char_u *)prog, MAXPATHL);
+ expand_env(p_csprg, prog, MAXPATHL);
// alloc space to hold the cscope command
size_t len = strlen(prog) + strlen(csinfo[i].fname) + 32;
if (csinfo[i].ppath) {
// expand the prepend path for env var's
ppath = xmalloc(MAXPATHL + 1);
- expand_env((char_u *)csinfo[i].ppath, (char_u *)ppath, MAXPATHL);
+ expand_env(csinfo[i].ppath, ppath, MAXPATHL);
len += strlen(ppath);
}
@@ -839,7 +839,7 @@ err_closing:
si.hStdOutput = stdout_wr;
si.hStdError = stdout_wr;
si.hStdInput = stdin_rd;
- created = CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NEW_CONSOLE,
+ created = CreateProcess(NULL, cmd, NULL, NULL, true, CREATE_NEW_CONSOLE,
NULL, NULL, &si, &pi);
xfree(prog);
xfree(cmd);
@@ -875,7 +875,7 @@ err_closing:
/// Query cscope using command line interface. Parse the output and use tselect
/// to allow choices. Like Nvi, creates a pipe to send to/from query/cscope.
///
-/// @return TRUE if we jump to a tag or abort, FALSE if not.
+/// @return true if we jump to a tag or abort, false if not.
static int cs_find(exarg_T *eap)
{
char *opt, *pat;
@@ -900,7 +900,7 @@ static int cs_find(exarg_T *eap)
* Let's replace the NULs written by strtok() with spaces - we need the
* spaces to correctly display the quickfix/location list window's title.
*/
- for (int i = 0; i < eap_arg_len; ++i) {
+ for (int i = 0; i < eap_arg_len; i++) {
if (NUL == eap->arg[i]) {
eap->arg[i] = ' ';
}
@@ -953,7 +953,7 @@ static bool cs_find_common(char *opt, char *pat, int forceit, int verbose, bool
cmdletter = opt[0];
}
- qfpos = vim_strchr((char *)p_csqf, cmdletter);
+ qfpos = vim_strchr(p_csqf, cmdletter);
if (qfpos != NULL) {
qfpos++;
// next symbol must be + or -
@@ -1106,7 +1106,7 @@ static int cs_help(exarg_T *eap)
cmdp++;
}
- wait_return(TRUE);
+ wait_return(true);
return CSCOPE_SUCCESS;
}
@@ -1280,7 +1280,7 @@ static void cs_kill_execute(size_t i, char *cname)
(void)smsg_attr(HL_ATTR(HLF_R) | MSG_HIST,
_("cscope connection %s closed"), cname);
}
- cs_release_csp(i, TRUE);
+ cs_release_csp(i, true);
}
/// Convert the cscope output into a ctags style entry (as might be found
@@ -1838,7 +1838,7 @@ static void cs_release_csp(size_t i, bool freefnpp)
// Can't use sigaction(), loop for two seconds. First yield the CPU
// to give cscope a chance to exit quickly.
sleep(0);
- for (waited = 0; waited < 40; ++waited) {
+ for (waited = 0; waited < 40; waited++) {
pid = waitpid(csinfo[i].pid, &pstat, WNOHANG);
waitpid_errno = errno;
if (pid != 0) {
@@ -1932,7 +1932,7 @@ static int cs_reset(exarg_T *eap)
pplist[i] = csinfo[i].ppath;
fllist[i] = csinfo[i].flags;
if (csinfo[i].fname != NULL) {
- cs_release_csp(i, FALSE);
+ cs_release_csp(i, false);
}
}
@@ -2035,7 +2035,7 @@ static int cs_show(exarg_T *eap)
}
}
- wait_return(TRUE);
+ wait_return(false);
return CSCOPE_SUCCESS;
}