mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
lint
This commit is contained in:
parent
8fd12805d7
commit
1dd98a03aa
@ -23,19 +23,19 @@ struct eslist_elem {
|
|||||||
#define CSTACK_LEN 50
|
#define CSTACK_LEN 50
|
||||||
|
|
||||||
struct condstack {
|
struct condstack {
|
||||||
short cs_flags[CSTACK_LEN]; /* CSF_ flags */
|
int cs_flags[CSTACK_LEN]; // CSF_ flags
|
||||||
char cs_pending[CSTACK_LEN]; /* CSTP_: what's pending in ":finally"*/
|
char cs_pending[CSTACK_LEN]; // CSTP_: what's pending in ":finally"
|
||||||
union {
|
union {
|
||||||
void *csp_rv[CSTACK_LEN]; /* return typeval for pending return */
|
void *csp_rv[CSTACK_LEN]; // return typeval for pending return
|
||||||
void *csp_ex[CSTACK_LEN]; /* exception for pending throw */
|
void *csp_ex[CSTACK_LEN]; // exception for pending throw
|
||||||
} cs_pend;
|
} cs_pend;
|
||||||
void *cs_forinfo[CSTACK_LEN]; /* info used by ":for" */
|
void *cs_forinfo[CSTACK_LEN]; // info used by ":for"
|
||||||
int cs_line[CSTACK_LEN]; /* line nr of ":while"/":for" line */
|
int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line
|
||||||
int cs_idx; /* current entry, or -1 if none */
|
int cs_idx; // current entry, or -1 if none
|
||||||
int cs_looplevel; /* nr of nested ":while"s and ":for"s */
|
int cs_looplevel; // nr of nested ":while"s and ":for"s
|
||||||
int cs_trylevel; /* nr of nested ":try"s */
|
int cs_trylevel; // nr of nested ":try"s
|
||||||
eslist_T *cs_emsg_silent_list; /* saved values of "emsg_silent" */
|
eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent"
|
||||||
int cs_lflags; /* loop flags: CSL_ flags */
|
int cs_lflags; // loop flags: CSL_ flags
|
||||||
};
|
};
|
||||||
# define cs_rettv cs_pend.csp_rv
|
# define cs_rettv cs_pend.csp_rv
|
||||||
# define cs_exception cs_pend.csp_ex
|
# define cs_exception cs_pend.csp_ex
|
||||||
|
@ -1762,7 +1762,7 @@ static void cs_print_tags_priv(char **matches, char **cntxts,
|
|||||||
static int cs_read_prompt(size_t i)
|
static int cs_read_prompt(size_t i)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
char *buf = NULL; /* buffer for possible error message from cscope */
|
char *buf = NULL; // buffer for possible error message from cscope
|
||||||
size_t bufpos = 0;
|
size_t bufpos = 0;
|
||||||
char *cs_emsg = _("E609: Cscope error: %s");
|
char *cs_emsg = _("E609: Cscope error: %s");
|
||||||
size_t cs_emsg_len = strlen(cs_emsg);
|
size_t cs_emsg_len = strlen(cs_emsg);
|
||||||
@ -1774,35 +1774,34 @@ static int cs_read_prompt(size_t i)
|
|||||||
size_t maxlen = IOSIZE - cs_emsg_len;
|
size_t maxlen = IOSIZE - cs_emsg_len;
|
||||||
|
|
||||||
for (;; ) {
|
for (;; ) {
|
||||||
while ((ch = getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
|
while ((ch = getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0]) {
|
||||||
/* if there is room and char is printable */
|
// if there is room and char is printable
|
||||||
if (bufpos < maxlen - 1 && vim_isprintc(ch)) {
|
if (bufpos < maxlen - 1 && vim_isprintc(ch)) {
|
||||||
// lazy buffer allocation
|
// lazy buffer allocation
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
buf = xmalloc(maxlen);
|
buf = xmalloc(maxlen);
|
||||||
}
|
}
|
||||||
{
|
// append character to the message
|
||||||
/* append character to the message */
|
buf[bufpos++] = (char)ch;
|
||||||
buf[bufpos++] = (char)ch;
|
buf[bufpos] = NUL;
|
||||||
|
if (bufpos >= epromptlen
|
||||||
|
&& strcmp(&buf[bufpos - epromptlen], eprompt) == 0) {
|
||||||
|
// remove eprompt from buf
|
||||||
|
buf[bufpos - epromptlen] = NUL;
|
||||||
|
|
||||||
|
// print message to user
|
||||||
|
(void)EMSG2(cs_emsg, buf);
|
||||||
|
|
||||||
|
// send RETURN to cscope
|
||||||
|
(void)putc('\n', csinfo[i].to_fp);
|
||||||
|
(void)fflush(csinfo[i].to_fp);
|
||||||
|
|
||||||
|
// clear buf
|
||||||
|
bufpos = 0;
|
||||||
buf[bufpos] = NUL;
|
buf[bufpos] = NUL;
|
||||||
if (bufpos >= epromptlen
|
|
||||||
&& strcmp(&buf[bufpos - epromptlen], eprompt) == 0) {
|
|
||||||
/* remove eprompt from buf */
|
|
||||||
buf[bufpos - epromptlen] = NUL;
|
|
||||||
|
|
||||||
/* print message to user */
|
|
||||||
(void)EMSG2(cs_emsg, buf);
|
|
||||||
|
|
||||||
/* send RETURN to cscope */
|
|
||||||
(void)putc('\n', csinfo[i].to_fp);
|
|
||||||
(void)fflush(csinfo[i].to_fp);
|
|
||||||
|
|
||||||
/* clear buf */
|
|
||||||
bufpos = 0;
|
|
||||||
buf[bufpos] = NUL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t n = 0; n < strlen(CSCOPE_PROMPT); ++n) {
|
for (size_t n = 0; n < strlen(CSCOPE_PROMPT); ++n) {
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user