summaryrefslogtreecommitdiffstats
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-21 21:01:59 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-21 21:01:59 +0200
commit4ce5fe4c87820c7d22964d6e91d7b07e96640e6f (patch)
tree900ca0ee352311d36d485c2dd12a9e828e274ab3 /src/if_python3.c
parentc58f5456e5c5f21193e960cecc434e367ef1281e (diff)
patch 8.2.1883: compiler warnings when using Pythonv8.2.1883
Problem: Compiler warnings when using Python. Solution: Adjust PyCFunction to also have the second argument. Use "int" return type for some functions. Insert "(void *)" to get rid of the remaining warnings.
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 495aed3596..a51be2949e 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1252,7 +1252,7 @@ OutputSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
#define BufferType_Check(obj) ((obj)->ob_base.ob_type == &BufferType)
static PyObject* BufferSubscript(PyObject *self, PyObject *idx);
-static Py_ssize_t BufferAsSubscript(PyObject *self, PyObject *idx, PyObject *val);
+static int BufferAsSubscript(PyObject *self, PyObject *idx, PyObject *val);
// Line range type - Implementation functions
// --------------------------------------
@@ -1260,8 +1260,8 @@ static Py_ssize_t BufferAsSubscript(PyObject *self, PyObject *idx, PyObject *val
#define RangeType_Check(obj) ((obj)->ob_base.ob_type == &RangeType)
static PyObject* RangeSubscript(PyObject *self, PyObject *idx);
-static Py_ssize_t RangeAsItem(PyObject *, Py_ssize_t, PyObject *);
-static Py_ssize_t RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val);
+static int RangeAsItem(PyObject *, Py_ssize_t, PyObject *);
+static int RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val);
// Current objects type - Implementation functions
// -----------------------------------------------
@@ -1346,7 +1346,7 @@ BufferSubscript(PyObject *self, PyObject* idx)
}
}
- static Py_ssize_t
+ static int
BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
{
if (PyLong_Check(idx))
@@ -1418,7 +1418,7 @@ RangeGetattro(PyObject *self, PyObject *nameobj)
////////////////
- static Py_ssize_t
+ static int
RangeAsItem(PyObject *self, Py_ssize_t n, PyObject *val)
{
return RBAsItem(((RangeObject *)(self))->buf, n, val,
@@ -1461,7 +1461,7 @@ RangeSubscript(PyObject *self, PyObject* idx)
}
}
- static Py_ssize_t
+ static int
RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val)
{
if (PyLong_Check(idx))