Karsten Hopp 60686d
To: vim_dev@googlegroups.com
Karsten Hopp 60686d
Subject: Patch 7.3.977
Karsten Hopp 60686d
Fcc: outbox
Karsten Hopp 60686d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 60686d
Mime-Version: 1.0
Karsten Hopp 60686d
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 60686d
Content-Transfer-Encoding: 8bit
Karsten Hopp 60686d
------------
Karsten Hopp 60686d
Karsten Hopp 60686d
Patch 7.3.977
Karsten Hopp 60686d
Problem:    Compiler warnings on 64 bit Windows.
Karsten Hopp 60686d
Solution:   Add type casts. (Mike Williams)  Also fix some white space and
Karsten Hopp 60686d
	    uncomment what was commented-out for testing.
Karsten Hopp 60686d
Files:	    src/regexp_nfa.c
Karsten Hopp 60686d
Karsten Hopp 60686d
Karsten Hopp 60686d
*** ../vim-7.3.976/src/regexp_nfa.c	2013-05-20 13:55:17.000000000 +0200
Karsten Hopp 60686d
--- src/regexp_nfa.c	2013-05-20 14:24:44.000000000 +0200
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 224,239 ****
Karsten Hopp 60686d
      char_u	*expr;
Karsten Hopp 60686d
      int		re_flags;	    /* see vim_regcomp() */
Karsten Hopp 60686d
  {
Karsten Hopp 60686d
!     int		postfix_size;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      nstate = 0;
Karsten Hopp 60686d
      istate = 0;
Karsten Hopp 60686d
      /* A reasonable estimation for size */
Karsten Hopp 60686d
!     nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      /* Some items blow up in size, such as [A-z].  Add more space for that.
Karsten Hopp 60686d
       * TODO: some patterns may still fail. */
Karsten Hopp 60686d
! //    nstate_max += 1000;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      /* Size for postfix representation of expr. */
Karsten Hopp 60686d
      postfix_size = sizeof(*post_start) * nstate_max;
Karsten Hopp 60686d
--- 224,239 ----
Karsten Hopp 60686d
      char_u	*expr;
Karsten Hopp 60686d
      int		re_flags;	    /* see vim_regcomp() */
Karsten Hopp 60686d
  {
Karsten Hopp 60686d
!     size_t	postfix_size;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      nstate = 0;
Karsten Hopp 60686d
      istate = 0;
Karsten Hopp 60686d
      /* A reasonable estimation for size */
Karsten Hopp 60686d
!     nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      /* Some items blow up in size, such as [A-z].  Add more space for that.
Karsten Hopp 60686d
       * TODO: some patterns may still fail. */
Karsten Hopp 60686d
!     nstate_max += 1000;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      /* Size for postfix representation of expr. */
Karsten Hopp 60686d
      postfix_size = sizeof(*post_start) * nstate_max;
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2177,2183 ****
Karsten Hopp 60686d
  	     * No new state added here. */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate += 0;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e2 = POP();
Karsten Hopp 60686d
--- 2177,2183 ----
Karsten Hopp 60686d
  	     * No new state added here. */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		/* nstate += 0; */
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e2 = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2190,2196 ****
Karsten Hopp 60686d
  	    /* Negation of a character */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate += 0;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e1 = POP();
Karsten Hopp 60686d
--- 2190,2196 ----
Karsten Hopp 60686d
  	    /* Negation of a character */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		/* nstate += 0; */
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e1 = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2204,2210 ****
Karsten Hopp 60686d
  	    /* Alternation */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e2 = POP();
Karsten Hopp 60686d
--- 2204,2210 ----
Karsten Hopp 60686d
  	    /* Alternation */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e2 = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2219,2225 ****
Karsten Hopp 60686d
  	    /* Zero or more */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
--- 2219,2225 ----
Karsten Hopp 60686d
  	    /* Zero or more */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2234,2240 ****
Karsten Hopp 60686d
  	    /* one or zero atoms=> greedy match */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
--- 2234,2240 ----
Karsten Hopp 60686d
  	    /* one or zero atoms=> greedy match */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2248,2254 ****
Karsten Hopp 60686d
  	    /* zero or one atoms => non-greedy match */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
--- 2248,2254 ----
Karsten Hopp 60686d
  	    /* zero or one atoms => non-greedy match */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2262,2268 ****
Karsten Hopp 60686d
  	    /* One or more */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
--- 2262,2268 ----
Karsten Hopp 60686d
  	    /* One or more */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    e = POP();
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2278,2284 ****
Karsten Hopp 60686d
  	     * with max/min count of 0 */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    s = new_state(NFA_SKIP_CHAR, NULL, NULL);
Karsten Hopp 60686d
--- 2278,2284 ----
Karsten Hopp 60686d
  	     * with max/min count of 0 */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    s = new_state(NFA_SKIP_CHAR, NULL, NULL);
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2392,2398 ****
Karsten Hopp 60686d
  	    /* Operands */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate ++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    s = new_state(*p, NULL, NULL);
Karsten Hopp 60686d
--- 2392,2398 ----
Karsten Hopp 60686d
  	    /* Operands */
Karsten Hopp 60686d
  	    if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
! 		nstate++;
Karsten Hopp 60686d
  		break;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    s = new_state(*p, NULL, NULL);
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2407,2413 ****
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
      {
Karsten Hopp 60686d
! 	nstate ++;
Karsten Hopp 60686d
  	return NULL;	/* Return value when counting size is ignored anyway */
Karsten Hopp 60686d
      }
Karsten Hopp 60686d
  
Karsten Hopp 60686d
--- 2407,2413 ----
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      if (nfa_calc_size == TRUE)
Karsten Hopp 60686d
      {
Karsten Hopp 60686d
! 	nstate++;
Karsten Hopp 60686d
  	return NULL;	/* Return value when counting size is ignored anyway */
Karsten Hopp 60686d
      }
Karsten Hopp 60686d
  
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2583,2589 ****
Karsten Hopp 60686d
  		save.startpos[subidx] = m->startpos[subidx];
Karsten Hopp 60686d
  		save.endpos[subidx] = m->endpos[subidx];
Karsten Hopp 60686d
  		m->startpos[subidx].lnum = reglnum;
Karsten Hopp 60686d
! 		m->startpos[subidx].col = reginput - regline + off;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    else
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
--- 2583,2589 ----
Karsten Hopp 60686d
  		save.startpos[subidx] = m->startpos[subidx];
Karsten Hopp 60686d
  		save.endpos[subidx] = m->endpos[subidx];
Karsten Hopp 60686d
  		m->startpos[subidx].lnum = reglnum;
Karsten Hopp 60686d
! 		m->startpos[subidx].col = (colnr_T)(reginput - regline + off);
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    else
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 2631,2637 ****
Karsten Hopp 60686d
  		save.startpos[subidx] = m->startpos[subidx];
Karsten Hopp 60686d
  		save.endpos[subidx] = m->endpos[subidx];
Karsten Hopp 60686d
  		m->endpos[subidx].lnum = reglnum;
Karsten Hopp 60686d
! 		m->endpos[subidx].col = reginput - regline + off;
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    else
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
--- 2631,2637 ----
Karsten Hopp 60686d
  		save.startpos[subidx] = m->startpos[subidx];
Karsten Hopp 60686d
  		save.endpos[subidx] = m->endpos[subidx];
Karsten Hopp 60686d
  		m->endpos[subidx].lnum = reglnum;
Karsten Hopp 60686d
! 		m->endpos[subidx].col = (colnr_T)(reginput - regline + off);
Karsten Hopp 60686d
  	    }
Karsten Hopp 60686d
  	    else
Karsten Hopp 60686d
  	    {
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 3620,3626 ****
Karsten Hopp 60686d
      int		re_flags;
Karsten Hopp 60686d
  {
Karsten Hopp 60686d
      nfa_regprog_T	*prog;
Karsten Hopp 60686d
!     int			prog_size;
Karsten Hopp 60686d
      int			*postfix;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      if (expr == NULL)
Karsten Hopp 60686d
--- 3620,3626 ----
Karsten Hopp 60686d
      int		re_flags;
Karsten Hopp 60686d
  {
Karsten Hopp 60686d
      nfa_regprog_T	*prog;
Karsten Hopp 60686d
!     size_t		prog_size;
Karsten Hopp 60686d
      int			*postfix;
Karsten Hopp 60686d
  
Karsten Hopp 60686d
      if (expr == NULL)
Karsten Hopp 60686d
*** ../vim-7.3.976/src/version.c	2013-05-20 13:55:17.000000000 +0200
Karsten Hopp 60686d
--- src/version.c	2013-05-20 21:24:28.000000000 +0200
Karsten Hopp 60686d
***************
Karsten Hopp 60686d
*** 730,731 ****
Karsten Hopp 60686d
--- 730,733 ----
Karsten Hopp 60686d
  {   /* Add new patch number below this line */
Karsten Hopp 60686d
+ /**/
Karsten Hopp 60686d
+     977,
Karsten Hopp 60686d
  /**/
Karsten Hopp 60686d
Karsten Hopp 60686d
-- 
Karsten Hopp 60686d
A law to reduce crime states: "It is mandatory for a motorist with criminal
Karsten Hopp 60686d
intentions to stop at the city limits and telephone the chief of police as he
Karsten Hopp 60686d
is entering the town.
Karsten Hopp 60686d
		[real standing law in Washington, United States of America]
Karsten Hopp 60686d
Karsten Hopp 60686d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 60686d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 60686d
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 60686d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///