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