Bram,
gcc complains when compiling latest Vim version (7.3.1090) with
In file included from regexp.c:7864:0:
regexp_nfa.c: In function 'nfa_regpiece':
regexp_nfa.c:1390:19: warning: declaration of 'new_state' shadows a global
declaration [-Wshadow]
regexp_nfa.c:270:21: warning: shadowed declaration is here [-Wshadow]
regexp_nfa.c: In function 'nfa_regtry':
regexp_nfa.c:4727:7: warning: declaration of 'i' shadows a previous local
[-Wshadow]
regexp_nfa.c:4638:10: warning: shadowed declaration is here [-Wshadow]
Attached patch fixes it.
regards,
Christian
--
Die Voraussetzung für einen freien Staat ist ein Maximun an
Öffentlichkeit.
-- Karl Jaspers
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1387,7 +1387,7 @@
long minval, maxval;
int greedy = TRUE; /* Braces are prefixed with '-' ? */
parse_state_T old_state;
- parse_state_T new_state;
+ parse_state_T c_new_state;
int c2;
int old_post_pos;
int my_post_start;
@@ -1527,7 +1527,7 @@
/* Ignore previous call to nfa_regatom() */
post_ptr = post_start + my_post_start;
/* Save parse state after the repeated atom and the \{} */
- save_parse_state(&new_state);
+ save_parse_state(&c_new_state);
quest = (greedy == TRUE? NFA_QUEST : NFA_QUEST_NONGREEDY);
for (i = 0; i < maxval; i++)
@@ -1557,7 +1557,7 @@
}
/* Go to just after the repeated atom and the \{} */
- restore_parse_state(&new_state);
+ restore_parse_state(&c_new_state);
curchr = -1;
break;
@@ -4724,29 +4724,29 @@
if (prog->reghasz == REX_SET)
{
- int i;
+ int j;
cleanup_zsubexpr();
re_extmatch_out = make_extmatch();
- for (i = 0; i < subs.synt.in_use; i++)
+ for (j = 0; j < subs.synt.in_use; j++)
{
if (REG_MULTI)
{
- struct multipos *mpos = &subs.synt.list.multi[i];
+ struct multipos *mpos = &subs.synt.list.multi[j];
/* Only accept single line matches. */
if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum)
- re_extmatch_out->matches[i] =
+ re_extmatch_out->matches[j] =
vim_strnsave(reg_getline(mpos->start.lnum)
+ mpos->start.col,
mpos->end.col - mpos->start.col);
}
else
{
- struct linepos *lpos = &subs.synt.list.line[i];
+ struct linepos *lpos = &subs.synt.list.line[j];
if (lpos->start != NULL && lpos->end != NULL)
- re_extmatch_out->matches[i] =
+ re_extmatch_out->matches[j] =
vim_strnsave(lpos->start,
(int)(lpos->end - lpos->start));
}