]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.228 v7.4.228
authorBram Moolenaar <Bram@vim.org>
Sun, 30 Mar 2014 14:11:43 +0000 (16:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 30 Mar 2014 14:11:43 +0000 (16:11 +0200)
Problem:    Compiler warnings when building with Python 3.2.
Solution:   Make type cast depend on Python version. (Ken Takata)

src/if_py_both.h
src/if_python.c
src/if_python3.c
src/version.c

index 4c9dd8b20545a0791d8d8dd3dfe2934617cdac59..b26226977c7660254c4c31e562b134392c68200d 100644 (file)
@@ -2328,7 +2328,7 @@ ListItem(ListObject *self, PyObject* idx)
     {
        Py_ssize_t start, stop, step, slicelen;
 
-       if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
+       if (PySlice_GetIndicesEx((PySliceObject_T *)idx, ListLength(self),
                                 &start, &stop, &step, &slicelen) < 0)
            return NULL;
        return ListSlice(self, start, step, slicelen);
@@ -2618,7 +2618,7 @@ ListAssItem(ListObject *self, PyObject *idx, PyObject *obj)
     {
        Py_ssize_t start, stop, step, slicelen;
 
-       if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
+       if (PySlice_GetIndicesEx((PySliceObject_T *)idx, ListLength(self),
                                 &start, &stop, &step, &slicelen) < 0)
            return -1;
        return ListAssSlice(self, start, step, slicelen,
index 34a75a636b3d73ae7ec9104dbfa81c7f9e337c04..c95cb5d0e7d3a678297963d0e077aa85a24ce91b 100644 (file)
@@ -803,6 +803,8 @@ py_memsave(void *p, size_t len)
 # define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1))
 #endif
 
+typedef PySliceObject PySliceObject_T;
+
 /*
  * Include the code shared with if_python3.c
  */
index 99781fcc80485e7a5c3183025908c52b956daabc..374641d82e37e29ca0d7198c707f4b8462386642 100644 (file)
 #define PyIntArgFunc   ssizeargfunc
 #define PyIntObjArgProc        ssizeobjargproc
 
+/*
+ * PySlice_GetIndicesEx(): first argument type changed from PySliceObject
+ * to PyObject in Python 3.2 or later.
+ */
+#if PY_VERSION_HEX >= 0x030200f0
+typedef PyObject PySliceObject_T;
+#else
+typedef PySliceObject PySliceObject_T;
+#endif
+
 #if defined(DYNAMIC_PYTHON3) || defined(PROTO)
 
 # ifndef WIN3264
@@ -294,7 +304,7 @@ static Py_ssize_t (*py3_PyTuple_Size)(PyObject *);
 static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
 static int (*py3_PyMapping_Check)(PyObject *);
 static PyObject* (*py3_PyMapping_Keys)(PyObject *);
-static int (*py3_PySlice_GetIndicesEx)(PySliceObject *r, Py_ssize_t length,
+static int (*py3_PySlice_GetIndicesEx)(PySliceObject_T *r, Py_ssize_t length,
                     Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
                     Py_ssize_t *slicelen);
 static PyObject* (*py3_PyErr_NoMemory)(void);
@@ -1190,7 +1200,7 @@ BufferSubscript(PyObject *self, PyObject* idx)
        if (CheckBuffer((BufferObject *) self))
            return NULL;
 
-       if (PySlice_GetIndicesEx((PySliceObject *)idx,
+       if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
              (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
              &start, &stop,
              &step, &slicelen) < 0)
@@ -1222,7 +1232,7 @@ BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
        if (CheckBuffer((BufferObject *) self))
            return -1;
 
-       if (PySlice_GetIndicesEx((PySliceObject *)idx,
+       if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
              (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
              &start, &stop,
              &step, &slicelen) < 0)
@@ -1306,7 +1316,7 @@ RangeSubscript(PyObject *self, PyObject* idx)
     {
        Py_ssize_t start, stop, step, slicelen;
 
-       if (PySlice_GetIndicesEx((PySliceObject *)idx,
+       if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
                ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
                &start, &stop,
                &step, &slicelen) < 0)
@@ -1333,7 +1343,7 @@ RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val)
     {
        Py_ssize_t start, stop, step, slicelen;
 
-       if (PySlice_GetIndicesEx((PySliceObject *)idx,
+       if (PySlice_GetIndicesEx((PySliceObject_T *)idx,
                ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
                &start, &stop,
                &step, &slicelen) < 0)
index 1fa43a1d554984cfbcbddf60c425d57e62deddf1..1c78a5e470df0a81c677b82ed5f32b9c93497dfc 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    228,
 /**/
     227,
 /**/