diff options
author | Ton Roosendaal <ton@blender.org> | 2009-07-09 19:40:04 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-07-09 19:40:04 +0400 |
commit | 5e659c0b0895e07351bd2b2425deea342141e515 (patch) | |
tree | 7e6bd849591c0eb75fdefe37c061519806edf309 /source/blender/python/generic/quat.c | |
parent | 77c61f545fb3248ae4e06afafa816764222405c4 (diff) |
2.5
Monthly cleaning round to make it compile warning free.
Mostly it was const stuff (strings, Context), but also
a couple useful fixes, like wrong use of temp pointers.
Only Mathutils callback struct I left alone... design issue.
Diffstat (limited to 'source/blender/python/generic/quat.c')
-rw-r--r-- | source/blender/python/generic/quat.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 81d69834469..a353f73c854 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -167,7 +167,6 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) { float eul[3]; EulerObject *eul_compat = NULL; - int x; if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) return NULL; @@ -176,7 +175,7 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) return NULL; if(eul_compat) { - float mat[3][3], eul_compatf[3]; + float mat[3][3]; if(!BaseMath_ReadCallback(eul_compat)) return NULL; @@ -184,10 +183,15 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) QuatToMat3(self->quat, mat); #ifdef USE_MATHUTILS_DEG - for(x = 0; x < 3; x++) { - eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + { + float eul_compatf[3]; + int x; + + for(x = 0; x < 3; x++) { + eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + } + Mat3ToCompatibleEul(mat, eul, eul_compatf); } - Mat3ToCompatibleEul(mat, eul, eul_compatf); #else Mat3ToCompatibleEul(mat, eul, eul_compat->eul); #endif @@ -197,8 +201,12 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) } #ifdef USE_MATHUTILS_DEG - for(x = 0; x < 3; x++) { - eul[x] *= (180 / (float)Py_PI); + { + int x; + + for(x = 0; x < 3; x++) { + eul[x] *= (180 / (float)Py_PI); + } } #endif return newEulerObject(eul, Py_NEW, NULL); @@ -833,7 +841,7 @@ PyObject *newQuaternionObject(float *quat, int type, PyTypeObject *base_type) { QuaternionObject *self; - if(base_type) self = base_type->tp_alloc(base_type, 0); + if(base_type) self = (QuaternionObject *)base_type->tp_alloc(base_type, 0); else self = PyObject_NEW(QuaternionObject, &quaternion_Type); /* init callbacks as NULL */ |