Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
22668:7c0ebc6eb7ae | 22669:3ceb24835183 |
---|---|
1195 // Buffer type - Implementation functions | 1195 // Buffer type - Implementation functions |
1196 // -------------------------------------- | 1196 // -------------------------------------- |
1197 | 1197 |
1198 #define BufferType_Check(obj) ((obj)->ob_type == &BufferType) | 1198 #define BufferType_Check(obj) ((obj)->ob_type == &BufferType) |
1199 | 1199 |
1200 static PyInt BufferAssItem(PyObject *, PyInt, PyObject *); | 1200 static int BufferAssItem(PyObject *, PyInt, PyObject *); |
1201 static PyInt BufferAssSlice(PyObject *, PyInt, PyInt, PyObject *); | 1201 static int BufferAssSlice(PyObject *, PyInt, PyInt, PyObject *); |
1202 | 1202 |
1203 // Line range type - Implementation functions | 1203 // Line range type - Implementation functions |
1204 // -------------------------------------- | 1204 // -------------------------------------- |
1205 | 1205 |
1206 #define RangeType_Check(obj) ((obj)->ob_type == &RangeType) | 1206 #define RangeType_Check(obj) ((obj)->ob_type == &RangeType) |
1207 | 1207 |
1208 static PyInt RangeAssItem(PyObject *, PyInt, PyObject *); | 1208 static int RangeAssItem(PyObject *, PyInt, PyObject *); |
1209 static PyInt RangeAssSlice(PyObject *, PyInt, PyInt, PyObject *); | 1209 static int RangeAssSlice(PyObject *, PyInt, PyInt, PyObject *); |
1210 | 1210 |
1211 // Current objects type - Implementation functions | 1211 // Current objects type - Implementation functions |
1212 // ----------------------------------------------- | 1212 // ----------------------------------------------- |
1213 | 1213 |
1214 static PySequenceMethods BufferAsSeq = { | 1214 static PySequenceMethods BufferAsSeq = { |
1244 return Py_FindMethod(BufferMethods, self, name); | 1244 return Py_FindMethod(BufferMethods, self, name); |
1245 } | 1245 } |
1246 | 1246 |
1247 ////////////////// | 1247 ////////////////// |
1248 | 1248 |
1249 static PyInt | 1249 static int |
1250 BufferAssItem(PyObject *self, PyInt n, PyObject *val) | 1250 BufferAssItem(PyObject *self, PyInt n, PyObject *val) |
1251 { | 1251 { |
1252 return RBAsItem((BufferObject *)(self), n, val, 1, -1, NULL); | 1252 return RBAsItem((BufferObject *)(self), n, val, 1, -1, NULL); |
1253 } | 1253 } |
1254 | 1254 |
1255 static PyInt | 1255 static int |
1256 BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) | 1256 BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) |
1257 { | 1257 { |
1258 return RBAsSlice((BufferObject *)(self), lo, hi, val, 1, -1, NULL); | 1258 return RBAsSlice((BufferObject *)(self), lo, hi, val, 1, -1, NULL); |
1259 } | 1259 } |
1260 | 1260 |
1288 return Py_FindMethod(RangeMethods, self, name); | 1288 return Py_FindMethod(RangeMethods, self, name); |
1289 } | 1289 } |
1290 | 1290 |
1291 //////////////// | 1291 //////////////// |
1292 | 1292 |
1293 static PyInt | 1293 static int |
1294 RangeAssItem(PyObject *self, PyInt n, PyObject *val) | 1294 RangeAssItem(PyObject *self, PyInt n, PyObject *val) |
1295 { | 1295 { |
1296 return RBAsItem(((RangeObject *)(self))->buf, n, val, | 1296 return RBAsItem(((RangeObject *)(self))->buf, n, val, |
1297 ((RangeObject *)(self))->start, | 1297 ((RangeObject *)(self))->start, |
1298 ((RangeObject *)(self))->end, | 1298 ((RangeObject *)(self))->end, |
1299 &((RangeObject *)(self))->end); | 1299 &((RangeObject *)(self))->end); |
1300 } | 1300 } |
1301 | 1301 |
1302 static PyInt | 1302 static int |
1303 RangeAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) | 1303 RangeAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) |
1304 { | 1304 { |
1305 return RBAsSlice(((RangeObject *)(self))->buf, lo, hi, val, | 1305 return RBAsSlice(((RangeObject *)(self))->buf, lo, hi, val, |
1306 ((RangeObject *)(self))->start, | 1306 ((RangeObject *)(self))->start, |
1307 ((RangeObject *)(self))->end, | 1307 ((RangeObject *)(self))->end, |