diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-27 09:28:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-27 09:28:06 +0400 |
commit | 928e2784c6596f64ca5201eed269959865d15970 (patch) | |
tree | b0dea3efd0eb4697e4a94f130acc154ba8fbcd36 /source/blender/python/generic | |
parent | d98bcb8a77c0a06dc35669dd8898f1f9f2ad85c6 (diff) |
py api
- use Py_ssize_t when dealing with python sequence sizes
- dont call PySequence_Size(py_b) in a loop (its slow).
- use faster sequence/float parsing in aud.Factory.filter
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r-- | source/blender/python/generic/IDProp.c | 2 | ||||
-rw-r--r-- | source/blender/python/generic/bgl.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index 2543d34f58c..e6883eb30af 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -269,7 +269,7 @@ static int idp_sequence_type(PyObject *seq) PyObject *item; int type= IDP_INT; - int i, len = PySequence_Size(seq); + Py_ssize_t i, len = PySequence_Size(seq); for (i=0; i < len; i++) { item = PySequence_GetItem(seq, i); if (PyFloat_Check(item)) { diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index 44d42a479ec..35c211d5424 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -286,8 +286,8 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject Buffer *buffer; int dimensions[MAX_DIMENSIONS]; - int i, type; - int ndimensions = 0; + int type; + Py_ssize_t i, ndimensions = 0; if(kwds && PyDict_Size(kwds)) { PyErr_SetString(PyExc_TypeError, |