diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-09 17:53:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-09 17:53:18 +0300 |
commit | c9f353956c19abf184496978927c4af5209ec97f (patch) | |
tree | 89352c1d4e2110c583ce4b38ffe70ada6d1d945c /source/blender/python | |
parent | 0660078b8bb5eac6f81bd352505dc6f7d72e06c1 (diff) |
use PySequence_Size() rather then PySequence_Length(), this is only kept in python for backwards compatibility.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/IDProp.c | 4 | ||||
-rw-r--r-- | source/blender/python/generic/bgl.c | 6 | ||||
-rw-r--r-- | source/blender/python/generic/mathutils_vector.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_array.c | 10 |
6 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index 7bf7f06f989..9e4aa88354d 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -261,7 +261,7 @@ static int idp_sequence_type(PyObject *seq) PyObject *item; int type= IDP_INT; - int i, len = PySequence_Length(seq); + int i, len = PySequence_Size(seq); for (i=0; i < len; i++) { item = PySequence_GetItem(seq, i); if (PyFloat_Check(item)) { @@ -331,7 +331,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(const char *name, IDProperty *g we assume IDP_INT unless we hit a float number; then we assume it's */ - val.array.len = PySequence_Length(ob); + val.array.len = PySequence_Size(ob); switch(val.array.type) { case IDP_DOUBLE: diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index e72f2136ee5..3d525b08ecc 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -207,7 +207,7 @@ static PyObject *Method_Buffer (PyObject *UNUSED(self), PyObject *args) ndimensions= 1; dimensions[0]= PyLong_AsLong(length_ob); } else if (PySequence_Check(length_ob)) { - ndimensions= PySequence_Length(length_ob); + ndimensions= PySequence_Size(length_ob); if (ndimensions > MAX_DIMENSIONS) { PyErr_SetString(PyExc_AttributeError, "too many dimensions, max is 256"); return NULL; @@ -360,8 +360,8 @@ static int Buffer_ass_slice(PyObject *self, int begin, int end, PyObject *seq) return -1; } - if (PySequence_Length(seq)!=(end-begin)) { - int seq_len = PySequence_Length(seq); + if (PySequence_Size(seq)!=(end-begin)) { + int seq_len = PySequence_Size(seq); char err_str[128]; sprintf(err_str, "size mismatch in assignment. Expected size: %d (size provided: %d)", seq_len, (end-begin)); PyErr_SetString(PyExc_TypeError, err_str); diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c index 2208046e6c0..d25bd12fdfd 100644 --- a/source/blender/python/generic/mathutils_vector.c +++ b/source/blender/python/generic/mathutils_vector.c @@ -844,7 +844,7 @@ static int Vector_ass_slice(VectorObject *self, int begin, int end, CLAMP(end, 0, self->size); begin = MIN2(begin,end); - size = PySequence_Length(seq); + size = PySequence_Size(seq); if(size != (end - begin)){ PyErr_SetString(PyExc_TypeError, "vector[begin:end] = []: size mismatch in slice assignment"); return -1; diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index dd3a49ad8b1..bdd1f0575bd 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -552,7 +552,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int return NULL; } - seq_len= PySequence_Length(value); + seq_len= PySequence_Size(value); if(is_enum_flag) { if(seq_len > RNA_ENUM_BITFLAG_SIZE) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 663c82e07ad..c0c4227b466 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1250,7 +1250,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb return -1; } - seq_len = PySequence_Length(value); + seq_len = PySequence_Size(value); for(i=0; i<seq_len; i++) { item= PySequence_GetItem(value, i); @@ -3279,7 +3279,7 @@ static int foreach_parse_args( return -1; } - *tot= PySequence_Length(*seq); // TODO - buffer may not be a sequence! array.array() is tho. + *tot= PySequence_Size(*seq); // TODO - buffer may not be a sequence! array.array() is tho. if(*tot>0) { foreach_attr_type(self, *attr, raw_type, attr_tot, attr_signed); diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 8e815e34cbc..a0dbc2d5ff2 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -57,7 +57,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[] if (dim + 1 < totdim) { /* check that a sequence contains dimsize[dim] items */ - for (i= 0; i < PySequence_Length(seq); i++) { + for (i= 0; i < PySequence_Size(seq); i++) { PyObject *item; int ok= 1; item= PySequence_GetItem(seq, i); @@ -72,7 +72,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[] dimsize[2]=5 dim=0 */ - else if (PySequence_Length(item) != dimsize[dim + 1]) { + else if (PySequence_Size(item) != dimsize[dim + 1]) { /* BLI_snprintf(error_str, error_str_size, "sequences of dimension %d should contain %d items", (int)dim + 1, (int)dimsize[dim + 1]); */ PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items", error_prefix, (int)dim + 1, (int)dimsize[dim + 1]); ok= 0; @@ -89,7 +89,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[] } else { /* check that items are of correct type */ - for (i= 0; i < PySequence_Length(seq); i++) { + for (i= 0; i < PySequence_Size(seq); i++) { PyObject *item= PySequence_GetItem(seq, i); if (!check_item_type(item)) { @@ -114,7 +114,7 @@ static int count_items(PyObject *seq) if (PySequence_Check(seq)) { int i; - for (i= 0; i < PySequence_Length(seq); i++) { + for (i= 0; i < PySequence_Size(seq); i++) { PyObject *item= PySequence_GetItem(seq, i); totitem += count_items(item); Py_DECREF(item); @@ -211,7 +211,7 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int unsigned int i; int totdim= RNA_property_array_dimension(ptr, prop, NULL); - for (i= 0; i < PySequence_Length(seq); i++) { + for (i= 0; i < PySequence_Size(seq); i++) { PyObject *item= PySequence_GetItem(seq, i); if (dim + 1 < totdim) { |