Karsten Hopp 97c8da
To: vim_dev@googlegroups.com
Karsten Hopp 97c8da
Subject: Patch 7.3.1095
Karsten Hopp 97c8da
Fcc: outbox
Karsten Hopp 97c8da
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 97c8da
Mime-Version: 1.0
Karsten Hopp 97c8da
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 97c8da
Content-Transfer-Encoding: 8bit
Karsten Hopp 97c8da
------------
Karsten Hopp 97c8da
Karsten Hopp 97c8da
Patch 7.3.1095
Karsten Hopp 97c8da
Problem:    Compiler warnings for shadowed variables. (Christian Brabandt)
Karsten Hopp 97c8da
Solution:   Rename new_state() to alloc_state().  Remove unnecessary
Karsten Hopp 97c8da
	    declaration.
Karsten Hopp 97c8da
Files:	    src/regexp_nfa.c
Karsten Hopp 97c8da
Karsten Hopp 97c8da
Karsten Hopp 97c8da
*** ../vim-7.3.1094/src/regexp_nfa.c	2013-06-02 16:34:14.000000000 +0200
Karsten Hopp 97c8da
--- src/regexp_nfa.c	2013-06-02 16:38:44.000000000 +0200
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 247,253 ****
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
  static int nstate;	/* Number of states in the NFA. Also used when
Karsten Hopp 97c8da
  			 * executing. */
Karsten Hopp 97c8da
! static int istate;	/* Index in the state vector, used in new_state() */
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
  /* If not NULL match must end at this position */
Karsten Hopp 97c8da
  static save_se_T *nfa_endp = NULL;
Karsten Hopp 97c8da
--- 247,253 ----
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
  static int nstate;	/* Number of states in the NFA. Also used when
Karsten Hopp 97c8da
  			 * executing. */
Karsten Hopp 97c8da
! static int istate;	/* Index in the state vector, used in alloc_state() */
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
  /* If not NULL match must end at this position */
Karsten Hopp 97c8da
  static save_se_T *nfa_endp = NULL;
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 268,274 ****
Karsten Hopp 97c8da
  static void nfa_dump __ARGS((nfa_regprog_T *prog));
Karsten Hopp 97c8da
  #endif
Karsten Hopp 97c8da
  static int *re2post __ARGS((void));
Karsten Hopp 97c8da
! static nfa_state_T *new_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1));
Karsten Hopp 97c8da
  static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size));
Karsten Hopp 97c8da
  static int check_char_class __ARGS((int class, int c));
Karsten Hopp 97c8da
  static void st_error __ARGS((int *postfix, int *end, int *p));
Karsten Hopp 97c8da
--- 268,274 ----
Karsten Hopp 97c8da
  static void nfa_dump __ARGS((nfa_regprog_T *prog));
Karsten Hopp 97c8da
  #endif
Karsten Hopp 97c8da
  static int *re2post __ARGS((void));
Karsten Hopp 97c8da
! static nfa_state_T *alloc_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1));
Karsten Hopp 97c8da
  static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size));
Karsten Hopp 97c8da
  static int check_char_class __ARGS((int class, int c));
Karsten Hopp 97c8da
  static void st_error __ARGS((int *postfix, int *end, int *p));
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2134,2140 ****
Karsten Hopp 97c8da
   * Allocate and initialize nfa_state_T.
Karsten Hopp 97c8da
   */
Karsten Hopp 97c8da
      static nfa_state_T *
Karsten Hopp 97c8da
! new_state(c, out, out1)
Karsten Hopp 97c8da
      int		c;
Karsten Hopp 97c8da
      nfa_state_T	*out;
Karsten Hopp 97c8da
      nfa_state_T	*out1;
Karsten Hopp 97c8da
--- 2134,2140 ----
Karsten Hopp 97c8da
   * Allocate and initialize nfa_state_T.
Karsten Hopp 97c8da
   */
Karsten Hopp 97c8da
      static nfa_state_T *
Karsten Hopp 97c8da
! alloc_state(c, out, out1)
Karsten Hopp 97c8da
      int		c;
Karsten Hopp 97c8da
      nfa_state_T	*out;
Karsten Hopp 97c8da
      nfa_state_T	*out1;
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2431,2437 ****
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e2 = POP();
Karsten Hopp 97c8da
  	    e1 = POP();
Karsten Hopp 97c8da
! 	    s = new_state(NFA_SPLIT, e1.start, e2.start);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, append(e1.out, e2.out)));
Karsten Hopp 97c8da
--- 2431,2437 ----
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e2 = POP();
Karsten Hopp 97c8da
  	    e1 = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_SPLIT, e1.start, e2.start);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, append(e1.out, e2.out)));
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2445,2451 ****
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = new_state(NFA_SPLIT, e.start, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s);
Karsten Hopp 97c8da
--- 2445,2451 ----
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_SPLIT, e.start, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s);
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2460,2466 ****
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = new_state(NFA_SPLIT, NULL, e.start);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s);
Karsten Hopp 97c8da
--- 2460,2466 ----
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_SPLIT, NULL, e.start);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s);
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2475,2481 ****
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = new_state(NFA_SPLIT, e.start, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, append(e.out, list1(&s->out1))));
Karsten Hopp 97c8da
--- 2475,2481 ----
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_SPLIT, e.start, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, append(e.out, list1(&s->out1))));
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2489,2495 ****
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = new_state(NFA_SPLIT, NULL, e.start);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, append(e.out, list1(&s->out))));
Karsten Hopp 97c8da
--- 2489,2495 ----
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_SPLIT, NULL, e.start);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, append(e.out, list1(&s->out))));
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2503,2509 ****
Karsten Hopp 97c8da
  		nstate++;
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
! 	    s = new_state(NFA_SKIP_CHAR, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, list1(&s->out)));
Karsten Hopp 97c8da
--- 2503,2509 ----
Karsten Hopp 97c8da
  		nstate++;
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_SKIP_CHAR, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, list1(&s->out)));
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2526,2537 ****
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s1 = new_state(NFA_END_INVISIBLE, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s1 == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s1);
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
! 	    s = new_state(NFA_START_INVISIBLE, e.start, s1);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG
Karsten Hopp 97c8da
--- 2526,2537 ----
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s1 = alloc_state(NFA_END_INVISIBLE, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s1 == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s1);
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
! 	    s = alloc_state(NFA_START_INVISIBLE, e.start, s1);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2622,2631 ****
Karsten Hopp 97c8da
  	     * empty groups of parenthesis, and empty mbyte chars */
Karsten Hopp 97c8da
  	    if (stackp == stack)
Karsten Hopp 97c8da
  	    {
Karsten Hopp 97c8da
! 		s = new_state(mopen, NULL, NULL);
Karsten Hopp 97c8da
  		if (s == NULL)
Karsten Hopp 97c8da
  		    goto theend;
Karsten Hopp 97c8da
! 		s1 = new_state(mclose, NULL, NULL);
Karsten Hopp 97c8da
  		if (s1 == NULL)
Karsten Hopp 97c8da
  		    goto theend;
Karsten Hopp 97c8da
  		patch(list1(&s->out), s1);
Karsten Hopp 97c8da
--- 2622,2631 ----
Karsten Hopp 97c8da
  	     * empty groups of parenthesis, and empty mbyte chars */
Karsten Hopp 97c8da
  	    if (stackp == stack)
Karsten Hopp 97c8da
  	    {
Karsten Hopp 97c8da
! 		s = alloc_state(mopen, NULL, NULL);
Karsten Hopp 97c8da
  		if (s == NULL)
Karsten Hopp 97c8da
  		    goto theend;
Karsten Hopp 97c8da
! 		s1 = alloc_state(mclose, NULL, NULL);
Karsten Hopp 97c8da
  		if (s1 == NULL)
Karsten Hopp 97c8da
  		    goto theend;
Karsten Hopp 97c8da
  		patch(list1(&s->out), s1);
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2636,2646 ****
Karsten Hopp 97c8da
  	    /* At least one node was emitted before NFA_MOPEN, so
Karsten Hopp 97c8da
  	     * at least one node will be between NFA_MOPEN and NFA_MCLOSE */
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = new_state(mopen, e.start, NULL);   /* `(' */
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
! 	    s1 = new_state(mclose, NULL, NULL);   /* `)' */
Karsten Hopp 97c8da
  	    if (s1 == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s1);
Karsten Hopp 97c8da
--- 2636,2646 ----
Karsten Hopp 97c8da
  	    /* At least one node was emitted before NFA_MOPEN, so
Karsten Hopp 97c8da
  	     * at least one node will be between NFA_MOPEN and NFA_MCLOSE */
Karsten Hopp 97c8da
  	    e = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(mopen, e.start, NULL);   /* `(' */
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
! 	    s1 = alloc_state(mclose, NULL, NULL);   /* `)' */
Karsten Hopp 97c8da
  	    if (s1 == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(e.out, s1);
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2679,2688 ****
Karsten Hopp 97c8da
  		nstate += 2;
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
! 	    s = new_state(*p, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
! 	    s1 = new_state(NFA_SKIP, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s1 == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(list1(&s->out), s1);
Karsten Hopp 97c8da
--- 2679,2688 ----
Karsten Hopp 97c8da
  		nstate += 2;
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
! 	    s = alloc_state(*p, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
! 	    s1 = alloc_state(NFA_SKIP, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s1 == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    patch(list1(&s->out), s1);
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2704,2710 ****
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e1 = POP();
Karsten Hopp 97c8da
! 	    s = new_state(*p, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    s->val = e1.start->c;
Karsten Hopp 97c8da
--- 2704,2710 ----
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
  	    e1 = POP();
Karsten Hopp 97c8da
! 	    s = alloc_state(*p, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    s->val = e1.start->c;
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 2720,2726 ****
Karsten Hopp 97c8da
  		nstate++;
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
! 	    s = new_state(*p, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, list1(&s->out)));
Karsten Hopp 97c8da
--- 2720,2726 ----
Karsten Hopp 97c8da
  		nstate++;
Karsten Hopp 97c8da
  		break;
Karsten Hopp 97c8da
  	    }
Karsten Hopp 97c8da
! 	    s = alloc_state(*p, NULL, NULL);
Karsten Hopp 97c8da
  	    if (s == NULL)
Karsten Hopp 97c8da
  		goto theend;
Karsten Hopp 97c8da
  	    PUSH(frag(s, list1(&s->out)));
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 4742,4749 ****
Karsten Hopp 97c8da
  
Karsten Hopp 97c8da
      if (prog->reghasz == REX_SET)
Karsten Hopp 97c8da
      {
Karsten Hopp 97c8da
- 	int		i;
Karsten Hopp 97c8da
- 
Karsten Hopp 97c8da
  	cleanup_zsubexpr();
Karsten Hopp 97c8da
  	re_extmatch_out = make_extmatch();
Karsten Hopp 97c8da
  	for (i = 0; i < subs.synt.in_use; i++)
Karsten Hopp 97c8da
--- 4742,4747 ----
Karsten Hopp 97c8da
*** ../vim-7.3.1094/src/version.c	2013-06-02 16:34:14.000000000 +0200
Karsten Hopp 97c8da
--- src/version.c	2013-06-02 16:39:59.000000000 +0200
Karsten Hopp 97c8da
***************
Karsten Hopp 97c8da
*** 730,731 ****
Karsten Hopp 97c8da
--- 730,733 ----
Karsten Hopp 97c8da
  {   /* Add new patch number below this line */
Karsten Hopp 97c8da
+ /**/
Karsten Hopp 97c8da
+     1095,
Karsten Hopp 97c8da
  /**/
Karsten Hopp 97c8da
Karsten Hopp 97c8da
-- 
Karsten Hopp 97c8da
Microsoft is to software what McDonalds is to gourmet cooking
Karsten Hopp 97c8da
Karsten Hopp 97c8da
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 97c8da
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 97c8da
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 97c8da
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///