diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2005-07-18 07:50:37 +0400 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2005-07-18 07:50:37 +0400 |
commit | e60291d39c0f77282a2d17f79e9264107bbc495e (patch) | |
tree | 274f6c0fc564553bb1484abfc5ad33e758d00903 /source/blender/python/api2_2x/euler.c | |
parent | 9919df089dc34a62ac14f5c151d7815ee852bd81 (diff) |
Header file clean up and warning fixes
- Mostly this cleans up the #includes and header files in the python project.
- Warning fixes are mostly casting issues and misc fixes. General warning clean up.
- #include Python.h MUST come as the first include to avoid the POSIX redefine warning in the unix makefiles
- fno-strict-aliasing flag added to makefile to fix a unavoidable type punning warning in types.c
Diffstat (limited to 'source/blender/python/api2_2x/euler.c')
-rw-r--r-- | source/blender/python/api2_2x/euler.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c index d5b7b61c8a7..103537aa8ba 100644 --- a/source/blender/python/api2_2x/euler.c +++ b/source/blender/python/api2_2x/euler.c @@ -29,11 +29,13 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ +#include "Mathutils.h" + #include "BLI_arithb.h" #include "BKE_utildefines.h" -#include "Mathutils.h" -#include "gen_utils.h" #include "BLI_blenlib.h" +#include "gen_utils.h" + //-------------------------DOC STRINGS --------------------------- char Euler_Zero_doc[] = "() - set all values in the euler to 0"; @@ -129,9 +131,9 @@ PyObject *Euler_Unique(EulerObject * self) heading -= Py_PI; //back to degrees - self->eul[0] = heading * 180 / (float)Py_PI; - self->eul[1] = pitch * 180 / (float)Py_PI; - self->eul[2] = bank * 180 / (float)Py_PI; + self->eul[0] = (float)(heading * 180 / (float)Py_PI); + self->eul[1] = (float)(pitch * 180 / (float)Py_PI); + self->eul[2] = (float)(bank * 180 / (float)Py_PI); return (PyObject*)self; } @@ -213,11 +215,11 @@ static int Euler_setattr(EulerObject * self, char *name, PyObject * e) } if(STREQ(name,"x")){ - self->eul[0] = PyFloat_AS_DOUBLE(f); + self->eul[0] = (float)PyFloat_AS_DOUBLE(f); }else if(STREQ(name, "y")){ - self->eul[1] = PyFloat_AS_DOUBLE(f); + self->eul[1] = (float)PyFloat_AS_DOUBLE(f); }else if(STREQ(name, "z")){ - self->eul[2] = PyFloat_AS_DOUBLE(f); + self->eul[2] = (float)PyFloat_AS_DOUBLE(f); }else{ Py_DECREF(f); return EXPP_ReturnIntError(PyExc_AttributeError, @@ -283,7 +285,7 @@ static int Euler_ass_item(EulerObject * self, int i, PyObject * ob) return EXPP_ReturnIntError(PyExc_IndexError, "euler[attribute] = x: array assignment index out of range\n"); } - self->eul[i] = PyFloat_AS_DOUBLE(f); + self->eul[i] = (float)PyFloat_AS_DOUBLE(f); Py_DECREF(f); return 0; } @@ -338,7 +340,7 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, return EXPP_ReturnIntError(PyExc_TypeError, "euler[begin:end] = []: sequence argument not a number\n"); } - eul[i] = PyFloat_AS_DOUBLE(f); + eul[i] = (float)PyFloat_AS_DOUBLE(f); EXPP_decr2(f,e); } //parsed well - now set in vector |