lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
384c58b
To: vim_dev@googlegroups.com
384c58b
Subject: Patch 7.4.228
384c58b
Fcc: outbox
384c58b
From: Bram Moolenaar <Bram@moolenaar.net>
384c58b
Mime-Version: 1.0
384c58b
Content-Type: text/plain; charset=UTF-8
384c58b
Content-Transfer-Encoding: 8bit
384c58b
------------
384c58b
384c58b
Patch 7.4.228
384c58b
Problem:    Compiler warnings when building with Python 3.2.
384c58b
Solution:   Make type cast depend on Python version. (Ken Takata)
384c58b
Files:	    src/if_py_both.h, src/if_python.c, src/if_python3.c
384c58b
384c58b
384c58b
*** ../vim-7.4.227/src/if_py_both.h	2014-03-08 16:13:39.115462069 +0100
384c58b
--- src/if_py_both.h	2014-03-30 15:58:40.948518929 +0200
384c58b
***************
384c58b
*** 2328,2334 ****
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
384c58b
  				 &start, &stop, &step, &slicelen) < 0)
384c58b
  	    return NULL;
384c58b
  	return ListSlice(self, start, step, slicelen);
384c58b
--- 2328,2334 ----
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject_T *)idx, ListLength(self),
384c58b
  				 &start, &stop, &step, &slicelen) < 0)
384c58b
  	    return NULL;
384c58b
  	return ListSlice(self, start, step, slicelen);
384c58b
***************
384c58b
*** 2618,2624 ****
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
384c58b
  				 &start, &stop, &step, &slicelen) < 0)
384c58b
  	    return -1;
384c58b
  	return ListAssSlice(self, start, step, slicelen,
384c58b
--- 2618,2624 ----
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject_T *)idx, ListLength(self),
384c58b
  				 &start, &stop, &step, &slicelen) < 0)
384c58b
  	    return -1;
384c58b
  	return ListAssSlice(self, start, step, slicelen,
384c58b
*** ../vim-7.4.227/src/if_python.c	2014-02-23 22:52:33.368764715 +0100
384c58b
--- src/if_python.c	2014-03-30 15:58:35.768518850 +0200
384c58b
***************
384c58b
*** 803,808 ****
384c58b
--- 803,810 ----
384c58b
  # define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1))
384c58b
  #endif
384c58b
  
384c58b
+ typedef PySliceObject PySliceObject_T;
384c58b
+ 
384c58b
  /*
384c58b
   * Include the code shared with if_python3.c
384c58b
   */
384c58b
*** ../vim-7.4.227/src/if_python3.c	2014-01-14 19:35:49.000000000 +0100
384c58b
--- src/if_python3.c	2014-03-30 15:59:24.752519600 +0200
384c58b
***************
384c58b
*** 100,105 ****
384c58b
--- 100,115 ----
384c58b
  #define PyIntArgFunc	ssizeargfunc
384c58b
  #define PyIntObjArgProc	ssizeobjargproc
384c58b
  
384c58b
+ /*
384c58b
+  * PySlice_GetIndicesEx(): first argument type changed from PySliceObject
384c58b
+  * to PyObject in Python 3.2 or later.
384c58b
+  */
384c58b
+ #if PY_VERSION_HEX >= 0x030200f0
384c58b
+ typedef PyObject PySliceObject_T;
384c58b
+ #else
384c58b
+ typedef PySliceObject PySliceObject_T;
384c58b
+ #endif
384c58b
+ 
384c58b
  #if defined(DYNAMIC_PYTHON3) || defined(PROTO)
384c58b
  
384c58b
  # ifndef WIN3264
384c58b
***************
384c58b
*** 294,300 ****
384c58b
  static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
384c58b
  static int (*py3_PyMapping_Check)(PyObject *);
384c58b
  static PyObject* (*py3_PyMapping_Keys)(PyObject *);
384c58b
! static int (*py3_PySlice_GetIndicesEx)(PySliceObject *r, Py_ssize_t length,
384c58b
  		     Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
384c58b
  		     Py_ssize_t *slicelen);
384c58b
  static PyObject* (*py3_PyErr_NoMemory)(void);
384c58b
--- 304,310 ----
384c58b
  static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
384c58b
  static int (*py3_PyMapping_Check)(PyObject *);
384c58b
  static PyObject* (*py3_PyMapping_Keys)(PyObject *);
384c58b
! static int (*py3_PySlice_GetIndicesEx)(PySliceObject_T *r, Py_ssize_t length,
384c58b
  		     Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
384c58b
  		     Py_ssize_t *slicelen);
384c58b
  static PyObject* (*py3_PyErr_NoMemory)(void);
384c58b
***************
384c58b
*** 1190,1196 ****
384c58b
  	if (CheckBuffer((BufferObject *) self))
384c58b
  	    return NULL;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject *)idx,
384c58b
  	      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
384c58b
  	      &start, &stop,
384c58b
  	      &step, &slicelen) < 0)
384c58b
--- 1200,1206 ----
384c58b
  	if (CheckBuffer((BufferObject *) self))
384c58b
  	    return NULL;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
384c58b
  	      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
384c58b
  	      &start, &stop,
384c58b
  	      &step, &slicelen) < 0)
384c58b
***************
384c58b
*** 1222,1228 ****
384c58b
  	if (CheckBuffer((BufferObject *) self))
384c58b
  	    return -1;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject *)idx,
384c58b
  	      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
384c58b
  	      &start, &stop,
384c58b
  	      &step, &slicelen) < 0)
384c58b
--- 1232,1238 ----
384c58b
  	if (CheckBuffer((BufferObject *) self))
384c58b
  	    return -1;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
384c58b
  	      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
384c58b
  	      &start, &stop,
384c58b
  	      &step, &slicelen) < 0)
384c58b
***************
384c58b
*** 1306,1312 ****
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject *)idx,
384c58b
  		((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
384c58b
  		&start, &stop,
384c58b
  		&step, &slicelen) < 0)
384c58b
--- 1316,1322 ----
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
384c58b
  		((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
384c58b
  		&start, &stop,
384c58b
  		&step, &slicelen) < 0)
384c58b
***************
384c58b
*** 1333,1339 ****
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject *)idx,
384c58b
  		((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
384c58b
  		&start, &stop,
384c58b
  		&step, &slicelen) < 0)
384c58b
--- 1343,1349 ----
384c58b
      {
384c58b
  	Py_ssize_t start, stop, step, slicelen;
384c58b
  
384c58b
! 	if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
384c58b
  		((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
384c58b
  		&start, &stop,
384c58b
  		&step, &slicelen) < 0)
384c58b
*** ../vim-7.4.227/src/version.c	2014-03-28 21:58:17.878256914 +0100
384c58b
--- src/version.c	2014-03-30 15:52:27.784513211 +0200
384c58b
***************
384c58b
*** 736,737 ****
384c58b
--- 736,739 ----
384c58b
  {   /* Add new patch number below this line */
384c58b
+ /**/
384c58b
+     228,
384c58b
  /**/
384c58b
384c58b
-- 
384c58b
The average life of an organization chart is six months.  You can safely
384c58b
ignore any order from your boss that would take six months to complete.
384c58b
				(Scott Adams - The Dilbert principle)
384c58b
384c58b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
384c58b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
384c58b
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
384c58b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///