Blame SOURCES/7.4.278

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.278
22c937
Fcc: outbox
22c937
From: Bram Moolenaar <Bram@moolenaar.net>
22c937
Mime-Version: 1.0
22c937
Content-Type: text/plain; charset=UTF-8
22c937
Content-Transfer-Encoding: 8bit
22c937
------------
22c937
22c937
Patch 7.4.278
22c937
Problem:    list_remove() conflicts with function defined in Sun header file.
22c937
Solution:   Rename the function. (Richard Palo)
22c937
Files:	    src/eval.c, src/if_lua.c, src/if_py_both.h, src/proto/eval.pro
22c937
22c937
22c937
*** ../vim-7.4.277/src/eval.c	2014-04-29 17:41:18.351689927 +0200
22c937
--- src/eval.c	2014-05-07 17:28:56.037181128 +0200
22c937
***************
22c937
*** 5998,6004 ****
22c937
      list_T  *l;
22c937
      listitem_T *item;
22c937
  {
22c937
!     list_remove(l, item, item);
22c937
      listitem_free(item);
22c937
  }
22c937
  
22c937
--- 5998,6004 ----
22c937
      list_T  *l;
22c937
      listitem_T *item;
22c937
  {
22c937
!     vimlist_remove(l, item, item);
22c937
      listitem_free(item);
22c937
  }
22c937
  
22c937
***************
22c937
*** 6577,6585 ****
22c937
  /*
22c937
   * Remove items "item" to "item2" from list "l".
22c937
   * Does not free the listitem or the value!
22c937
   */
22c937
      void
22c937
! list_remove(l, item, item2)
22c937
      list_T	*l;
22c937
      listitem_T	*item;
22c937
      listitem_T	*item2;
22c937
--- 6577,6587 ----
22c937
  /*
22c937
   * Remove items "item" to "item2" from list "l".
22c937
   * Does not free the listitem or the value!
22c937
+  * This used to be called list_remove, but that conflicts with a Sun header
22c937
+  * file.
22c937
   */
22c937
      void
22c937
! vimlist_remove(l, item, item2)
22c937
      list_T	*l;
22c937
      listitem_T	*item;
22c937
      listitem_T	*item2;
22c937
***************
22c937
*** 15435,15441 ****
22c937
  	    if (argvars[2].v_type == VAR_UNKNOWN)
22c937
  	    {
22c937
  		/* Remove one item, return its value. */
22c937
! 		list_remove(l, item, item);
22c937
  		*rettv = item->li_tv;
22c937
  		vim_free(item);
22c937
  	    }
22c937
--- 15437,15443 ----
22c937
  	    if (argvars[2].v_type == VAR_UNKNOWN)
22c937
  	    {
22c937
  		/* Remove one item, return its value. */
22c937
! 		vimlist_remove(l, item, item);
22c937
  		*rettv = item->li_tv;
22c937
  		vim_free(item);
22c937
  	    }
22c937
***************
22c937
*** 15461,15467 ****
22c937
  			EMSG(_(e_invrange));
22c937
  		    else
22c937
  		    {
22c937
! 			list_remove(l, item, item2);
22c937
  			if (rettv_list_alloc(rettv) == OK)
22c937
  			{
22c937
  			    l = rettv->vval.v_list;
22c937
--- 15463,15469 ----
22c937
  			EMSG(_(e_invrange));
22c937
  		    else
22c937
  		    {
22c937
! 			vimlist_remove(l, item, item2);
22c937
  			if (rettv_list_alloc(rettv) == OK)
22c937
  			{
22c937
  			    l = rettv->vval.v_list;
22c937
*** ../vim-7.4.277/src/if_lua.c	2013-06-23 12:55:02.000000000 +0200
22c937
--- src/if_lua.c	2014-05-07 17:29:08.913181240 +0200
22c937
***************
22c937
*** 734,740 ****
22c937
      if (li == NULL) return 0;
22c937
      if (lua_isnil(L, 3)) /* remove? */
22c937
      {
22c937
! 	list_remove(l, li, li);
22c937
  	clear_tv(&li->li_tv);
22c937
  	vim_free(li);
22c937
      }
22c937
--- 734,740 ----
22c937
      if (li == NULL) return 0;
22c937
      if (lua_isnil(L, 3)) /* remove? */
22c937
      {
22c937
! 	vimlist_remove(l, li, li);
22c937
  	clear_tv(&li->li_tv);
22c937
  	vim_free(li);
22c937
      }
22c937
*** ../vim-7.4.277/src/if_py_both.h	2014-03-30 16:11:37.176530823 +0200
22c937
--- src/if_py_both.h	2014-05-07 17:29:26.497181394 +0200
22c937
***************
22c937
*** 2494,2500 ****
22c937
  	if (numreplaced < slicelen)
22c937
  	{
22c937
  	    lis[slicelen + numreplaced] = lis[numreplaced]->li_prev;
22c937
! 	    list_remove(l, lis[numreplaced], lis[numreplaced]);
22c937
  	    numreplaced++;
22c937
  	}
22c937
  	else
22c937
--- 2494,2500 ----
22c937
  	if (numreplaced < slicelen)
22c937
  	{
22c937
  	    lis[slicelen + numreplaced] = lis[numreplaced]->li_prev;
22c937
! 	    vimlist_remove(l, lis[numreplaced], lis[numreplaced]);
22c937
  	    numreplaced++;
22c937
  	}
22c937
  	else
22c937
***************
22c937
*** 2570,2576 ****
22c937
      if (obj == NULL)
22c937
      {
22c937
  	li = list_find(l, (long) index);
22c937
! 	list_remove(l, li, li);
22c937
  	clear_tv(&li->li_tv);
22c937
  	vim_free(li);
22c937
  	return 0;
22c937
--- 2570,2576 ----
22c937
      if (obj == NULL)
22c937
      {
22c937
  	li = list_find(l, (long) index);
22c937
! 	vimlist_remove(l, li, li);
22c937
  	clear_tv(&li->li_tv);
22c937
  	vim_free(li);
22c937
  	return 0;
22c937
*** ../vim-7.4.277/src/proto/eval.pro	2014-01-14 16:36:40.000000000 +0100
22c937
--- src/proto/eval.pro	2014-05-07 17:30:02.517181710 +0200
22c937
***************
22c937
*** 59,65 ****
22c937
  int list_append_dict __ARGS((list_T *list, dict_T *dict));
22c937
  int list_append_string __ARGS((list_T *l, char_u *str, int len));
22c937
  int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
22c937
! void list_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
22c937
  void list_insert __ARGS((list_T *l, listitem_T *ni, listitem_T *item));
22c937
  int garbage_collect __ARGS((void));
22c937
  void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
22c937
--- 59,65 ----
22c937
  int list_append_dict __ARGS((list_T *list, dict_T *dict));
22c937
  int list_append_string __ARGS((list_T *l, char_u *str, int len));
22c937
  int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
22c937
! void vimlist_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
22c937
  void list_insert __ARGS((list_T *l, listitem_T *ni, listitem_T *item));
22c937
  int garbage_collect __ARGS((void));
22c937
  void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
22c937
*** ../vim-7.4.277/src/version.c	2014-05-07 16:35:05.029152844 +0200
22c937
--- src/version.c	2014-05-07 17:30:43.449182068 +0200
22c937
***************
22c937
*** 736,737 ****
22c937
--- 736,739 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     278,
22c937
  /**/
22c937
22c937
-- 
22c937
"Computers in the future may weigh no more than 1.5 tons."
22c937
                                   Popular Mechanics, 1949
22c937
22c937
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
22c937
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
22c937
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
22c937
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///