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
This commit is contained in:
2005-07-18 03:50:37 +00:00
parent 9919df089d
commit e60291d39c
103 changed files with 899 additions and 1161 deletions

View File

@@ -30,7 +30,9 @@
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include "rgbTuple.h"
#include "rgbTuple.h" /*This must come first */
#include "gen_utils.h"
/* This file is heavily based on the old bpython Constant object code in
Blender */
@@ -298,7 +300,7 @@ static int rgbTupleAssSubscript( BPy_rgbTuple * self, PyObject * key,
else
return EXPP_ReturnIntError( PyExc_AttributeError, name );
*( self->rgb[i] ) = EXPP_ClampFloat( PyFloat_AsDouble( v ), 0.0, 1.0 );
*( self->rgb[i] ) = EXPP_ClampFloat( (float)PyFloat_AsDouble( v ), 0.0, 1.0 );
return 0;
}
@@ -349,7 +351,7 @@ static int rgbTupleAssItem( BPy_rgbTuple * self, int i, PyObject * ob )
"color component must be a number" );
/* XXX this check above is probably ... */
*( self->rgb[i] ) =
EXPP_ClampFloat( PyFloat_AsDouble( ob ), 0.0, 1.0 );
EXPP_ClampFloat( (float)PyFloat_AsDouble( ob ), 0.0, 1.0 );
return 0;
}