Mercurial > vim
diff src/if_python.c @ 22669:3ceb24835183 v8.2.1883
patch 8.2.1883: compiler warnings when using Python
Commit: https://github.com/vim/vim/commit/4ce5fe4c87820c7d22964d6e91d7b07e96640e6f
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Oct 21 21:01:59 2020 +0200
patch 8.2.1883: compiler warnings when using Python
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Oct 2020 21:15:03 +0200 |
parents | 4acb165ed0bc |
children | f9526a3c9bbf |
line wrap: on
line diff
--- a/src/if_python.c +++ b/src/if_python.c @@ -1197,16 +1197,16 @@ OutputGetattr(PyObject *self, char *name #define BufferType_Check(obj) ((obj)->ob_type == &BufferType) -static PyInt BufferAssItem(PyObject *, PyInt, PyObject *); -static PyInt BufferAssSlice(PyObject *, PyInt, PyInt, PyObject *); +static int BufferAssItem(PyObject *, PyInt, PyObject *); +static int BufferAssSlice(PyObject *, PyInt, PyInt, PyObject *); // Line range type - Implementation functions // -------------------------------------- #define RangeType_Check(obj) ((obj)->ob_type == &RangeType) -static PyInt RangeAssItem(PyObject *, PyInt, PyObject *); -static PyInt RangeAssSlice(PyObject *, PyInt, PyInt, PyObject *); +static int RangeAssItem(PyObject *, PyInt, PyObject *); +static int RangeAssSlice(PyObject *, PyInt, PyInt, PyObject *); // Current objects type - Implementation functions // ----------------------------------------------- @@ -1246,13 +1246,13 @@ BufferGetattr(PyObject *self, char *name ////////////////// - static PyInt + static int BufferAssItem(PyObject *self, PyInt n, PyObject *val) { return RBAsItem((BufferObject *)(self), n, val, 1, -1, NULL); } - static PyInt + static int BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) { return RBAsSlice((BufferObject *)(self), lo, hi, val, 1, -1, NULL); @@ -1290,7 +1290,7 @@ RangeGetattr(PyObject *self, char *name) //////////////// - static PyInt + static int RangeAssItem(PyObject *self, PyInt n, PyObject *val) { return RBAsItem(((RangeObject *)(self))->buf, n, val, @@ -1299,7 +1299,7 @@ RangeAssItem(PyObject *self, PyInt n, Py &((RangeObject *)(self))->end); } - static PyInt + static int RangeAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) { return RBAsSlice(((RangeObject *)(self))->buf, lo, hi, val,