aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-11 14:32:56 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-11 14:37:17 -0400
commitd624aea454e7873e3ab94db313dcacdb251490f0 (patch)
treec7e1bd5ed804feb90a1b79098ed68d6b5d83f5dc /src
parent5f4a231e3f239f02aff485ed8b4776c7481c4823 (diff)
downloadrneovim-d624aea454e7873e3ab94db313dcacdb251490f0.tar.gz
rneovim-d624aea454e7873e3ab94db313dcacdb251490f0.tar.bz2
rneovim-d624aea454e7873e3ab94db313dcacdb251490f0.zip
lint
Diffstat (limited to 'src')
-rw-r--r--src/nvim/regexp_nfa.c40
-rw-r--r--src/nvim/spellfile.c6
2 files changed, 26 insertions, 20 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 95dc17f57f..3b905f5efc 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -2038,9 +2038,10 @@ static int nfa_regpiece(void)
break;
} /* end switch */
- if (re_multi_type(peekchr()) != NOT_MULTI)
- /* Can't have a multi follow a multi. */
+ if (re_multi_type(peekchr()) != NOT_MULTI) {
+ // Can't have a multi follow a multi.
EMSG_RET_FAIL(_("E871: (NFA regexp) Can't have a multi follow a multi"));
+ }
return OK;
}
@@ -2453,7 +2454,8 @@ static void nfa_set_code(int c)
}
static FILE *log_fd;
-static char_u e_log_open_failed[] = N_("Could not open temporary log file for writing, displaying on stderr... ");
+static char_u e_log_open_failed[] = N_(
+ "Could not open temporary log file for writing, displaying on stderr... ");
/*
* Print the postfix notation of the current regexp.
@@ -2466,10 +2468,11 @@ static void nfa_postfix_dump(char_u *expr, int retval)
f = fopen(NFA_REGEXP_DUMP_LOG, "a");
if (f != NULL) {
fprintf(f, "\n-------------------------\n");
- if (retval == FAIL)
+ if (retval == FAIL) {
fprintf(f, ">>> NFA engine failed... \n");
- else if (retval == OK)
+ } else if (retval == OK) {
fprintf(f, ">>> NFA engine succeeded !\n");
+ }
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
for (p = post_start; *p && p < post_ptr; p++) {
nfa_set_code(*p);
@@ -5067,8 +5070,9 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start,
fprintf(log_fd, "------------------------------------------\n");
fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput);
fprintf(log_fd,
- ">>> Advanced one character... Current char is %c (code %d) \n", curc,
- (int)curc);
+ ">>> Advanced one character... Current char is %c (code %d) \n",
+ curc,
+ (int)curc);
fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n);
{
int i;
@@ -5100,16 +5104,17 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start,
{
int col;
- if (t->subs.norm.in_use <= 0)
+ if (t->subs.norm.in_use <= 0) {
col = -1;
- else if (REG_MULTI)
+ } else if (REG_MULTI) {
col = t->subs.norm.list.multi[0].start_col;
- else
+ } else {
col = (int)(t->subs.norm.list.line[0].start - regline);
+ }
nfa_set_code(t->state->c);
fprintf(log_fd, "(%d) char %d %s (start col %d)%s... \n",
- abs(t->state->id), (int)t->state->c, code, col,
- pim_info(&t->pim));
+ abs(t->state->id), (int)t->state->c, code, col,
+ pim_info(&t->pim));
}
#endif
@@ -6263,8 +6268,9 @@ static long nfa_regtry(nfa_regprog_T *prog, colnr_T col, proftime_T *tm)
nfa_print_state(f, start);
fprintf(f, "\n\n");
fclose(f);
- } else
+ } else {
EMSG("Could not open temporary log file for writing");
+ }
#endif
clear_sub(&subs.norm);
@@ -6490,10 +6496,10 @@ static regprog_T *nfa_regcomp(char_u *expr, int re_flags)
FILE *f = fopen(NFA_REGEXP_RUN_LOG, "a");
if (f != NULL) {
- fprintf(
- f,
- "\n*****************************\n\n\n\n\tCompiling regexp \"%s\"... hold on !\n",
- expr);
+ fprintf(f,
+ "\n*****************************\n\n\n\n\t"
+ "Compiling regexp \"%s\"... hold on !\n",
+ expr);
fclose(f);
}
}
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index ecf3a52fd3..b8774bd680 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -3032,7 +3032,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
hash_init(&ht);
vim_snprintf((char *)IObuff, IOSIZE,
- _("Reading dictionary file %s..."), fname);
+ _("Reading dictionary file %s..."), fname);
spell_message(spin, IObuff);
// start with a message for the first line
@@ -4998,7 +4998,7 @@ static void sug_write(spellinfo_T *spin, char_u *fname)
}
vim_snprintf((char *)IObuff, IOSIZE,
- _("Writing suggestion file %s..."), fname);
+ _("Writing suggestion file %s..."), fname);
spell_message(spin, IObuff);
// <SUGHEADER>: <fileID> <versionnr> <timestamp>
@@ -5234,7 +5234,7 @@ mkspell (
if (!error && !got_int) {
// Write the info in the spell file.
vim_snprintf((char *)IObuff, IOSIZE,
- _("Writing spell file %s..."), wfname);
+ _("Writing spell file %s..."), wfname);
spell_message(&spin, IObuff);
error = write_vim_spell(&spin, wfname) == FAIL;