diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-26 18:21:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-26 18:25:15 +0400 |
commit | e73d0f57a32f309433c005c06d6da2048f274c04 (patch) | |
tree | eaa2542b29b5198590b79e1610d511cf0f57275d /source/blender/python/generic/idprop_py_api.c | |
parent | 483d8da9bcfa1eeef950ba45633c5fb49fb7f93b (diff) |
Code cleanup: use 'const' for arrays (python)
Diffstat (limited to 'source/blender/python/generic/idprop_py_api.c')
-rw-r--r-- | source/blender/python/generic/idprop_py_api.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 5821d48b994..54fed9e11ef 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -599,7 +599,7 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) switch (prop->subtype) { case IDP_FLOAT: { - float *array = (float *)IDP_Array(prop); + const float *array = (float *)IDP_Array(prop); for (i = 0; i < prop->len; i++) { PyList_SET_ITEM(seq, i, PyFloat_FromDouble(array[i])); } @@ -607,7 +607,7 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) } case IDP_DOUBLE: { - double *array = (double *)IDP_Array(prop); + const double *array = (double *)IDP_Array(prop); for (i = 0; i < prop->len; i++) { PyList_SET_ITEM(seq, i, PyFloat_FromDouble(array[i])); } @@ -615,7 +615,7 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) } case IDP_INT: { - int *array = (int *)IDP_Array(prop); + const int *array = (int *)IDP_Array(prop); for (i = 0; i < prop->len; i++) { PyList_SET_ITEM(seq, i, PyLong_FromLong(array[i])); } @@ -881,7 +881,7 @@ static PyObject *BPy_IDGroup_clear(BPy_IDProperty *self) static PyObject *BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args) { IDProperty *idprop; - char *key; + const char *key; PyObject *def = Py_None; if (!PyArg_ParseTuple(args, "s|O:get", &key, &def)) @@ -1158,7 +1158,7 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end) switch (prop->subtype) { case IDP_FLOAT: { - float *array = (float *)IDP_Array(prop); + const float *array = (float *)IDP_Array(prop); for (count = begin; count < end; count++) { PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(array[count])); } @@ -1166,7 +1166,7 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end) } case IDP_DOUBLE: { - double *array = (double *)IDP_Array(prop); + const double *array = (double *)IDP_Array(prop); for (count = begin; count < end; count++) { PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(array[count])); } @@ -1174,7 +1174,7 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end) } case IDP_INT: { - int *array = (int *)IDP_Array(prop); + const int *array = (int *)IDP_Array(prop); for (count = begin; count < end; count++) { PyTuple_SET_ITEM(tuple, count - begin, PyLong_FromLong(array[count])); } |