Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-27 20:52:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-27 21:00:04 +0400
commita5c35fb27f090bb716a3bb49a69a56be80dff6d3 (patch)
treec2486c0781d2135c00ee58c78c042ba9d4f87b97 /source/blender/python/generic/idprop_py_api.c
parent60287e23b53a273aae56c42502278991dbeee9e7 (diff)
Code cleanup: use booleans where appropriate
Diffstat (limited to 'source/blender/python/generic/idprop_py_api.c')
-rw-r--r--source/blender/python/generic/idprop_py_api.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index c3cbe7ddbf9..938a4cc8049 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -1002,22 +1002,22 @@ PyTypeObject BPy_IDGroup_Type = {
/********Array Wrapper********/
-static PyTypeObject *idp_array_py_type(BPy_IDArray *self, short *is_double)
+static PyTypeObject *idp_array_py_type(BPy_IDArray *self, bool *r_is_double)
{
switch (self->prop->subtype) {
case IDP_FLOAT:
- *is_double = 0;
+ *r_is_double = false;
return &PyFloat_Type;
case IDP_DOUBLE:
- *is_double = 1;
+ *r_is_double = true;
return &PyFloat_Type;
case IDP_INT:
- *is_double = 0;
+ *r_is_double = false;
return &PyLong_Type;
+ default:
+ *r_is_double = false;
+ return NULL;
}
-
- *is_double = 0;
- return NULL;
}
static PyObject *BPy_IDArray_repr(BPy_IDArray *self)
@@ -1188,7 +1188,7 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end)
static int BPy_IDArray_ass_slice(BPy_IDArray *self, int begin, int end, PyObject *seq)
{
IDProperty *prop = self->prop;
- short is_double = 0;
+ bool is_double;
const PyTypeObject *py_type = idp_array_py_type(self, &is_double);
const size_t elem_size = is_double ? sizeof(double) : sizeof(float);
size_t alloc_len;