diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-07 03:46:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-07 03:46:20 +0400 |
commit | 9161d3ce4bdd7c838751462b47eb045ea33a686e (patch) | |
tree | 8ce7ec347331f641b7fb53647b66a102235cd2bc /source/gameengine/Expressions | |
parent | 9baff83d72ccb287e2e6011c648877b96790e9a9 (diff) |
use Py_ssize_t rather than int when dealing with list sizes (original patch from Fedora but applied changes elsewhere too), also replace PyList_Size with PyList_GET_SIZE where typechecking is already done.
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/ListValue.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/Value.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 271d5067dd9..934f2a8dd87 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -387,7 +387,7 @@ PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize_t ihig static PyObject *listvalue_buffer_concat(PyObject * self, PyObject * other) { CListValue *listval= static_cast<CListValue *>(BGE_PROXY_REF(self)); - int i, numitems, numitems_orig; + Py_ssize_t i, numitems, numitems_orig; if (listval==NULL) { PyErr_SetString(PyExc_SystemError, "CList+other, "BGE_PROXY_ERROR_MSG); @@ -408,7 +408,7 @@ static PyObject *listvalue_buffer_concat(PyObject * self, PyObject * other) CValue* listitemval; bool error = false; - numitems = PyList_Size(other); + numitems = PyList_GET_SIZE(other); /* copy the first part of the list */ listval_new->Resize(numitems_orig + numitems); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index e60b380e95c..41c0850a779 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -546,8 +546,8 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) CListValue* listval = new CListValue(); bool error = false; - int i; - int numitems = PyList_Size(pyobj); + Py_ssize_t i; + Py_ssize_t numitems = PyList_GET_SIZE(pyobj); for (i=0;i<numitems;i++) { PyObject* listitem = PyList_GetItem(pyobj,i); /* borrowed ref */ |