From 3fd388fb06e474a4e9e2f6816eb0a0b95ab433e7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 21 Nov 2012 02:28:36 +0000 Subject: py api cleanup, replace use... - PyLong_FromSsize_t --> PyLong_FromLong - PyLong_AsSsize_t --> PyLong_AsLong In all places except for those where python api expects PySsize_t (index lookups mainly). - use PyBool_FromLong in a few areas of the BGE. - fix incorrect assumption in the BGE that PySequence_Check() means PySequence_Fast_ functions can be used. --- source/blender/python/bmesh/bmesh_py_ops.c | 2 +- source/blender/python/bmesh/bmesh_py_types_customdata.c | 4 ++-- source/blender/python/bmesh/bmesh_py_types_meshdata.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/python/bmesh') diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c index 4457a8390e1..2b82826eb04 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.c +++ b/source/blender/python/bmesh/bmesh_py_ops.c @@ -342,7 +342,7 @@ static PyObject *pyrna_op_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject * item = PyBool_FromLong((BMO_SLOT_AS_BOOL(slot))); break; case BMO_OP_SLOT_INT: - item = PyLong_FromSsize_t(BMO_SLOT_AS_INT(slot)); + item = PyLong_FromLong(BMO_SLOT_AS_INT(slot)); break; case BMO_OP_SLOT_FLT: item = PyFloat_FromDouble((double)BMO_SLOT_AS_FLOAT(slot)); diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 1fea12d105c..14132d08fe6 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -981,7 +981,7 @@ PyObject *BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer) } case CD_PROP_INT: { - ret = PyLong_FromSsize_t((Py_ssize_t)(*(int *)value)); + ret = PyLong_FromLong(*(int *)value); break; } case CD_PROP_STR: @@ -1060,7 +1060,7 @@ int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObj } case CD_PROP_INT: { - int tmp_val = PyLong_AsSsize_t(py_value); + int tmp_val = PyLong_AsLong(py_value); if (UNLIKELY(tmp_val == -1 && PyErr_Occurred())) { PyErr_Format(PyExc_TypeError, "expected an int, not a %.200s", Py_TYPE(py_value)->tp_name); ret = -1; diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index 8316d33ea38..b0870578f5a 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -527,7 +527,7 @@ static PyObject *bpy_bmdeformvert_keys(BPy_BMDeformVert *self) ret = PyList_New(self->data->totweight); for (i = 0; i < self->data->totweight; i++, dw++) { - PyList_SET_ITEM(ret, i, PyLong_FromSsize_t(dw->def_nr)); + PyList_SET_ITEM(ret, i, PyLong_FromLong(dw->def_nr)); } return ret; @@ -576,7 +576,7 @@ static PyObject *bpy_bmdeformvert_items(BPy_BMDeformVert *self) for (i = 0; i < self->data->totweight; i++, dw++) { item = PyTuple_New(2); - PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(dw->def_nr)); + PyTuple_SET_ITEM(item, 0, PyLong_FromLong(dw->def_nr)); PyTuple_SET_ITEM(item, 1, PyFloat_FromDouble(dw->weight)); PyList_SET_ITEM(ret, i, item); -- cgit v1.2.3