Header file clean up and warning fixes
authorJoseph Gilbert <ascotan@gmail.com>
Mon, 18 Jul 2005 03:50:37 +0000 (03:50 +0000)
committerJoseph Gilbert <ascotan@gmail.com>
Mon, 18 Jul 2005 03:50:37 +0000 (03:50 +0000)
- 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

103 files changed:
source/blender/python/BPY_interface.c
source/blender/python/BPY_menus.c
source/blender/python/api2_2x/Armature.c
source/blender/python/api2_2x/Armature.h
source/blender/python/api2_2x/BGL.c
source/blender/python/api2_2x/BGL.h
source/blender/python/api2_2x/BezTriple.c
source/blender/python/api2_2x/BezTriple.h
source/blender/python/api2_2x/Blender.c
source/blender/python/api2_2x/Blender.h
source/blender/python/api2_2x/Bone.c
source/blender/python/api2_2x/Bone.h
source/blender/python/api2_2x/Build.c
source/blender/python/api2_2x/Build.h
source/blender/python/api2_2x/Camera.c
source/blender/python/api2_2x/Camera.h
source/blender/python/api2_2x/CurNurb.c
source/blender/python/api2_2x/CurNurb.h
source/blender/python/api2_2x/Curve.c
source/blender/python/api2_2x/Curve.h
source/blender/python/api2_2x/Draw.c
source/blender/python/api2_2x/Draw.h
source/blender/python/api2_2x/EXPP_interface.c
source/blender/python/api2_2x/EXPP_interface.h
source/blender/python/api2_2x/Effect.c
source/blender/python/api2_2x/Effect.h
source/blender/python/api2_2x/Font.c
source/blender/python/api2_2x/Font.h
source/blender/python/api2_2x/Image.c
source/blender/python/api2_2x/Image.h
source/blender/python/api2_2x/Ipo.c
source/blender/python/api2_2x/Ipo.h
source/blender/python/api2_2x/Ipocurve.c
source/blender/python/api2_2x/Ipocurve.h
source/blender/python/api2_2x/Lamp.c
source/blender/python/api2_2x/Lamp.h
source/blender/python/api2_2x/Lattice.c
source/blender/python/api2_2x/Lattice.h
source/blender/python/api2_2x/Library.c
source/blender/python/api2_2x/MTex.c
source/blender/python/api2_2x/MTex.h
source/blender/python/api2_2x/Makefile
source/blender/python/api2_2x/Material.c
source/blender/python/api2_2x/Material.h
source/blender/python/api2_2x/Mathutils.c
source/blender/python/api2_2x/Metaball.c
source/blender/python/api2_2x/Metaball.h
source/blender/python/api2_2x/NLA.c
source/blender/python/api2_2x/NLA.h
source/blender/python/api2_2x/NMesh.c
source/blender/python/api2_2x/NMesh.h
source/blender/python/api2_2x/Noise.c
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/Object.h
source/blender/python/api2_2x/Particle.c
source/blender/python/api2_2x/Particle.h
source/blender/python/api2_2x/Registry.c
source/blender/python/api2_2x/Scene.c
source/blender/python/api2_2x/Scene.h
source/blender/python/api2_2x/Sound.c
source/blender/python/api2_2x/Sound.h
source/blender/python/api2_2x/Sys.c
source/blender/python/api2_2x/Sys.h
source/blender/python/api2_2x/Text.c
source/blender/python/api2_2x/Text.h
source/blender/python/api2_2x/Text3d.c
source/blender/python/api2_2x/Text3d.h
source/blender/python/api2_2x/Texture.c
source/blender/python/api2_2x/Texture.h
source/blender/python/api2_2x/Types.c
source/blender/python/api2_2x/Types.h
source/blender/python/api2_2x/Wave.c
source/blender/python/api2_2x/Wave.h
source/blender/python/api2_2x/Window.c
source/blender/python/api2_2x/Window.h
source/blender/python/api2_2x/World.c
source/blender/python/api2_2x/World.h
source/blender/python/api2_2x/bpy_types.h
source/blender/python/api2_2x/charRGBA.c
source/blender/python/api2_2x/charRGBA.h
source/blender/python/api2_2x/constant.c
source/blender/python/api2_2x/constant.h
source/blender/python/api2_2x/euler.c
source/blender/python/api2_2x/euler.h
source/blender/python/api2_2x/gen_utils.c
source/blender/python/api2_2x/gen_utils.h
source/blender/python/api2_2x/logic.c
source/blender/python/api2_2x/logic.h
source/blender/python/api2_2x/matrix.c
source/blender/python/api2_2x/matrix.h
source/blender/python/api2_2x/modules.h
source/blender/python/api2_2x/quat.c
source/blender/python/api2_2x/quat.h
source/blender/python/api2_2x/rgbTuple.c
source/blender/python/api2_2x/rgbTuple.h
source/blender/python/api2_2x/sceneRadio.c
source/blender/python/api2_2x/sceneRadio.h
source/blender/python/api2_2x/sceneRender.c
source/blender/python/api2_2x/sceneRender.h
source/blender/python/api2_2x/vector.c
source/blender/python/api2_2x/vector.h
source/blender/python/api2_2x/windowTheme.c
source/blender/python/api2_2x/windowTheme.h

index f79cb2065ecc0edba39eddf8f641dec79e98ba43..259c63901a51ee0b8a0e50b22eb43f8fa1e623b4 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
 
 #include <Python.h>
+
 #include "compile.h"           /* for the PyCodeObject */
 #include "eval.h"              /* for PyEval_EvalCode */
-
-#include <stdio.h>
-
-#include <MEM_guardedalloc.h>
-#include <BLI_blenlib.h>       /* for BLI_last_slash() */
-
-#include "BIF_gl.h" /* glPushAttrib, glPopAttrib for DRAW space handlers */
-#include <BIF_interface.h>     /* for pupmenu() */
-#include <BIF_space.h>
-#include <BIF_screen.h>
-#include <BIF_toolbox.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_main.h>
-#include <BKE_object.h>                /* during_scriptlink() */
-#include <BKE_text.h>
-#include <BKE_utildefines.h>
-#include <BPI_script.h>
-
-#include <DNA_camera_types.h>
-#include <DNA_ID.h>
-#include <DNA_lamp_types.h>
-#include <DNA_material_types.h>
-#include <DNA_object_types.h>
-#include <DNA_scene_types.h>
-#include <DNA_screen_types.h>
-#include <DNA_scriptlink_types.h>
-#include <DNA_space_types.h>
-#include <DNA_text_types.h>
-#include <DNA_world_types.h>
-#include <DNA_userdef_types.h> /* for U.pythondir */
-
+#include "BLI_blenlib.h"       /* for BLI_last_slash() */
+#include "BIF_interface.h"     /* for pupmenu() */
+#include "BIF_space.h"
+#include "BIF_screen.h"
+#include "BIF_toolbox.h"
+#include "BKE_library.h"
+#include "BKE_object.h"                /* during_scriptlink() */
+#include "BKE_text.h"
+#include "DNA_screen_types.h"
+#include "DNA_userdef_types.h" /* for U.pythondir */
+#include "MEM_guardedalloc.h"
 #include "BPY_extern.h"
 #include "BPY_menus.h"
+#include "BPI_script.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 #include "api2_2x/EXPP_interface.h"
 #include "api2_2x/constant.h"
-
 #include "api2_2x/gen_utils.h"
-#include "api2_2x/modules.h"
+#include "api2_2x/BGL.h" 
+#include "api2_2x/Blender.h"
+#include "api2_2x/Camera.h"
+#include "api2_2x/Draw.h"
+#include "api2_2x/Lamp.h"
+#include "api2_2x/NMesh.h"
+#include "api2_2x/Object.h"
+#include "api2_2x/Registry.h"
+#include "api2_2x/Scene.h"
+#include "api2_2x/World.h"
 
 /* bpy_registryDict is declared in api2_2x/Registry.h and defined
  * in api2_2x/Registry.c
@@ -83,7 +71,7 @@
  * choose to preserve after they are executed, so user changes can be
  * restored next time the script is used.  Check the Blender.Registry module. 
  */
-#include "api2_2x/Registry.h"
+//#include "api2_2x/Registry.h"
 
 /*************************************************************************
 * Structure definitions        
@@ -449,7 +437,7 @@ void BPY_Err_Handle( char *script_name )
  *     the last frame in the current file is adressed."' 
  */
 
-               while( 1 ) {
+               for(;;) {
                        v = PyObject_GetAttrString( tb, "tb_next" );
 
                        if( !v || v == Py_None ||
@@ -1059,7 +1047,7 @@ void BPY_do_pyscript( ID * id, short event )
                 * is running nested inside another.  Blender.Load needs this info to
                 * avoid trouble with invalid slink pointers. */
                during_slink++;
-               disable_where_scriptlink( during_slink );
+               disable_where_scriptlink( (short)during_slink );
 
                /* set globals in Blender module to identify scriptlink */
                PyDict_SetItemString( g_blenderdict, "bylink", EXPP_incr_ret_True() );
@@ -1099,7 +1087,7 @@ void BPY_do_pyscript( ID * id, short event )
                        }
                }
 
-               disable_where_scriptlink( during_slink - 1 );
+               disable_where_scriptlink( (short)(during_slink - 1) );
 
                /* cleanup bylink flag and clear link so PyObject
                 * can be released 
@@ -1210,7 +1198,7 @@ int BPY_add_spacehandler(Text *text, ScrArea *sa, char spacetype)
 
        if (!sa || !text) return -1;
 
-       handlertype = BPY_is_spacehandler(text, spacetype);
+       handlertype = (unsigned short)BPY_is_spacehandler(text, spacetype);
 
        if (handlertype) {
                ScriptLink *slink = &sa->scriptlink;
@@ -1276,7 +1264,7 @@ int BPY_do_spacehandlers( ScrArea *sa, unsigned short event,
                 * is running nested inside another.  Blender.Load needs this info to
                 * avoid trouble with invalid slink pointers. */
                during_slink++;
-               disable_where_scriptlink( during_slink );
+               disable_where_scriptlink( (short)during_slink );
 
                /* set globals in Blender module to identify space handler scriptlink */
                PyDict_SetItemString(g_blenderdict, "bylink", EXPP_incr_ret_True());
@@ -1338,7 +1326,7 @@ int BPY_do_spacehandlers( ScrArea *sa, unsigned short event,
 
                }
 
-               disable_where_scriptlink( during_slink - 1 );
+               disable_where_scriptlink( (short)(during_slink - 1) );
 
                PyDict_SetItemString(g_blenderdict, "bylink", EXPP_incr_ret_False());
                PyDict_SetItemString(g_blenderdict, "link", EXPP_incr_ret(Py_None));
index e71d06b41415aa046899ee486c27f0663a7d300e..dbb946aa045dbcd73cf1ba05cd9cb0ad4dd01b17 100644 (file)
  * from Blender menus.  To know more, please start with its header file.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "BPY_menus.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <Python.h>
-
 #ifndef WIN32
-#include <dirent.h>
+  #include <dirent.h>
 #else
-#include "BLI_winstuff.h"
-#include <io.h>
-#include <direct.h>
+  #include "BLI_winstuff.h"
 #endif
-
 #include "BKE_global.h"
 #include "BKE_utildefines.h"
 #include "BLI_blenlib.h"
 #include "MEM_guardedalloc.h"
-
-#include <DNA_userdef_types.h> /* for U.pythondir */
-
-#include "BPY_extern.h"
-#include "BPY_menus.h"
+#include "DNA_userdef_types.h" /* for U.pythondir */
 #include "api2_2x/EXPP_interface.h" /* for bpy_gethome() */
 
-#include <errno.h>
-
 #define BPYMENU_DATAFILE "Bpymenus"
 #define MAX_DIR_DEPTH 4 /* max depth for traversing scripts dirs */
 #define MAX_DIR_NUMBER 30 /* max number of dirs in scripts dirs trees */
@@ -494,7 +477,7 @@ static int bpymenu_CreateFromFile( void )
                }
 
                if( parsing == 1 ) {    /* got menu group string */
-                       group = bpymenu_group_atoi( w1 );
+                       group = (short)bpymenu_group_atoi( w1 );
                        if( group < 0 && DEBUG ) {      /* invalid type */
                                fprintf(stderr,
                                        "BPyMenus error parsing config file: wrong group: %s,\n\
@@ -503,7 +486,7 @@ will use 'Misc'.\n", w1 );
                } else
                        continue;
 
-               while( 1 ) {
+               for(;;) {
                        tip = NULL;     /* optional tooltip */
                        fgets( line, 255, fp );
                        if( line[0] == '}' )
@@ -592,7 +575,7 @@ static void bpymenu_WriteDataFile( void )
                pymenu = BPyMenuTable[i];
                if( !pymenu )
                        continue;
-               fprintf( fp, "\n%s {\n", BPyMenu_group_itoa( i ) );
+               fprintf( fp, "\n%s {\n", BPyMenu_group_itoa( (short)i ) );
                while( pymenu ) {
                        fprintf( fp, "'%s' %d %s %d", pymenu->name,
                                 pymenu->version, pymenu->filename,
@@ -629,7 +612,7 @@ void BPyMenu_PrintAllEntries( void )
 
        for( i = 0; i < PYMENU_TOTAL; i++ ) {
                pymenu = BPyMenuTable[i];
-               printf( "\n%s {\n", BPyMenu_group_itoa( i ) );
+               printf( "\n%s {\n", BPyMenu_group_itoa( (short)i ) );
                while( pymenu ) {
                        printf( "'%s' %d %s %d", pymenu->name, pymenu->version,
                                pymenu->filename, pymenu->dir );
@@ -690,7 +673,7 @@ static int bpymenu_ParseFile(FILE *file, char *fname, int is_userdir)
        int parser_state;
 
        char script_name[100];
-       int script_version;
+       int script_version = 1;
        int script_group;
 
        BPyMenu *scriptMenu = NULL;
@@ -751,7 +734,7 @@ static int bpymenu_ParseFile(FILE *file, char *fname, int is_userdir)
                                                }
                                                
                                                else { /* register script */
-                                                       scriptMenu = bpymenu_AddEntry(script_group,
+                                                       scriptMenu = bpymenu_AddEntry((short)script_group,
                                                                (short int)script_version, script_name, fname, is_userdir,NULL);
                                                        if (scriptMenu == NULL) {
                                                                if (DEBUG)
index 422016b93fe6feb19161d6171b1a3256660cbf28..1a1a9ea3498d8aaf32ced3b797796a315406ccb9 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Armature.h"
+#include "Armature.h" /*This must come first*/
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_armature.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "MEM_guardedalloc.h"
 #include "Bone.h"
 #include "NLA.h"
-#include <stdio.h>
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_armature.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <MEM_guardedalloc.h>
-#include <BLI_arithb.h>
-#include "constant.h"
 #include "gen_utils.h"
-#include "Types.h"
 
 //---------------- Python API function prototypes for the Armature module---
 static PyObject *M_Armature_New( PyObject * self, PyObject * args );
index 4787c00921e948eedd528d92b9010076ab009637..91a409100b1d060a199b238d56884391d3d6e36f 100644 (file)
 #define EXPP_ARMATURE_H
 
 #include <Python.h>
-#include <DNA_armature_types.h>
+#include "DNA_armature_types.h"
 
 //---------------------Python BPy_Armature structure definition-------
 typedef struct {
-       PyObject_HEAD bArmature * armature;
+       PyObject_HEAD 
+       bArmature * armature;
 } BPy_Armature;
 
 //--------------------visible prototypes------------------------------
index 41ce58dc634ebeb4248168d0e2e895a5303f137d..5ab90357730ee0924487718f7919de7760d70310 100644 (file)
  * implementation.  The BGL submodule "wraps" OpenGL functions and constants,
  * allowing script writers to make OpenGL calls in their Python scripts. */
 
-#include "BGL.h"
+#include "BGL.h" /*This must come first */
 
+#include "MEM_guardedalloc.h"
+#include "gen_utils.h"
 
 static int type_size( int type );
 static Buffer *make_buffer( int type, int ndimensions, int *dimensions );
index c1c8c824fac00eff1cce12d759eb576fb0740f7c..a37450b1809799ff4e0d2e7881ee3e76ad543860 100644 (file)
 #include <config.h>
 #endif
 
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_text_types.h"
-
-#include "BKE_global.h"
-
+#include <Python.h>
 #include "BIF_gl.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-
-#include "interface.h"
-#include "mydevice.h"          /*@ for all the event constants */
-
-#include "Python.h"
 
-#include "gen_utils.h"
 
 /*@ Buffer Object */
 /*@ For Python access to OpenGL functions requiring a pointer. */
index 849b26375226c736b58402ad3c1eef092552ef27..2e97bd2910e4b5abe629fe630d6b67fc1e527fb2 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "BezTriple.h"
+#include "BezTriple.h" /*This must come first */
 
-#include <Python.h>
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <DNA_ipo_types.h>
-#include <MEM_guardedalloc.h>
-
-#include "constant.h"
+#include "MEM_guardedalloc.h"
 #include "gen_utils.h"
 
 
@@ -72,7 +62,7 @@ static void BezTripleDeAlloc( BPy_BezTriple * self );
 static int BezTripleSetAttr( BPy_BezTriple * self, char *name, PyObject * v );
 static PyObject *BezTripleGetAttr( BPy_BezTriple * self, char *name );
 static PyObject *BezTripleRepr( BPy_BezTriple * self );
-static PyObject *BezTriple_Str( BPy_BezTriple * self );
+//static PyObject *BezTriple_Str( BPy_BezTriple * self );
 
 /****************************************************************************
  Python method structure definition for Blender.BezTriple module:          
@@ -258,7 +248,7 @@ static PyObject *BezTriple_setPoints( BPy_BezTriple * self, PyObject * args )
                        printf( "\n bad o. o no!\n" );
 
                /*   bezt->vec[1][i] = PyFloat_AsDouble (PyTuple_GetItem (popo, i)); */
-               bezt->vec[1][i] = PyFloat_AsDouble( o );
+               bezt->vec[1][i] = (float)PyFloat_AsDouble( o );
                bezt->vec[0][i] = bezt->vec[1][i] - 1;
                bezt->vec[2][i] = bezt->vec[1][i] + 1;
        }
@@ -362,12 +352,12 @@ static PyObject *BezTripleRepr( BPy_BezTriple * self )
  display object as string.
  equivalent to python str(o)
 */
-
+/*
 static PyObject *BezTriple_Str( BPy_BezTriple * self )
 {
        BezTriple *p = self->beztriple;
 
-/* fixme: */
+// fixme: 
        return PyString_FromFormat(
                 "BezTriple (%f %f %f) (%f %f %f) (%f %f %f) alpha %f\n (%d %d) (%d %d) (%d %d) h1:%d h2:%d f1:%d f2:%d f3:%d hide:%d",
                 p->vec[0][0], p->vec[0][1],  p->vec[0][2], 
@@ -382,7 +372,7 @@ static PyObject *BezTriple_Str( BPy_BezTriple * self )
                 p->hide );
 
 }
-
+*/
 
 /*
   BezTriple_Init
index b37ae84a37b2fe9c044b9157dedacbf90ac62bf8..e8fb4f2e543cf162ada7f982178d4e1079337443 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_BEZTRIPLE_H
 
 #include <Python.h>
-#include <DNA_curve_types.h>
+#include "DNA_curve_types.h"
 
 extern PyTypeObject BezTriple_Type;
 
index d0a0bea3ae66499fd4a88274ab8ea2792815e29b..e5a85818a19ae583ac8565fe586455037f117143 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
+struct ID; /*keep me up here */
 
-#include <Python.h>
-#include <stdio.h>
+#include "Blender.h" /*This must come first */
 
 /* for open, close in Blender_Load */
 #include <fcntl.h>
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "BKE_utildefines.h"
 #include "BDR_editobject.h"    /* exit_editmode() */
 #include "BIF_usiblender.h"
 #include "BLI_blenlib.h"
 #include "BKE_exotic.h"
 #include "BKE_global.h"
 #include "BKE_packedFile.h"
+#include "BKE_utildefines.h"
 #include "BKE_object.h"
 #include "BKE_text.h"
+#include "BKE_ipo.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
 #include "BPI_script.h"
 #include "BSE_headerbuttons.h"
-#include "DNA_ID.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
 #include "DNA_screen_types.h"  /* for SPACE_VIEW3D */
-#include "DNA_space_types.h"   /* for SPACE_VIEW3D */
-#include "DNA_scriptlink_types.h"
 #include "DNA_userdef_types.h"
-#include "BKE_ipo.h"
-#include "blendef.h"
-
 #include "EXPP_interface.h" /* for bpy_gethome() */
 #include "gen_utils.h"
 #include "modules.h"
 #include "constant.h"
 #include "../BPY_extern.h" /* BPY_txt_do_python_Text */
 #include "../BPY_menus.h"      /* to update menus */
+#include "Armature.h"
+#include "BezTriple.h"
+#include "Camera.h"
+#include "Curve.h"
+#include "CurNurb.h"
+#include "Draw.h"
+#include "Effect.h"
+#include "Ipo.h"
+#include "Ipocurve.h"
+#include "Lamp.h"
+#include "Lattice.h"
+#include "Mathutils.h"
+#include "Metaball.h"
+#include "NMesh.h"
+#include "Object.h"
+#include "Registry.h"
+#include "Scene.h"
+#include "Sound.h"
+#include "Sys.h"
+#include "Text.h"
+#include "Texture.h"
+#include "Window.h"
+#include "World.h"
+
+
 
 extern PyObject *bpy_registryDict; /* defined in ../BPY_interface.c */
 
+
 /**********************************************************/
 /* Python API function prototypes for the Blender module.      */
 /**********************************************************/
@@ -200,7 +215,7 @@ static PyObject *Blender_Set( PyObject * self, PyObject * args )
                        return ( NULL );
                }
 
-               G.scene->r.cfra = framenum;
+               G.scene->r.cfra = (short)framenum;
 
                update_for_newframe(  );
        } else {
index 52e447834c3d4a95a8a84afeb88abe1dbec51bb1..df80daf3ceaac07e4a59cb75ea515920ac348975 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef EXPP_BLENDER_H
 #define EXPP_BLENDER_H
 
+#include <Python.h>
+
 extern PyObject *g_blenderdict;
 void M_Blender_Init( void );
 
index 87ae85db99fc0f883b092703706f7defd23c4df6..6a80182faac9f828d2e71eb0529b01ce07757faa 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
+struct ScrArea; /*keep me up here */
 
-#include "Bone.h"
+#include "Bone.h" /*This must come first */
 
 #include "BKE_main.h"
 #include "BKE_global.h"
-#include "BKE_object.h"
 #include "BKE_armature.h"
-#include "BKE_library.h"
-#include "BLI_blenlib.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_ipo_types.h"
-#include "BIF_poseobject.h"
 #include "BKE_action.h"
-#include "BSE_editaction.h"
-#include "BKE_constraint.h"
-#include "MEM_guardedalloc.h"
 #include "BKE_utildefines.h"
+#include "BLI_blenlib.h"
 #include "BLI_arithb.h"
-#include "constant.h"
+#include "BSE_editaction.h"
+#include "DNA_object_types.h"
+#include "DNA_ipo_types.h"
+#include "MEM_guardedalloc.h"
 #include "gen_utils.h"
 #include "NLA.h"
-#include "quat.h"
-#include "matrix.h"
-#include "vector.h"
-#include "Types.h"
-
 
 //--------------------Python API function prototypes for the Bone module----
 static PyObject *M_Bone_New( PyObject * self, PyObject * args );
@@ -313,7 +303,7 @@ int updateBoneData( BPy_Bone * self, Bone * parent )
                             strlen( self->name ) + 1 );
                self->bone->roll = self->roll;
                self->bone->flag = self->flag;
-               self->bone->boneclass = self->boneclass;
+               self->bone->boneclass = (short)self->boneclass;
                self->bone->dist = self->dist;
                self->bone->weight = self->weight;
                self->bone->parent = parent;    //parent will be checked from self->parent string in addBone()
@@ -1521,29 +1511,29 @@ static PyObject *Bone_setPose( BPy_Bone * self, PyObject * args )
                //set action keys
                if( setChan->flag & POSE_ROT ) {
                        set_action_key( object->action, setChan, AC_QUAT_X,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_QUAT_Y,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_QUAT_Z,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_QUAT_W,
-                                       makeCurve );
+                                       (short)makeCurve );
                }
                if( setChan->flag & POSE_SIZE ) {
                        set_action_key( object->action, setChan, AC_SIZE_X,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_SIZE_Y,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_SIZE_Z,
-                                       makeCurve );
+                                       (short)makeCurve );
                }
                if( setChan->flag & POSE_LOC ) {
                        set_action_key( object->action, setChan, AC_LOC_X,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_LOC_Y,
-                                       makeCurve );
+                                       (short)makeCurve );
                        set_action_key( object->action, setChan, AC_LOC_Z,
-                                       makeCurve );
+                                       (short)makeCurve );
                }
                //rebuild ipos
                remake_action_ipos( object->action );
@@ -1587,7 +1577,7 @@ static PyObject *Bone_setBoneclass( BPy_Bone * self, PyObject * args )
                self->boneclass = boneclass;
        } else {
                //use bone datastruct
-               self->bone->boneclass = boneclass;
+               self->bone->boneclass = (short)boneclass;
        }
        return EXPP_incr_ret( Py_None );
 }
@@ -1610,8 +1600,6 @@ static PyObject *Bone_hasIK( BPy_Bone * self )
                        return EXPP_incr_ret_False();
                }
        }
-       return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                       "couldn't get Bone.Boneclass attribute" ) );
 }
 
 //--------------- BPy_Bone.getRestMatrix()-------------------------
index 088616da59185c249b4b7f070bccd4df69b2c7b8..b63bfc2d491d99ea1a1977d76ea0dd35e2d20ebc 100644 (file)
 #define EXPP_BONE_H
 
 #include <Python.h>
-#include <DNA_armature_types.h>
-#include "vector.h"
-#include "quat.h"
-#include "matrix.h"
+#include "DNA_armature_types.h"
+#include "Mathutils.h"
 
 //--------------------------Python BPy_Bone structure definition.-------
 typedef struct {
index 7aa6d527649b40b51bb685c98044c06270a23fb6..3fb957c1ad544740541dd3de0a78e5272ceb3d2d 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
+#include "Build.h" /*This must come first */
 
-#include "Build.h"
-#include "Effect.h"
+#include "DNA_object_types.h"
+#include "BKE_effect.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 #include "gen_utils.h"
 
-#include <BLI_arithb.h>
-#include <BLI_blenlib.h>
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-
-#include <stdio.h>
-
 /* prototypes */
 PyObject *Build_Init( void );
 
@@ -134,7 +129,6 @@ PyObject *M_Build_New( PyObject * self, PyObject * args )
        pyeffect->effect = bleffect;
 
        return ( PyObject * ) pyeffect;
-       return 0;
 }
 
 /*****************************************************************************/
index cd0f99d61a3e002d53c4c9ed5b27c69807e6bb0c..ac68cfa0102477be1dad8eb67528cd3a61386819 100644 (file)
 #define EXPP_BUILD_H
 
 #include <Python.h>
-#include <DNA_effect_types.h>
 #include "Effect.h"
 
-
 extern PyTypeObject Build_Type;
 
 #define BPy_Build_Check(v) ((v)->ob_type==&Build_Type)
index feac25b5b7c327cc0936c0249f87052d73dec046..6314ff908f0ccedb680023223b4291f4af358c81 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <BIF_editview.h>
-#include <BSE_editipo.h>
-#include <BIF_space.h>
-#include <mydevice.h>
-
-#include <Python.h>
-
-#include "constant.h"
+#include "Camera.h" /*This must come first */
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_object.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "BSE_editipo.h"
+#include "BIF_space.h"
+#include "mydevice.h"
 #include "gen_utils.h"
-
-#include "Camera.h"
 #include "Ipo.h"
 
 
index afa325131937ada748c7bf5a49e08feb4f34df0d..c6c25215457d9ecafad974c545c2ea7debab5165 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_CAMERA_H
 
 #include <Python.h>
-#include <DNA_camera_types.h>
+#include "DNA_camera_types.h"
 
 extern PyTypeObject Camera_Type;
 
@@ -66,13 +66,13 @@ typedef struct {
 
 #define EXPP_CAM_LENS_MIN         1.0
 #define EXPP_CAM_LENS_MAX       250.0
-#define EXPP_CAM_SCALE_MIN        0.01
+#define EXPP_CAM_SCALE_MIN        0.01f
 #define EXPP_CAM_SCALE_MAX     1000.0
 #define EXPP_CAM_CLIPSTART_MIN    0.0
 #define EXPP_CAM_CLIPSTART_MAX  100.0
 #define EXPP_CAM_CLIPEND_MIN      1.0
 #define EXPP_CAM_CLIPEND_MAX   5000.0
-#define EXPP_CAM_DRAWSIZE_MIN     0.1
+#define EXPP_CAM_DRAWSIZE_MIN     0.1f
 #define EXPP_CAM_DRAWSIZE_MAX    10.0
 
 PyObject *Camera_Init( void );
index bb69ef6f8b9b85c20b7f7ed77e05ae7ffb8da211..bb9fa25643b89b5b2f14f5bbd90e4ad4f7793587 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Python.h"
-#include "DNA_curve_types.h"
+#include "CurNurb.h" /*This must come first */
+
 #include "BKE_curve.h"
 #include "BDR_editcurve.h"     /* for convertspline */
 #include "MEM_guardedalloc.h"
-
 #include "gen_utils.h"
-#include "CurNurb.h"
 #include "BezTriple.h"
 
 
@@ -593,7 +591,7 @@ static PyObject *CurNurb_setMatIndex( BPy_CurNurb * self, PyObject * args )
                           "expected integer argument" ) );
 
        /* fixme:  some range checking would be nice! */
-       self->nurb->mat_nr = index;
+       self->nurb->mat_nr = (short)index;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -651,7 +649,7 @@ static PyObject *CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args )
                           "expected integer argument" ) );
 
        if( self->nurb->flagu != flagu ) {
-               self->nurb->flagu = flagu;
+               self->nurb->flagu = (short)flagu;
                makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
        }
 
@@ -694,7 +692,7 @@ static PyObject *CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args )
                           "expected integer argument" ) );
 
        if( self->nurb->flagv != flagv ) {
-               self->nurb->flagv = flagv;
+               self->nurb->flagv = (short)flagv;
                makeknots( self->nurb, 2, self->nurb->flagv >> 1 );
        }
 
index 437069982a9e81aa4558bf6f49fd61c3503a87d0..763d4ae5f3013880a3eaf58f5013ba33a97013d6 100644 (file)
@@ -32,7 +32,8 @@
 #ifndef EXPP_NURB_H
 #define EXPP_NURB_H
 
-#include <DNA_curve_types.h>
+#include <Python.h>
+#include "DNA_curve_types.h"
 
 extern PyTypeObject CurNurb_Type;
 
index 25394c0e5433ea6fe6cfda337d790b72f3d0bf52..3cd11349e75b655f9bc35d38d36584d4158cda9c 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include <Python.h>
-#include "Curve.h"
-#include <stdio.h>
-
-#include <BLI_arithb.h>
-#include <BLI_blenlib.h>
-#include <BKE_main.h>
-#include <BKE_displist.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BKE_curve.h>
-#include <BKE_utildefines.h>
-#include <MEM_guardedalloc.h>  /* because we wil be mallocing memory */
-
+#include "Curve.h" /*This must come first*/
+
+#include "BKE_main.h"
+#include "BKE_displist.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_curve.h"
+#include "MEM_guardedalloc.h"  /* because we wil be mallocing memory */
 #include "CurNurb.h"
 #include "Material.h"
 #include "Object.h"
@@ -783,7 +776,7 @@ static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args )
 {
        PyObject *listargs = 0;
        Nurb *ptrnurb = self->curve->nurb.first;
-       int numcourbe, numpoint, i, j;
+       int numcourbe = 0, numpoint = 0, i, j;
 
        if( !ptrnurb ) {
                Py_INCREF( Py_None );
@@ -809,14 +802,14 @@ static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args )
        if( ptrnurb->bp )
                for( i = 0; i < 4; i++ )
                        ptrnurb->bp[numpoint].vec[i] =
-                               PyFloat_AsDouble( PyList_GetItem
+                               (float)PyFloat_AsDouble( PyList_GetItem
                                                  ( listargs, i ) );
 
        if( ptrnurb->bezt )
                for( i = 0; i < 3; i++ )
                        for( j = 0; j < 3; j++ )
                                ptrnurb->bezt[numpoint].vec[i][j] =
-                                       PyFloat_AsDouble( PyList_GetItem
+                                       (float)PyFloat_AsDouble( PyList_GetItem
                                                          ( listargs,
                                                            i * 3 + j ) );
 
@@ -904,7 +897,7 @@ static PyObject *Curve_setLoc( BPy_Curve * self, PyObject * args )
                         ( PyExc_TypeError, "expected a list" ) );
        for( i = 0; i < 3; i++ ) {
                PyObject *xx = PyList_GetItem( listargs, i );
-               self->curve->loc[i] = PyFloat_AsDouble( xx );
+               self->curve->loc[i] = (float)PyFloat_AsDouble( xx );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -934,7 +927,7 @@ static PyObject *Curve_setRot( BPy_Curve * self, PyObject * args )
                         ( PyExc_TypeError, "expected a list" ) );
        for( i = 0; i < 3; i++ ) {
                PyObject *xx = PyList_GetItem( listargs, i );
-               self->curve->rot[i] = PyFloat_AsDouble( xx );
+               self->curve->rot[i] = (float)PyFloat_AsDouble( xx );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -963,7 +956,7 @@ static PyObject *Curve_setSize( BPy_Curve * self, PyObject * args )
                         ( PyExc_TypeError, "expected a list" ) );
        for( i = 0; i < 3; i++ ) {
                PyObject *xx = PyList_GetItem( listargs, i );
-               self->curve->size[i] = PyFloat_AsDouble( xx );
+               self->curve->size[i] = (float)PyFloat_AsDouble( xx );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -984,7 +977,7 @@ static PyObject *Curve_getNumCurves( BPy_Curve * self )
        /* get curve */
        ptrnurb = self->curve->nurb.first;
        if( ptrnurb ) {         /* we have some nurbs in this curve */
-               while( 1 ) {
+               for(;;) {
                        ++num_curves;
                        ptrnurb = ptrnurb->next;
                        if( !ptrnurb )  /* no more curves */
index 31a1fdfd9aa133f07883fe7eb0f49464994b1898..38e977adbdc7c90091820b0219dd49b63f7df012 100644 (file)
@@ -33,7 +33,8 @@
 #ifndef EXPP_CURVE_H
 #define EXPP_CURVE_H
 
-#include <DNA_curve_types.h>
+#include <Python.h>
+#include "DNA_curve_types.h"
 
 extern PyTypeObject Curve_Type;
 
index 6e9c73faea44b4d7d740635c6ac52eb08477afe7..e8c49dd71ffd471cff34e2dd496451a144df320b 100644 (file)
  * implementation.     Non-trivial original comments are marked with an
  * @ symbol at their beginning. */
 
-#include "Draw.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "Draw.h" /*This must come first*/
 
 #include "BLI_blenlib.h"
 #include "MEM_guardedalloc.h"
-
 #include "BMF_Api.h"
-
 #include "DNA_screen_types.h"
-
-#include "DNA_text_types.h"
-
 #include "BKE_global.h"
 #include "BKE_image.h"
-#include "BKE_library.h"
 #include "BKE_object.h"
-
+#include "BKE_main.h"
 #include "BIF_gl.h"
 #include "BIF_screen.h"
 #include "BIF_space.h"
 #include "BIF_interface.h"
-#include "BIF_mywindow.h"
 #include "BIF_toolbox.h"
-
 #include "BPI_script.h"                /* script struct */
-
 #include "Image.h"              /* for accessing Blender.Image objects */
 #include "IMB_imbuf_types.h"    /* for the IB_rect define */
-
 #include "interface.h"
 #include "mydevice.h"          /*@ for all the event constants */
+#include "gen_utils.h"
+#include "Window.h"
 
 /* these delimit the free range for button events */
 #define EXPP_BUTTON_EVENTS_OFFSET 1001
@@ -716,7 +704,7 @@ static PyObject *Method_Create( PyObject * self, PyObject * args )
        but = newbutton(  );
        if( PyFloat_Check( in ) ) {
                but->type = 2;
-               but->val.asfloat = PyFloat_AsDouble( in );
+               but->val.asfloat = (float)PyFloat_AsDouble( in );
        } else if( PyInt_Check( in ) ) {
                but->type = 1;
                but->val.asint = PyInt_AsLong( in );
@@ -776,7 +764,7 @@ static PyObject *Method_Button( PyObject * self, PyObject * args )
        block = Get_uiBlock(  );
 
        if( block )
-               uiDefBut( block, BUT, event, name, x, y, w, h, 0, 0, 0, 0, 0,
+               uiDefBut( block, BUT, event, name, (short)x, (short)y, (short)w, (short)h, 0, 0, 0, 0, 0,
                          tip );
 
        return EXPP_incr_ret( Py_None );
@@ -805,7 +793,7 @@ static PyObject *Method_Menu( PyObject * self, PyObject * args )
 
        block = Get_uiBlock(  );
        if( block )
-               uiDefButI( block, MENU, event, name, x, y, w, h,
+               uiDefButI( block, MENU, event, name, (short)x, (short)y, (short)w, (short)h,
                           &but->val.asint, 0, 0, 0, 0, tip );
 
        return ( PyObject * ) but;
@@ -834,7 +822,7 @@ static PyObject *Method_Toggle( PyObject * self, PyObject * args )
 
        block = Get_uiBlock(  );
        if( block )
-               uiDefButI( block, TOG, event, name, x, y, w, h,
+               uiDefButI( block, TOG, event, name, (short)x, (short)y, (short)w, (short)h,
                           &but->val.asint, 0, 0, 0, 0, tip );
 
        return ( PyObject * ) but;
@@ -863,7 +851,7 @@ static void py_slider_update( void *butv, void *data2_unused )
        disable_where_script( 1 );
 
        spacescript_do_pywin_buttons( curarea->spacedata.first,
-               uiButGetRetVal( but ) );
+               (unsigned short)uiButGetRetVal( but ) );
 
        /* XXX useless right now, investigate better before a bcon 5 */
        ret = M_Window_Redraw( 0, ref );
@@ -901,9 +889,9 @@ static PyObject *Method_Slider( PyObject * self, PyObject * args )
        if( PyFloat_Check( inio ) ) {
                float ini, min, max;
 
-               ini = PyFloat_AsDouble( inio );
-               min = PyFloat_AsDouble( mino );
-               max = PyFloat_AsDouble( maxo );
+               ini = (float)PyFloat_AsDouble( inio );
+               min = (float)PyFloat_AsDouble( mino );
+               max = (float)PyFloat_AsDouble( maxo );
 
                but->type = 2;
                but->val.asfloat = ini;
@@ -911,8 +899,8 @@ static PyObject *Method_Slider( PyObject * self, PyObject * args )
                block = Get_uiBlock(  );
                if( block ) {
                        uiBut *ubut;
-                       ubut = uiDefButF( block, NUMSLI, event, name, x, y, w,
-                                         h, &but->val.asfloat, min, max, 0, 0,
+                       ubut = uiDefButF( block, NUMSLI, event, name, (short)x, (short)y, (short)w,
+                                         (short)h, &but->val.asfloat, min, max, 0, 0,
                                          tip );
                        if( realtime )
                                uiButSetFunc( ubut, py_slider_update, ubut,
@@ -931,8 +919,8 @@ static PyObject *Method_Slider( PyObject * self, PyObject * args )
                block = Get_uiBlock(  );
                if( block ) {
                        uiBut *ubut;
-                       ubut = uiDefButI( block, NUMSLI, event, name, x, y, w,
-                                         h, &but->val.asint, min, max, 0, 0,
+                       ubut = uiDefButI( block, NUMSLI, event, name, (short)x, (short)y, (short)w,
+                                         (short)h, &but->val.asint, (float)min, (float)max, 0, 0,
                                          tip );
                        if( realtime )
                                uiButSetFunc( ubut, py_slider_update, ubut,
@@ -974,16 +962,16 @@ another int and string as arguments" );
        else
                but->type = 1;
 
-       ini = PyFloat_AsDouble( inio );
-       min = PyFloat_AsDouble( mino );
-       max = PyFloat_AsDouble( maxo );
+       ini = (float)PyFloat_AsDouble( inio );
+       min = (float)PyFloat_AsDouble( mino );
+       max = (float)PyFloat_AsDouble( maxo );
 
        if( but->type == 2 ) {
                but->val.asfloat = ini;
                block = Get_uiBlock(  );
                if( block ) {
                        uiBut *ubut;
-                       ubut = uiDefButF( block, SCROLL, event, "", x, y, w, h,
+                       ubut = uiDefButF( block, SCROLL, event, "", (short)x, (short)y, (short)w, (short)h,
                                          &but->val.asfloat, min, max, 0, 0,
                                          tip );
                        if( realtime )
@@ -991,11 +979,11 @@ another int and string as arguments" );
                                              NULL );
                }
        } else {
-               but->val.asint = ini;
+               but->val.asint = (int)ini;
                block = Get_uiBlock(  );
                if( block ) {
                        uiBut *ubut;
-                       ubut = uiDefButI( block, SCROLL, event, "", x, y, w, h,
+                       ubut = uiDefButI( block, SCROLL, event, "", (short)x, (short)y, (short)w, (short)h,
                                          &but->val.asint, min, max, 0, 0,
                                          tip );
                        if( realtime )
@@ -1031,16 +1019,16 @@ static PyObject *Method_Number( PyObject * self, PyObject * args )
        if( PyFloat_Check( inio ) ) {
                float ini, min, max;
 
-               ini = PyFloat_AsDouble( inio );
-               min = PyFloat_AsDouble( mino );
-               max = PyFloat_AsDouble( maxo );
+               ini = (float)PyFloat_AsDouble( inio );
+               min = (float)PyFloat_AsDouble( mino );
+               max = (float)PyFloat_AsDouble( maxo );
 
                but->type = 2;
                but->val.asfloat = ini;
 
                block = Get_uiBlock(  );
                if( block )
-                       uiDefButF( block, NUM, event, name, x, y, w, h,
+                       uiDefButF( block, NUM, event, name, (short)x, (short)y, (short)w, (short)h,
                                   &but->val.asfloat, min, max, 0, 0, tip );
        } else {
                int ini, min, max;
@@ -1054,8 +1042,8 @@ static PyObject *Method_Number( PyObject * self, PyObject * args )
 
                block = Get_uiBlock(  );
                if( block )
-                       uiDefButI( block, NUM, event, name, x, y, w, h,
-                                  &but->val.asint, min, max, 0, 0, tip );
+                       uiDefButI( block, NUM, event, name, (short)x, (short)y, (short)w, (short)h,
+                                  &but->val.asint, (float)min, (float)max, 0, 0, tip );
        }
 
        return ( PyObject * ) but;
@@ -1101,8 +1089,8 @@ static PyObject *Method_String( PyObject * self, PyObject * args )
 
        block = Get_uiBlock(  );
        if( block )
-               uiDefBut( block, TEX, event, info_str, x, y, w, h,
-                         but->val.asstr, 0, len, 0, 0, tip );
+               uiDefBut( block, TEX, event, info_str, (short)x, (short)y, (short)w, (short)h,
+                         but->val.asstr, 0, (float)len, 0, 0, tip );
 
        return ( PyObject * ) but;
 }
@@ -1201,7 +1189,7 @@ static PyObject *Method_PupIntInput( PyObject * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected 1 string and 3 int arguments" );
 
-       if( button( &var, min, max, text ) == 0 ) {
+       if( button( &var, (short)min, (short)max, text ) == 0 ) {
                Py_INCREF( Py_None );
                return Py_None;
        }
index 27a80c2333460ee770e39d6b6c2c1257e9bf920c..c644fd8ea3555ca06d3f803abaa119c0cfd6cd35 100644 (file)
 #ifndef EXPP_DRAW_H_
 #define EXPP_DRAW_H_
 
+#include <Python.h>
 #include "DNA_space_types.h"
 #include "DNA_text_types.h"
 
-#include "Python.h"
-
-#include "gen_utils.h"
-#include "Window.h"
-
 void initDraw( void );
 
 /* 
index 62d1f4e799f4e8b3e090829d587da5d83ce04117..f6ad76b0515902b7680aa29d48d8f5c570370dac 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <stdio.h>
-
 #include <Python.h>
 
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_main.h>
-#include <BLI_blenlib.h>
-#include <DNA_space_types.h> /* for FILE_MAXDIR, FILE_MAXFILE */
-
-#include "EXPP_interface.h"
+#include "EXPP_interface.h" 
+#include "BLI_blenlib.h"
+#include "DNA_space_types.h" /* for FILE_MAXDIR, FILE_MAXFILE */
 #include "Blender.h"
-#include "Registry.h"
-#include "gen_utils.h"
 
 extern char bprogname[]; /* argv[0] from creator.c */
 
index 3e38810143f11266ca1e3c9a357e239d09f35cfd..dfcf7abf1da417b726cfbf2049b1b3c49bc9dd52 100644 (file)
@@ -33,8 +33,6 @@
 #ifndef EXPP_INTERFACE_H
 #define EXPP_INTERFACE_H
 
-#include <DNA_ID.h>
-
 struct Script;
 
 void initBlenderApi2_2x( void );
index 2e3e65e2c77397f80d8a03fbc9b0588bbc8a3fca..ee81281ec39f2e200de2ca615fbdaa7258363522 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
-#include "Effect.h"
+#include "Effect.h" /*This must come first */
+
+#include "DNA_object_types.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 #include "Build.h"
 #include "Particle.h"
 #include "Wave.h"
+#include "gen_utils.h"
 
 /*****************************************************************************/
 /* Python BPy_Effect methods table:                                            */
@@ -88,13 +93,13 @@ struct PyMethodDef M_Effect_methods[] = {
 /*****************************************************************************/
 PyObject *M_Effect_New( PyObject * self, PyObject * args )
 {
-       BPy_Effect *pyeffect;
+/*     BPy_Effect *pyeffect;
        Effect *bleffect = 0;
        int type = -1;
-       char *btype = NULL;
+       char *btype = NULL;*/
        Py_INCREF( Py_None );
        return Py_None;
-       if( !PyArg_ParseTuple( args, "s", &btype ) )
+/*     if( !PyArg_ParseTuple( args, "s", &btype ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected type argument(wave,build or particle)" ) );
        if( !strcmp( btype, "wave" ) )
@@ -122,7 +127,7 @@ PyObject *M_Effect_New( PyObject * self, PyObject * args )
 
        pyeffect->effect = bleffect;
 
-       return ( PyObject * ) pyeffect;
+       return ( PyObject * ) pyeffect;*/
 }
 
 /*****************************************************************************/
@@ -268,7 +273,7 @@ PyObject *Effect_setType( BPy_Effect * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "i", &value ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected an int as argument" ) );
-       self->effect->type = value;
+       self->effect->type = (short)value;
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -289,7 +294,7 @@ PyObject *Effect_setFlag( BPy_Effect * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "i", &value ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected an int as argument" ) );
-       self->effect->flag = value;
+       self->effect->flag = (short)value;
        Py_INCREF( Py_None );
        return Py_None;
 }
index 0d56ea391a832e8fc8e375dff5a19a040a20f79b..11260c9576e33031cbebf769b2f8bc3f52128191 100644 (file)
 #define EXPP_EFFECT_H
 
 #include <Python.h>
-#include <stdio.h>
-
-#include <BLI_arithb.h>
-#include <BLI_blenlib.h>
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BKE_effect.h>
-
-#include <DNA_effect_types.h>
-
-#include"gen_utils.h"
+#include "DNA_effect_types.h"
 
 extern PyTypeObject Effect_Type;
 
index 6122477a51579e58125813b2777e668da6a2fc1a..316e7141d153b01773d301d61d0a512bad285279 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "BKE_global.h"
-#include "BKE_packedFile.h"
-#include "DNA_vfont_types.h"
+#include "Font.h" /*This must come first*/
+
 #include "DNA_packedFile_types.h"
-#include "Text3d.h"
-#include "Font.h"
+#include "BKE_packedFile.h"
+#include "BKE_global.h"
+#include "BLI_blenlib.h"
+#include "gen_utils.h"
 
 extern PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * args );
 
index 8de5feef381940352f6fc52b6c3e3c5a0081139d..29218623fdeb8101c0db4ca1e176333f6b3e0840 100644 (file)
@@ -34,6 +34,7 @@
 #define EXPP_FONT_H
 
 #include <Python.h>
+#include "DNA_vfont_types.h"
 
 typedef struct {
        PyObject_HEAD           /* required py macro */
index 7b7bc61c983a79708fd0be63f5710d947c2b5699..61fdd5369475cb149499cf15812915c7a96123dc 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
-
-#include <BDR_drawmesh.h>      /* free_realtime_image */
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_image.h>
-#include <BIF_drawimage.h>
-#include <BLI_blenlib.h>
-#include <DNA_space_types.h>   /* FILE_MAXDIR = 160 */
-#include <IMB_imbuf_types.h>   /* for the IB_rect define */
-#include <BIF_gl.h>
+#include "Image.h" /*This must come first*/
+
+#include "BDR_drawmesh.h"      /* free_realtime_image */
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_image.h"
+#include "BIF_drawimage.h"
+#include "BLI_blenlib.h"
+#include "DNA_space_types.h"   /* FILE_MAXDIR = 160 */
+#include "IMB_imbuf_types.h"   /* for the IB_rect define */
+#include "BIF_gl.h"
 #include "gen_utils.h"
 
-#include "Image.h"
 
 /*****************************************************************************/
 /* Python BPy_Image defaults:                                                                                                                                                                                           */
index 384c28b966102a8f4989797e10bb69e75359528c..70509a8f7f85a5203b657d46d55ed3a70b9ecb3e 100644 (file)
 #define EXPP_IMAGE_H
 
 #include <Python.h>
-#include <DNA_image_types.h>
+#include "DNA_image_types.h"
 
 
 /*****************************************************************************/
 /* Python BPy_Image structure definition                                     */
 /*****************************************************************************/
 typedef struct {
-       PyObject_HEAD Image * image;
+       PyObject_HEAD 
+       Image * image;
 
 } BPy_Image;
 
index cdaafe8ec067a51a85cb458a7539558e3af44608..f9887812cc3c11dc2f0d376685f95f50c2f6d821 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Ipo.h"
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BSE_editipo.h>
-#include <BLI_blenlib.h>
-#include <BIF_space.h>
-#include <BSE_editipo.h>
-#include <mydevice.h>
-#include <DNA_curve_types.h>
-#include <MEM_guardedalloc.h>
-
+#include "Ipo.h" /*This must come first*/
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_ipo.h"
+#include "BLI_blenlib.h"
+#include "BIF_space.h"
+#include "BSE_editipo.h"
+#include "MEM_guardedalloc.h"
+#include "mydevice.h"
 #include "Ipocurve.h"
-#include "constant.h"
 #include "gen_utils.h"
 
 /*****************************************************************************/
@@ -1167,7 +1163,7 @@ static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args )
 
        for( i = 0; i < 9; i++ ) {
                PyObject *xx = PyTuple_GetItem( listargs, i );
-               ptrbt->vec[i / 3][i % 3] = PyFloat_AsDouble( xx );
+               ptrbt->vec[i / 3][i % 3] = (float)PyFloat_AsDouble( xx );
        }
 
        Py_INCREF( Py_None );
index 07e3c8f546f14d84a725f5cacf3feb8e436290cd..db312dc971a0973621f8e481dbfb4330ee130e88 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_IPO_H
 
 #include <Python.h>
-#include <DNA_ipo_types.h>
+#include "DNA_ipo_types.h"
 
 /*****************************************************************************/
 /* Python BPy_Ipo structure definition:                                     */
index 51adfba192f3cb2abca2cb98ec3649aabeaf1a15..5d244c8972608356acb09f53553ba15d94c2f442 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Ipocurve.h"
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BKE_ipo.h>
-#include <BLI_blenlib.h>
-#include <BSE_editipo.h>
-#include <MEM_guardedalloc.h>
-#include <DNA_ipo_types.h>
-
-#include "constant.h"
-#include "gen_utils.h"
+#include "Ipocurve.h" /*This must come first*/
+
+#include "BKE_global.h"
+#include "BKE_ipo.h"
+#include "BSE_editipo.h"
+#include "MEM_guardedalloc.h"
+#include "DNA_ipo_types.h"
 #include "BezTriple.h"
+#include "gen_utils.h"
 
 /*****************************************************************************/
 /* Python API function prototypes for the IpoCurve module.                   */
@@ -219,7 +213,7 @@ static PyObject *IpoCurve_setInterpolation( C_IpoCurve * self,
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "bad interpolation type" ) );
 
-       self->ipocurve->ipo = id;
+       self->ipocurve->ipo = (short)id;
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -262,7 +256,7 @@ static PyObject *IpoCurve_setExtrapolation( C_IpoCurve * self,
        if( id == -1 )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "bad interpolation type" ) );
-       self->ipocurve->extrap = id;
+       self->ipocurve->extrap = (short)id;
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -297,8 +291,8 @@ static PyObject *IpoCurve_addBezier( C_IpoCurve * self, PyObject * args )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "expected tuple argument" ) );
 
-       x = PyFloat_AsDouble( PyTuple_GetItem( popo, 0 ) );
-       y = PyFloat_AsDouble( PyTuple_GetItem( popo, 1 ) );
+       x = (float)PyFloat_AsDouble( PyTuple_GetItem( popo, 0 ) );
+       y = (float)PyFloat_AsDouble( PyTuple_GetItem( popo, 1 ) );
        icu = self->ipocurve;
        npoints = icu->totvert;
        tmp = icu->bezt;
@@ -445,8 +439,6 @@ static PyObject *IpoCurve_getName( C_IpoCurve * self )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "This function doesn't support this ipocurve type yet" );
        }
-
-       return PyString_FromString( "" );
 }
 
 static void IpoCurveDeAlloc( C_IpoCurve * self )
index d26749cbcb470fe763ae2d83d0486c6a12ce6d11..31c8b16c1df22a946aa13dd79c7c5891f978bc63 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_IPOCURVE_H
 
 #include <Python.h>
-#include <DNA_curve_types.h>   /* declaration of IpoCurve */
+#include "DNA_curve_types.h"   /* declaration of IpoCurve */
 
 /*****************************************************************************/
 /* Python C_IpoCurve structure definition:                                   */
index 6d2b6260823e1217937abc3087d5d90ab47042b5..9d2b2c79bf26532daf9c768461422a2ca50f3335 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-
-#include <stdio.h>
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <BIF_space.h>
-#include <BSE_editipo.h>
-#include <mydevice.h>
-
-#include "Lamp.h"
+#include "Lamp.h" /*This must come first*/
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_object.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "BIF_space.h"
+#include "BSE_editipo.h"
+#include "mydevice.h"
 #include "Ipo.h"
-
 #include "constant.h"
-#include "rgbTuple.h"
 #include "gen_utils.h"
 
 /*****************************************************************************/
 #define EXPP_LAMP_BUFFERSIZE_MAX 5120
 #define EXPP_LAMP_ENERGY_MIN  0.0
 #define EXPP_LAMP_ENERGY_MAX 10.0
-#define EXPP_LAMP_DIST_MIN    0.1
+#define EXPP_LAMP_DIST_MIN    0.1f
 #define EXPP_LAMP_DIST_MAX 5000.0
 #define EXPP_LAMP_SPOTSIZE_MIN   1.0
 #define EXPP_LAMP_SPOTSIZE_MAX 180.0
 #define EXPP_LAMP_SPOTBLEND_MIN 0.00
 #define EXPP_LAMP_SPOTBLEND_MAX 1.00
-#define EXPP_LAMP_CLIPSTART_MIN    0.1
+#define EXPP_LAMP_CLIPSTART_MIN    0.1f
 #define EXPP_LAMP_CLIPSTART_MAX 1000.0
 #define EXPP_LAMP_CLIPEND_MIN    1.0
 #define EXPP_LAMP_CLIPEND_MAX 5000.0
-#define EXPP_LAMP_BIAS_MIN 0.01
+#define EXPP_LAMP_BIAS_MIN 0.01f
 #define EXPP_LAMP_BIAS_MAX 5.00
 #define EXPP_LAMP_SOFTNESS_MIN   1.0
 #define EXPP_LAMP_SOFTNESS_MAX 100.0
@@ -982,7 +977,7 @@ static PyObject *Lamp_setSamples( BPy_Lamp * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [1,16]" ) );
 
-       self->lamp->samp = EXPP_ClampInt( value,
+       self->lamp->samp = (short)EXPP_ClampInt( value,
                                          EXPP_LAMP_SAMPLES_MIN,
                                          EXPP_LAMP_SAMPLES_MAX );
 
@@ -998,7 +993,7 @@ static PyObject *Lamp_setBufferSize( BPy_Lamp * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [512, 5120]" ) );
 
-       self->lamp->bufsize = EXPP_ClampInt( value,
+       self->lamp->bufsize = (short)EXPP_ClampInt( value,
                                             EXPP_LAMP_BUFFERSIZE_MIN,
                                             EXPP_LAMP_BUFFERSIZE_MAX );
 
@@ -1014,7 +1009,7 @@ static PyObject *Lamp_setHaloStep( BPy_Lamp * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [0,12]" ) );
 
-       self->lamp->shadhalostep = EXPP_ClampInt( value,
+       self->lamp->shadhalostep = (short)EXPP_ClampInt( value,
                                                  EXPP_LAMP_HALOSTEP_MIN,
                                                  EXPP_LAMP_HALOSTEP_MAX );
 
index fac10ad4fc3c07592ddc9d8aacd8fb7ac4cce50c..e96073be50eb86c8142b17507161f09cda0c9045 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_LAMP_H
 
 #include <Python.h>
-#include <DNA_lamp_types.h>
+#include "DNA_lamp_types.h"
 #include "rgbTuple.h"
 
 extern PyTypeObject Lamp_Type;
index 937cf82b7c4bb0a3c0bb26a5403dfac3c5338b63..16e3d704eb815689732d7b62739d73f4cbf1fc47 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Lattice.h"
-
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_lattice.h>
-#include <BKE_utildefines.h>
-#include <BKE_key.h>
-#include <BLI_blenlib.h>
-
-#include <DNA_key_types.h>
-#include <DNA_curve_types.h>
-#include <DNA_scene_types.h>
-#include <BIF_editlattice.h>
-#include <BIF_editkey.h>
+#include "Lattice.h" /*This must come first*/
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_lattice.h"
+#include "BLI_blenlib.h"
+#include "DNA_object_types.h"
+#include "DNA_key_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_scene_types.h"
+#include "BIF_editkey.h"
 #include "blendef.h"
-#include "mydevice.h"
-#include "constant.h"
 #include "gen_utils.h"
 
 
@@ -684,7 +678,7 @@ static PyObject *Lattice_applyDeform( BPy_Lattice * self, PyObject *args )
 {
        //Object* ob; unused
        Base *base;
-       Object *par;
+       Object *par = NULL;
        int forced = 0;
 
        if( !Lattice_IsLinkedToObject( self ) )
@@ -698,7 +692,8 @@ static PyObject *Lattice_applyDeform( BPy_Lattice * self, PyObject *args )
        /* deform children */
        base = FIRSTBASE;
        while( base ) {
-               if( ( par = base->object->parent ) ) { /* check/assign if ob has parent */
+               par = base->object->parent;
+               if( par != NULL ) { /* check/assign if ob has parent */
                        /* meshes have their mverts deformed, others ob types use displist,
                         * so we're not doing meshes here (unless forced), or else they get
                         * deformed twice, since parenting a Lattice to an object and redrawing
@@ -733,7 +728,7 @@ static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
        if( frame > 0 ) {
                frame = EXPP_ClampInt( frame, 1, MAXFRAME );
                oldfra = G.scene->r.cfra;
-               G.scene->r.cfra = frame;
+               G.scene->r.cfra = (short)frame;
        }
 //      else just use current frame, then
 //              return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
@@ -743,7 +738,7 @@ static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
        insert_lattkey( lt );
 
        if( frame > 0 )
-               G.scene->r.cfra = oldfra;
+               G.scene->r.cfra = (short)oldfra;
 
        Py_INCREF( Py_None );
        return Py_None;
index 09ba1b421b6b14b71d8b78b4b4fb44ca477dfc5a..832c1973154492a5db87babdcd322e3657389010 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_Lattice_H
 
 #include <Python.h>
-#include <DNA_lattice_types.h>
+#include "DNA_lattice_types.h"
 
 
 
@@ -42,7 +42,8 @@
 /* Python BPy_Lattice structure definition:   */
 /*****************************************************************************/
 typedef struct {
-       PyObject_HEAD Lattice * Lattice;
+       PyObject_HEAD 
+       Lattice * Lattice;
 } BPy_Lattice;
 
 
index 25ff6c3932388f1f00346a3221b7f184b97b7485..54f4676306b5c19e051daa0e4a89d1fb4612d18c 100644 (file)
 */
 
 #include <Python.h>
-#include <stdio.h>
 
-#include <DNA_ID.h>
-#include <DNA_curve_types.h>
-#include <BKE_library.h>       /* for all_local */
+#include "DNA_curve_types.h"
+#include "DNA_object_types.h"
+#include "BKE_library.h"       /* for all_local */
 #include "BKE_font.h"          /* for text_to_curve */
-#include <BLO_readfile.h>
-#include <BLI_linklist.h>
-#include <MEM_guardedalloc.h>
-
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BLO_readfile.h"
+#include "BLI_linklist.h"
+#include "MEM_guardedalloc.h"
 #include "gen_utils.h"
 
-
 /**
  * Global variables.
  */
@@ -338,7 +337,6 @@ PyObject *M_Library_Load( PyObject * self, PyObject * args )
  */
 PyObject *M_Library_Update( PyObject * self )
 {                              /* code adapted from do_library_append in src/filesel.c: */
-       Object *ob = NULL;
        Library *lib = NULL;
 
                /* Displist code that was here is obsolete... depending on what
index 0f1d77cf20939bc3f81cb2e795e61fb7f125538e..6b05836195186ce1aa40fb70355730bcbcfe694c 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
+#include "MTex.h" /*This must come first*/
 
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <BKE_texture.h>
-#include <BKE_utildefines.h>
-
-#include "MTex.h"
+#include "BKE_utildefines.h"
 #include "Texture.h"
-#include "constant.h"
 #include "gen_utils.h"
 
 
@@ -204,7 +196,7 @@ static int MTex_setAttr( BPy_MTex * self, char *name, PyObject * value )
                if( PyInt_Check( value ) ) {
                        int texco = PyInt_AsLong( value );
                        /* TODO: sanity-check this input! */
-                       self->mtex->texco = texco;
+                       self->mtex->texco = (short)texco;
                        Py_INCREF( Py_None );   /* because we decref it below */
                        error = Py_None;
                }
@@ -212,7 +204,7 @@ static int MTex_setAttr( BPy_MTex * self, char *name, PyObject * value )
                if( PyInt_Check( value ) ) {
                        int mapto = PyInt_AsLong( value );
                        /* TODO: sanity-check this input! */
-                       self->mtex->mapto = mapto;
+                       self->mtex->mapto = (short)mapto;
                        Py_INCREF( Py_None );   /* because we decref it below */
                        error = Py_None;
                }
index c73b787197f83c7d4b105f51b5d2e6888c483566..484d7ba04ecebbf7214e1c0756730da959e7ea67 100644 (file)
@@ -34,8 +34,7 @@
 #define EXPP_MTEX_H
 
 #include <Python.h>
-
-#include <DNA_texture_types.h>
+#include "DNA_texture_types.h"
 
 
 /*****************************************************************************/
index e7f7107f22c0620a3196909afcf11183a3dc8c8b..3f3682be8bd1be1568bcfeb53fec6eef402324c6 100644 (file)
@@ -40,6 +40,7 @@ include nan_compile.mk
 
 ifeq ($(OS),$(findstring $(OS), "beos darwin freebsd linux openbsd solaris windows"))
     CFLAGS += -funsigned-char
+    CFLAGS += -fno-strict-aliasing
 endif
 
 CFLAGS += $(LEVEL_1_C_WARNINGS)
index 309889f3310ccc374006793e5de2a1e870ad8e78..328c68532f1304bd973f70ed8c08c5f2b0036212 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <MEM_guardedalloc.h>
-#include <DNA_ID.h>
-#include <BLI_blenlib.h>
-#include <BSE_editipo.h>
-#include <BIF_space.h>
-#include <mydevice.h>
+#include "Material.h" /*This must come first*/
 
+#include "DNA_oops_types.h"
+#include "DNA_space_types.h"
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_material.h"
+#include "BKE_texture.h"
+#include "MEM_guardedalloc.h"
+#include "BLI_blenlib.h"
+#include "BSE_editipo.h"
+#include "BIF_space.h"
+#include "mydevice.h"
 #include "constant.h"
-#include "gen_utils.h"
-
 #include "MTex.h"
 #include "Texture.h"
-
-#include "Material.h"
 #include "Ipo.h"
-
-
-/* only used for .oopsLoc at the moment */
-#include "DNA_oops_types.h"
-#include "DNA_space_types.h"
+#include "gen_utils.h"
 
 /*****************************************************************************/
 /* Python BPy_Material defaults: */
 #define EXPP_MAT_ZOFFS_MAX                     10.0
 #define EXPP_MAT_HALOSIZE_MIN                   0.0
 #define EXPP_MAT_HALOSIZE_MAX           100.0
-#define EXPP_MAT_FLARESIZE_MIN          0.1
+#define EXPP_MAT_FLARESIZE_MIN          0.1f
 #define EXPP_MAT_FLARESIZE_MAX         25.0
-#define EXPP_MAT_FLAREBOOST_MIN                 0.1
+#define EXPP_MAT_FLAREBOOST_MIN                 0.1f
 #define EXPP_MAT_FLAREBOOST_MAX                10.0
-#define EXPP_MAT_SUBSIZE_MIN                    0.1
+#define EXPP_MAT_SUBSIZE_MIN                    0.1f
 #define EXPP_MAT_SUBSIZE_MAX                   25.0
 
 #define EXPP_MAT_HARD_MIN                               1
@@ -1715,7 +1711,7 @@ static PyObject *Material_setHaloSeed( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [1, 255]" ) );
 
-       self->material->seed1 = EXPP_ClampInt( value, EXPP_MAT_HALOSEED_MIN,
+       self->material->seed1 = (char)EXPP_ClampInt( value, EXPP_MAT_HALOSEED_MIN,
                                               EXPP_MAT_HALOSEED_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1729,7 +1725,7 @@ static PyObject *Material_setFlareSeed( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [1, 255]" ) );
 
-       self->material->seed2 = EXPP_ClampInt( value, EXPP_MAT_FLARESEED_MIN,
+       self->material->seed2 = (char)EXPP_ClampInt( value, EXPP_MAT_FLARESEED_MIN,
                                               EXPP_MAT_FLARESEED_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1744,7 +1740,7 @@ static PyObject *Material_setHardness( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [1, 255]" ) );
 
-       self->material->har = EXPP_ClampInt( value, EXPP_MAT_HARD_MIN,
+       self->material->har = (short)EXPP_ClampInt( value, EXPP_MAT_HARD_MIN,
                                             EXPP_MAT_HARD_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1758,7 +1754,7 @@ static PyObject *Material_setNFlares( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [1, 32]" ) );
 
-       self->material->flarec = EXPP_ClampInt( value, EXPP_MAT_NFLARES_MIN,
+       self->material->flarec = (short)EXPP_ClampInt( value, EXPP_MAT_NFLARES_MIN,
                                                EXPP_MAT_NFLARES_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1772,7 +1768,7 @@ static PyObject *Material_setNStars( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [3, 50]" ) );
 
-       self->material->starc = EXPP_ClampInt( value, EXPP_MAT_NSTARS_MIN,
+       self->material->starc = (short)EXPP_ClampInt( value, EXPP_MAT_NSTARS_MIN,
                                               EXPP_MAT_NSTARS_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1786,7 +1782,7 @@ static PyObject *Material_setNLines( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [0, 250]" ) );
 
-       self->material->linec = EXPP_ClampInt( value, EXPP_MAT_NLINES_MIN,
+       self->material->linec = (short)EXPP_ClampInt( value, EXPP_MAT_NLINES_MIN,
                                               EXPP_MAT_NLINES_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1800,7 +1796,7 @@ static PyObject *Material_setNRings( BPy_Material * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument in [0, 24]" ) );
 
-       self->material->ringc = EXPP_ClampInt( value, EXPP_MAT_NRINGS_MIN,
+       self->material->ringc = (short)EXPP_ClampInt( value, EXPP_MAT_NRINGS_MIN,
                                               EXPP_MAT_NRINGS_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1830,7 +1826,7 @@ static PyObject *Material_setMirrDepth( BPy_Material * self, PyObject * args )
                                                "expected float argument in [0, 10]" ) );
 
        self->material->ray_depth =
-               EXPP_ClampInt( value, EXPP_MAT_MIRRDEPTH_MIN,
+               (short)EXPP_ClampInt( value, EXPP_MAT_MIRRDEPTH_MIN,
                               EXPP_MAT_MIRRDEPTH_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1891,7 +1887,7 @@ static PyObject *Material_setTransDepth( BPy_Material * self, PyObject * args )
                                                "expected float argument in [0, 10]" ) );
 
        self->material->ray_depth_tra =
-               EXPP_ClampInt( value, EXPP_MAT_TRANSDEPTH_MIN,
+               (short)EXPP_ClampInt( value, EXPP_MAT_TRANSDEPTH_MIN,
                               EXPP_MAT_TRANSDEPTH_MAX );
 
        return EXPP_incr_ret( Py_None );
@@ -1957,8 +1953,8 @@ static PyObject *Material_setTexture( BPy_Material * self, PyObject * args )
 
        self->material->mtex[texnum]->tex = bltex;
        id_us_plus( &bltex->id );
-       self->material->mtex[texnum]->texco = texco;
-       self->material->mtex[texnum]->mapto = mapto;
+       self->material->mtex[texnum]->texco = (short)texco;
+       self->material->mtex[texnum]->mapto = (short)mapto;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -2082,7 +2078,7 @@ static PyObject *Material_getAttr( BPy_Material * self, char *name )
        else if( strcmp( name, "haloSize" ) == 0 )
                attr = PyFloat_FromDouble( ( double ) self->material->hasize );
        else if( strcmp( name, "haloSeed" ) == 0 )
-               attr = PyInt_FromLong( ( double ) self->material->seed1 );
+               attr = PyInt_FromLong( ( long ) self->material->seed1 );
        else if( strcmp( name, "flareSize" ) == 0 )
                attr = PyFloat_FromDouble( ( double ) self->material->
                                           flaresize );
@@ -2090,7 +2086,7 @@ static PyObject *Material_getAttr( BPy_Material * self, char *name )
                attr = PyFloat_FromDouble( ( double ) self->material->
                                           flareboost );
        else if( strcmp( name, "flareSeed" ) == 0 )
-               attr = PyInt_FromLong( ( double ) self->material->seed2 );
+               attr = PyInt_FromLong( ( long ) self->material->seed2 );
        else if( strcmp( name, "subSize" ) == 0 )
                attr = PyFloat_FromDouble( ( double ) self->material->
                                           subsize );
@@ -2118,7 +2114,7 @@ static PyObject *Material_getAttr( BPy_Material * self, char *name )
        else if( strcmp( name, "IOR" ) == 0 )
                attr = PyFloat_FromDouble( ( double ) self->material->ang );
        else if( strcmp( name, "transDepth" ) == 0 )
-               attr = PyInt_FromLong( ( double ) self->material->
+               attr = PyInt_FromLong( ( long ) self->material->
                                       ray_depth_tra );
        else if( strcmp( name, "fresnelTrans" ) == 0 )
                attr = PyFloat_FromDouble( ( double ) self->material->
@@ -2127,7 +2123,7 @@ static PyObject *Material_getAttr( BPy_Material * self, char *name )
                attr = PyFloat_FromDouble( ( double ) self->material->
                                           fresnel_tra_i );
        else if( strcmp( name, "users" ) == 0 )
-               attr = PyInt_FromLong( ( double ) self->material->
+               attr = PyInt_FromLong( ( long ) self->material->
                                           id.us );
   else if (strcmp(name, "oopsLoc") == 0) {
     if (G.soops) { 
@@ -2499,7 +2495,7 @@ int EXPP_synchronizeMaterialLists( Object * object )
                        /* More data mats than object mats */
                        result = expandPtrArray( ( void * ) &object->mat,
                                                 object->totcol, *nmaterials );
-                       object->totcol = *nmaterials;
+                       object->totcol = (char)*nmaterials;
                }
        }                       /* else no synchronization needed, they are of equal length */
 
index 58f2862112b74a010ba2efbfa1cb62274681ca9a..e49aaca1023dbd528f715b4c50fe9eae64ebea7e 100644 (file)
 #define EXPP_MATERIAL_H
 
 #include <Python.h>
-#include <DNA_material_types.h>
-#include <BKE_material.h>
-
+#include "DNA_object_types.h"
+#include "DNA_material_types.h"
 #include "rgbTuple.h"
 
 /*****************************************************************************/
 /* Python BPy_Material structure definition:        */
 /*****************************************************************************/
 typedef struct {
-       PyObject_HEAD Material * material;
+       PyObject_HEAD 
+       Material * material;
        BPy_rgbTuple *col, *amb, *spec, *mir;
 
 } BPy_Material;
index adc852e10e1db7b2a4649db363588f8d7be6c873..b8ac57ec893e23d0715797b467e6b5c9dd604da9 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include <math.h>
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
+#include "Mathutils.h"
+
 #include "BLI_arithb.h"
 #include "PIL_time.h"
 #include "BLI_rand.h"
-#include "blendef.h"
-#include "mydevice.h"
-#include "constant.h"
 #include "gen_utils.h"
-#include "Mathutils.h"
+
 //-------------------------DOC STRINGS ---------------------------
 static char M_Mathutils_doc[] = "The Blender Mathutils module\n\n";
 static char M_Mathutils_Vector_doc[] = "() - create a new vector object from a list of floats";
@@ -145,7 +138,7 @@ PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec)
                for(y = 0; y < mat->colSize; y++) {
                        dot += mat->matrix[x][y] * vecCopy[y];
                }
-               vecNew[z++] = dot;
+               vecNew[z++] = (float)dot;
                dot = 0.0f;
        }
        return (PyObject *) newVectorObject(vecNew, vec->size, Py_NEW);
@@ -180,7 +173,7 @@ PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat)
                for(y = 0; y < mat->rowSize; y++) {
                        dot += mat->matrix[y][x] * vecCopy[y];
                }
-               vecNew[z++] = dot;
+               vecNew[z++] = (float)dot;
                dot = 0.0f;
        }
        return (PyObject *) newVectorObject(vecNew, size, Py_NEW);
@@ -260,7 +253,7 @@ PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args)
                        return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n");
                }
-               vec[i]=PyFloat_AS_DOUBLE(f);
+               vec[i]=(float)PyFloat_AS_DOUBLE(f);
                EXPP_decr2(f,v);
        }
        Py_DECREF(listObject);
@@ -479,7 +472,7 @@ PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args)
                                        return EXPP_ReturnPyObjError(PyExc_AttributeError, 
                                                "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n");
                                }
-                               matrix[(seqSize*i)+j]=PyFloat_AS_DOUBLE(f);
+                               matrix[(seqSize*i)+j]=(float)PyFloat_AS_DOUBLE(f);
                                EXPP_decr2(f,s);
                        }
                        Py_DECREF(m);
@@ -955,14 +948,14 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args)
                        return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
                }
-               quat[i] = PyFloat_AS_DOUBLE(f);
+               quat[i] = (float)PyFloat_AS_DOUBLE(f);
                EXPP_decr2(f, q);
        }
        if(size == 3){ //calculate the quat based on axis/angle
                norm = sqrt(quat[0] * quat[0] + quat[1] * quat[1] + quat[2] * quat[2]);
-               quat[0] /= norm;
-               quat[1] /= norm;
-               quat[2] /= norm;
+               quat[0] /= (float)norm;
+               quat[1] /= (float)norm;
+               quat[2] /= (float)norm;
 
                angle = angle * (Py_PI / 180);
                quat[3] =(float) (sin(angle/ 2.0f)) * quat[2];
@@ -1026,7 +1019,7 @@ PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args)
                               tempQuat[2] * tempQuat[2] + tempQuat[3] * tempQuat[3]);
 
        for(x = 0; x < 4; x++) {
-               tempQuat[x] /= (dot * dot);
+               tempQuat[x] /= (float)(dot * dot);
        }
        QuatMul(quat, tempQuat, quatV->quat);
        return (PyObject *) newQuaternionObject(quat, Py_NEW);
@@ -1081,10 +1074,10 @@ PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args)
                y = sin(param * angle) * IsinT;
        }
        //interpolate
-       quat[0] = quat_u[0] * x + quat_v[0] * y;
-       quat[1] = quat_u[1] * x + quat_v[1] * y;
-       quat[2] = quat_u[2] * x + quat_v[2] * y;
-       quat[3] = quat_u[3] * x + quat_v[3] * y;
+       quat[0] = (float)(quat_u[0] * x + quat_v[0] * y);
+       quat[1] = (float)(quat_u[1] * x + quat_v[1] * y);
+       quat[2] = (float)(quat_u[2] * x + quat_v[2] * y);
+       quat[3] = (float)(quat_u[3] * x + quat_v[3] * y);
 
        return (PyObject *) newQuaternionObject(quat, Py_NEW);
 }
@@ -1135,7 +1128,7 @@ PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args)
                        return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                "Mathutils.Euler(): 3d numeric sequence expected\n");
                }
-               eul[i]=PyFloat_AS_DOUBLE(f);
+               eul[i]=(float)PyFloat_AS_DOUBLE(f);
                EXPP_decr2(f,e);
        }
        Py_DECREF(listObject);
index 938d3128543c3f183959f6381085b65753acab7a..5987cee9e7adc5fdeb10dfe1566ec4a2fcece8b1 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Metaball.h"
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_mball.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-
-#include "constant.h"
+#include "Metaball.h" /*This must come first*/
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_mball.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "DNA_object_types.h"
 #include "gen_utils.h"
 
-
-
 /*****************************************************************************/
 /* Python API function prototypes for the Metaball module.                   */
 /*****************************************************************************/
@@ -421,14 +417,14 @@ static PyObject *Metaball_addMetaelem( BPy_Metaball * self, PyObject * args )
 
 
        type = PyInt_AsLong( PyList_GetItem( listargs, 0 ) );
-       x = PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
-       y = PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
-       z = PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );
-       rad = PyFloat_AsDouble( PyList_GetItem( listargs, 4 ) );
-       s = PyFloat_AsDouble( PyList_GetItem( listargs, 6 ) );
-       expx = PyFloat_AsDouble( PyList_GetItem( listargs, 7 ) );
-       expy = PyFloat_AsDouble( PyList_GetItem( listargs, 8 ) );
-       expz = PyFloat_AsDouble( PyList_GetItem( listargs, 9 ) );
+       x = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+       y = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+       z = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );
+       rad = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 4 ) );
+       s = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 6 ) );
+       expx = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 7 ) );
+       expy = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 8 ) );
+       expz = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 9 ) );
 
        ml = MEM_callocN( sizeof( MetaElem ), "metaelem" );
        BLI_addhead( &( self->metaball->elems ), ml );
@@ -439,11 +435,11 @@ static PyObject *Metaball_addMetaelem( BPy_Metaball * self, PyObject * args )
        ml->rad = rad;
        ml->s = s;
        ml->flag = SELECT;
-       ml->type = type;
+       ml->type = (short)type;
        ml->expx = expx;
        ml->expy = expy;
        ml->expz = expz;
-       ml->type = type;
+       ml->type = (short)type;
        allqueue( 0X4013, 0 );
        Py_INCREF( Py_None );
        return Py_None;
@@ -540,7 +536,7 @@ static PyObject *Metaball_setloc( BPy_Metaball * self, PyObject * args )
                         ( PyExc_TypeError, "expected a list" ) );
        for( i = 0; i < 3; i++ ) {
                PyObject *xx = PyList_GetItem( listargs, i );
-               self->metaball->loc[i] = PyFloat_AsDouble( xx );
+               self->metaball->loc[i] = (float)PyFloat_AsDouble( xx );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -567,7 +563,7 @@ static PyObject *Metaball_setrot( BPy_Metaball * self, PyObject * args )
                         ( PyExc_TypeError, "expected a list" ) );
        for( i = 0; i < 3; i++ ) {
                PyObject *xx = PyList_GetItem( listargs, i );
-               self->metaball->rot[i] = PyFloat_AsDouble( xx );
+               self->metaball->rot[i] = (float)PyFloat_AsDouble( xx );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -617,7 +613,7 @@ static PyObject *Metaball_setsize( BPy_Metaball * self, PyObject * args )
                         ( PyExc_TypeError, "expected a list" ) );
        for( i = 0; i < 3; i++ ) {
                PyObject *xx = PyList_GetItem( listargs, i );
-               self->metaball->size[i] = PyFloat_AsDouble( xx );
+               self->metaball->size[i] = (float)PyFloat_AsDouble( xx );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -762,7 +758,7 @@ static PyObject *Metaball_setMetadata( BPy_Metaball * self, PyObject * args )
                ptr = ptr->next;
        }
        if( !strcmp( name, "type" ) ) {
-               ptr->type = intval;
+               ptr->type = (short)intval;
                return ( PyInt_FromLong( intval ) );
        }
        if( !strcmp( name, "x" ) ) {
@@ -841,7 +837,7 @@ static PyObject *Metaball_setMetatype( BPy_Metaball * self, PyObject * args )
        for( i = 0; i < num; i++ ) {
                ptr = ptr->next;
        }
-       ptr->type = val;
+       ptr->type = (short)val;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1166,11 +1162,11 @@ static PyObject *Metaelem_setdims( BPy_Metaelem * self, PyObject * args )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "expected a list" ) );
        self->metaelem->expx =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
        self->metaelem->expy =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
        self->metaelem->expz =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -1197,9 +1193,9 @@ static PyObject *Metaelem_setcoords( BPy_Metaelem * self, PyObject * args )
        if( !PyList_Check( listargs ) )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "expected a list" ) );
-       self->metaelem->x = PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
-       self->metaelem->y = PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
-       self->metaelem->z = PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+       self->metaelem->x = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+       self->metaelem->y = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+       self->metaelem->z = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -1252,11 +1248,11 @@ static int MetaelemSetAttr( BPy_Metaelem * self, char *name, PyObject * value )
                return 0;
        }
        if( !strcmp( name, "rad" ) ) {
-               self->metaelem->rad = PyFloat_AsDouble( value );
+               self->metaelem->rad = (float)PyFloat_AsDouble( value );
                return 0;
        }
        if( !strcmp( name, "stif" ) ) {
-               self->metaelem->s = PyFloat_AsDouble( value );
+               self->metaelem->s = (float)PyFloat_AsDouble( value );
                return 0;
        }
        return ( EXPP_ReturnIntError
index b190b53dce3ad88b6c9cd4ff00ba93202e10c644..7d3e9272d3e76466a028651e9734d9813ad0caeb 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_METABALL_H
 
 #include <Python.h>
-#include <DNA_meta_types.h>
+#include "DNA_meta_types.h"
 
 
 extern PyTypeObject Metaball_Type;
index 088d6a5d0c77da5c0f557035fba85f87925327e9..f2d9b657816f00f129bf5dfe167bd8d23f0c3279 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "NLA.h"
-#include "Object.h"
-#include <BKE_action.h>
-#include <BKE_global.h>
-#include <BKE_main.h>
+#include "NLA.h" /*This must come first*/
 
+#include "BKE_action.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "Object.h"
 #include "Ipo.h"
-#include "Types.h"
+#include "gen_utils.h"
 
 /*****************************************************************************/
 /* Python API function prototypes for the NLA module.                   */
index 435cc201183484ff1323144289f7a34d4c84ea9d..11b44f2401b2ccc0ad833ce8bc085c1991beedcb 100644 (file)
 #define EXPP_NLA_H
 
 #include <Python.h>
-#include <DNA_action_types.h>
+#include "DNA_action_types.h"
 
 /** NLA module initialization function. */
 PyObject *NLA_Init( void );
 
 /** Python BPy_NLA structure definition. */
 typedef struct {
-       PyObject_HEAD bAction * action;
+       PyObject_HEAD 
+       bAction * action;
 } BPy_Action;
 
 PyObject *Action_CreatePyObject( struct bAction *action );
index 3df88a55036c6633b558dfa2825b42aad3a2e8de..57768be2464b07563129528a7e2db9d46a4280d2 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "NMesh.h"
+#include "NMesh.h" /*This must come first*/
 
 #include "DNA_key_types.h"
-#include "DNA_listBase.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_scene_types.h"
-
+#include "DNA_oops_types.h"
+#include "DNA_space_types.h"
 #include "BDR_editface.h"      /* make_tfaces */
+#include "BDR_vpaint.h"
+#include "BDR_editobject.h"
 #include "BIF_editdeform.h"
 #include "BIF_editkey.h"       /* insert_meshkey */
-#include "BIF_editmesh.h"
-#include "BIF_meshtools.h"
-#include "BIF_space.h"
+#include "BIF_meshtools.h"   /* current loc of vertexnormals_mesh() */
+#include "BIF_editview.h"
 #include "BKE_deform.h"
 #include "BKE_mesh.h"
+#include "BKE_material.h"
 #include "BKE_main.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_displist.h"
 #include "BKE_DerivedMesh.h"
-#include "BKE_screen.h"
 #include "BKE_object.h"
-#include "BLI_blenlib.h"
 #include "BLI_arithb.h"
 #include "MEM_guardedalloc.h"
 #include "BKE_utildefines.h"
 #include "blendef.h"
 #include "mydevice.h"
-
 #include "Object.h"
 #include "Mathutils.h"
 #include "constant.h"
 #include "gen_utils.h"
 
-/* only used for ob.oopsloc at the moment */
-#include "DNA_oops_types.h"
-#include "DNA_space_types.h"
+extern void countall(void);
 
 /* EXPP Mesh defines */
 
@@ -333,7 +328,7 @@ static PyObject *M_NMesh_Col( PyObject * self, PyObject * args )
        short r = 255, g = 255, b = 255, a = 255;
 
        if( PyArg_ParseTuple( args, "|hhhh", &r, &g, &b, &a ) )
-               return ( PyObject * ) newcol( r, g, b, a );
+               return ( PyObject * ) newcol( (unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a );
 
        return NULL;
 }
@@ -367,13 +362,13 @@ static int NMCol_setattr( PyObject * self, char *name, PyObject * v )
        ival = ( short ) EXPP_ClampInt( ival, 0, 255 );
 
        if( strcmp( name, "r" ) == 0 )
-               mc->r = ival;
+               mc->r = (unsigned char)ival;
        else if( strcmp( name, "g" ) == 0 )
-               mc->g = ival;
+               mc->g = (unsigned char)ival;
        else if( strcmp( name, "b" ) == 0 )
-               mc->b = ival;
+               mc->b = (unsigned char)ival;
        else if( strcmp( name, "a" ) == 0 )
-               mc->a = ival;
+               mc->a = (unsigned char)ival;
        else
                return -1;
 
@@ -606,7 +601,7 @@ static int NMFace_setattr( PyObject * self, char *name, PyObject * v )
                }
        } else if( !strcmp( name, "mat" ) || !strcmp( name, "materialIndex" ) ) {
                PyArg_Parse( v, "h", &ival );
-               mf->mat_nr = ival;
+               mf->mat_nr = (char)ival;
 
                return 0;
        } else if( strcmp( name, "smooth" ) == 0 ) {
@@ -648,7 +643,7 @@ static int NMFace_setattr( PyObject * self, char *name, PyObject * v )
                return 0;
        } else if( strcmp( name, "transp" ) == 0 ) {
                PyArg_Parse( v, "h", &ival );
-               mf->transp = ival;
+               mf->transp = (unsigned char)ival;
 
                return 0;
        } else if( strcmp( name, "image" ) == 0 ) {
@@ -847,7 +842,7 @@ static int NMVert_ass_item( BPy_NMVert * self, int i, PyObject * ob )
                return EXPP_ReturnIntError( PyExc_IndexError,
                                            "NMVert member must be a number" );
 
-       self->co[i] = PyFloat_AsDouble( ob );
+       self->co[i] = (float)PyFloat_AsDouble( ob );
 
        return 0;
 }
@@ -1147,7 +1142,7 @@ static PyObject *NMesh_insertKey( PyObject * self, PyObject * args )
        if( fra > 0 ) {
                fra = EXPP_ClampInt( fra, 1, NMESH_FRAME_MAX );
                oldfra = G.scene->r.cfra;
-               G.scene->r.cfra = fra;
+               G.scene->r.cfra = (short)fra;
        }
 
        if( !mesh )
@@ -1157,7 +1152,7 @@ static PyObject *NMesh_insertKey( PyObject * self, PyObject * args )
        insert_meshkey( mesh, typenum );
 
        if( fra > 0 )
-               G.scene->r.cfra = oldfra;
+               G.scene->r.cfra = (short)oldfra;
 
        return EXPP_incr_ret( Py_None );
 }
@@ -1334,7 +1329,7 @@ static PyObject *NMesh_update( PyObject *self, PyObject *a, PyObject *kwd )
                while (base) {
                        if (base->object == nmesh->object) {
                                base->flag |= SELECT;
-                               nmesh->object->flag = base->flag;
+                               nmesh->object->flag = (short)base->flag;
                                set_active_base (base);
                                needs_redraw = 0; /* already done in make_vertexcol */
                                break;
@@ -1757,7 +1752,7 @@ static int NMesh_setattr( PyObject * self, char *name, PyObject * v )
                smoothresh = ( short ) PyInt_AsLong( v );
 
                me->smoothresh =
-                       EXPP_ClampInt( smoothresh, NMESH_SMOOTHRESH_MIN,
+                       (short)EXPP_ClampInt( smoothresh, NMESH_SMOOTHRESH_MIN,
                                       NMESH_SMOOTHRESH_MAX );
        }
 
@@ -1938,9 +1933,9 @@ static BPy_NMVert *nmvert_from_data( MVert * vert, MSticky * st, float *co,
        mv->co[1] = co[1];
        mv->co[2] = co[2];
 
-       mv->no[0] = vert->no[0] / 32767.0;
-       mv->no[1] = vert->no[1] / 32767.0;
-       mv->no[2] = vert->no[2] / 32767.0;
+       mv->no[0] = (float)(vert->no[0] / 32767.0);
+       mv->no[1] = (float)(vert->no[1] / 32767.0);
+       mv->no[2] = (float)(vert->no[2] / 32767.0);
 
        if( st ) {
                mv->uvco[0] = st->co[0];
@@ -2201,9 +2196,9 @@ static void mvert_from_data( MVert * mv, MSticky * st, BPy_NMVert * from )
        mv->co[1] = from->co[1];
        mv->co[2] = from->co[2];
 
-       mv->no[0] = from->no[0] * 32767.0;
-       mv->no[1] = from->no[1] * 32767.0;
-       mv->no[2] = from->no[2] * 32767.0;
+       mv->no[0] = (short)(from->no[0] * 32767.0);
+       mv->no[1] = (short)(from->no[1] * 32767.0);
+       mv->no[2] = (short)(from->no[2] * 32767.0);
 
        mv->flag = ( from->flag & 1 );
        mv->mat_nr = 0;
@@ -2271,7 +2266,7 @@ static int assignFaceUV( TFace * tf, BPy_NMFace * nmface )
                tf->tpage = 0;
 
        tf->mode = nmface->mode;        /* copy mode */
-       tf->flag = nmface->flag;        /* copy flag */
+       tf->flag = (char)nmface->flag;  /* copy flag */
        tf->transp = nmface->transp;    /* copy transp flag */
 
        /* assign vertex colours */
@@ -2448,7 +2443,7 @@ Material **nmesh_updateMaterials( BPy_NMesh * nmesh )
        } else {
                matlist = 0;
        }
-       mesh->totcol = len;
+       mesh->totcol = (short)len;
 
 /**@ This is another ugly fix due to the weird material handling of blender.
        * it makes sure that object material lists get updated (by their length)
@@ -2475,8 +2470,8 @@ PyObject *NMesh_assignMaterials_toObject( BPy_NMesh * nmesh, Object * ob )
        nmats = PyList_Size( nmesh->materials );
 
        if( nmats > 0 && !mesh->mat ) {
-               ob->totcol = nmats;
-               mesh->totcol = nmats;
+               ob->totcol = (char)nmats;
+               mesh->totcol = (short)nmats;
                mesh->mat =
                        MEM_callocN( sizeof( void * ) * nmats, "bpy_memats" );
 
@@ -3513,7 +3508,7 @@ static PyObject *NMesh_removeVertGroup( PyObject * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_AttributeError,
                                              "no deform groups assigned to mesh" );
        nIndex++;
-       object->actdef = nIndex;
+       object->actdef = (unsigned short)nIndex;
 
        del_defgroup( object );
 
@@ -3659,7 +3654,7 @@ static PyObject *NMesh_removeVertsFromGroup( PyObject * self, PyObject * args )
                }
                //set current vertex group
                nIndex++;
-               object->actdef = nIndex;
+               object->actdef = (unsigned short)nIndex;
 
                //clear all dVerts in active group
                remove_verts_defgroup( 1 );
index 19b02cf62498688ee4af31121ab18554507ab7ff..9bde2a9940ade3cfe63fe3f0fd7781e4a340e137 100644 (file)
 #ifndef EXPP_NMESH_H
 #define EXPP_NMESH_H
 
-#include "Python.h"
+#include <Python.h>
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include <DNA_mesh_types.h>
-#include <DNA_meshdata_types.h>
-
-#include <BIF_editview.h> /* for set_active_base */
-#include <BSE_edit.h> /* for countall */
-#include <BDR_vpaint.h> /* for make_vertexcol */
-
+#include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
 #include "Material.h"
 #include "Image.h"
 
index 8182201d07622be3de1a6cafb88e0581b7e25e9f..dc55565197c13a78bdb9f6a2951e64c07f58661d 100644 (file)
@@ -38,9 +38,9 @@
 /************************/
 
 #include <Python.h>
-#include <math.h>
-#include <BLI_blenlib.h>
-#include <DNA_texture_types.h>
+
+#include "BLI_blenlib.h"
+#include "DNA_texture_types.h"
 #include "constant.h"
 
 /*-----------------------------------------*/
@@ -136,10 +136,10 @@ static void randuvec( float v[3] )
        float r;
        v[2] = 2.f * frand(  ) - 1.f;
        if( ( r = 1.f - v[2] * v[2] ) > 0.f ) {
-               float a = 6.283185307f * frand(  );
-               r = sqrt( r );
-               v[0] = r * cos( a );
-               v[1] = r * sin( a );
+               float a = (float)(6.283185307f * frand(  ));
+               r = (float)sqrt( r );
+               v[0] = (float)(r * cos( a ));
+               v[1] = (float)(r * sin( a ));
        } else
                v[2] = 1.f;
 }
@@ -191,11 +191,11 @@ static PyObject *Noise_noise( PyObject * self, PyObject * args )
 static void vNoise( float x, float y, float z, int nb, float v[3] )
 {
        /* Simply evaluate noise at 3 different positions */
-       v[0] = 2.0 * BLI_gNoise( 1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
-                                nb ) - 1.0;
-       v[1] = 2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0;
-       v[2] = 2.0 * BLI_gNoise( 1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
-                                nb ) - 1.0;
+       v[0] = (float)(2.0 * BLI_gNoise( 1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
+                                nb ) - 1.0);
+       v[1] = (float)(2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0);
+       v[2] = (float)(2.0 * BLI_gNoise( 1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
+                                nb ) - 1.0);
 }
 
 static PyObject *Noise_vNoise( PyObject * self, PyObject * args )
@@ -218,17 +218,17 @@ static float turb( float x, float y, float z, int oct, int hard, int nb,
        float amp, out, t;
        int i;
        amp = 1.f;
-       out = 2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0;
+       out = (float)(2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0);
        if( hard )
-               out = fabs( out );
+               out = (float)fabs( out );
        for( i = 1; i < oct; i++ ) {
                amp *= ampscale;
                x *= freqscale;
                y *= freqscale;
                z *= freqscale;
-               t = amp * ( 2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0 );
+               t = (float)(amp * ( 2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0 ));
                if( hard )
-                       t = fabs( t );
+                       t = (float)fabs( t );
                out += t;
        }
        return out;
@@ -257,9 +257,9 @@ static void vTurb( float x, float y, float z, int oct, int hard, int nb,
        amp = 1.f;
        vNoise( x, y, z, nb, v );
        if( hard ) {
-               v[0] = fabs( v[0] );
-               v[1] = fabs( v[1] );
-               v[2] = fabs( v[2] );
+               v[0] = (float)fabs( v[0] );
+               v[1] = (float)fabs( v[1] );
+               v[2] = (float)fabs( v[2] );
        }
        for( i = 1; i < oct; i++ ) {
                amp *= ampscale;
@@ -268,9 +268,9 @@ static void vTurb( float x, float y, float z, int oct, int hard, int nb,
                z *= freqscale;
                vNoise( x, y, z, nb, t );
                if( hard ) {
-                       t[0] = fabs( t[0] );
-                       t[1] = fabs( t[1] );
-                       t[2] = fabs( t[2] );
+                       t[0] = (float)fabs( t[0] );
+                       t[1] = (float)fabs( t[1] );
+                       t[2] = (float)fabs( t[2] );
                }
                v[0] += amp * t[0];
                v[1] += amp * t[1];
index 2d3585f5f1e496a18bd681c5343110379b26b951..6841fbadc02e824e4ef67f6ded2cbf21888edeee 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "Object.h"
-#include "NLA.h"
-#include "logic.h"
-#include "blendef.h"
+struct SpaceIpo;
+struct rctf;
 
-#include "DNA_scene_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_object_force.h"
-#include "DNA_property_types.h"
+#include "Object.h" /*This must come first */
 
+#include "DNA_view3d_types.h"
+#include "DNA_object_force.h"
+#include "DNA_userdef_types.h"
 #include "BKE_depsgraph.h"
+#include "BKE_effect.h"
 #include "BKE_font.h"
 #include "BKE_property.h"
 #include "BKE_mball.h"
 #include "BKE_softbody.h"
 #include "BKE_utildefines.h"
-
+#include "BKE_armature.h"
+#include "BKE_lattice.h"
+#include "BKE_mesh.h"
+#include "BKE_library.h"
+#include "BKE_object.h"
+#include "BKE_curve.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 #include "BIF_editview.h"
 #include "BSE_editipo.h"
 #include "BSE_edit.h"
-
+#include "BIF_space.h"
+#include "DNA_oops_types.h" 
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BDR_editobject.h"
+#include "MEM_guardedalloc.h"
+#include "mydevice.h"
+#include "blendef.h"
+#include "Scene.h"
+#include "Mathutils.h"
+#include "NMesh.h"
+#include "Curve.h"
 #include "Ipo.h"
+#include "Armature.h"
+#include "Camera.h"
+#include "Lamp.h"
 #include "Lattice.h"
-#include "modules.h"
-#include "Mathutils.h"
-#include "constant.h"
-/* only used for oops location get/set at the moment */
-#include "DNA_oops_types.h" 
-#include "DNA_space_types.h"
-
-#include <string.h>
+#include "Text.h"
+#include "Text3d.h"
+#include "Metaball.h"
+#include "Draw.h"
+#include "NLA.h"
+#include "logic.h"
+#include "gen_utils.h"
 
 /* Defines for insertIpoKey */
 
@@ -631,7 +649,7 @@ PyObject *M_Object_New( PyObject * self, PyObject * args )
 
        object->id.us = 0;
        object->flag = 0;
-       object->type = type;
+       object->type = (short)type;
 
 
        /* transforms */
@@ -670,9 +688,9 @@ PyObject *M_Object_New( PyObject * self, PyObject * args )
        /* Gameengine defaults */
        object->mass = 1.0;
        object->inertia = 1.0;
-       object->formfactor = 0.4;
-       object->damping = 0.04;
-       object->rdamping = 0.1;
+       object->formfactor = 0.4f;
+       object->damping = 0.04f;
+       object->rdamping = 0.1f;
        object->anisotropicFriction[0] = 1.0;
        object->anisotropicFriction[1] = 1.0;
        object->anisotropicFriction[2] = 1.0;
@@ -1757,7 +1775,7 @@ static PyObject *internal_makeParent(Object *parent, PyObject *py_child,
        if (partype == PARSKEL && child->type != OB_MESH)
                child->partype = PAROBJECT;
        else
-               child->partype = partype;
+               child->partype = (short)partype;
 
        if (partype == PARVERT3) {
                child->par1 = v1;
@@ -1850,9 +1868,9 @@ static PyObject *Object_setDrawType( BPy_Object * self, PyObject * args )
 
 static PyObject *Object_setEuler( BPy_Object * self, PyObject * args )
 {
-       float rot1;
-       float rot2;
-       float rot3;
+       float rot1 = 0.0f;
+       float rot2 = 0.0f;
+       float rot3 = 0.0f;
        int status = 0;         /* failure */
        PyObject *ob;
 
@@ -2077,8 +2095,8 @@ static PyObject *Object_setMaterials( BPy_Object * self, PyObject * args )
                                id_us_plus( ( ID * ) matlist[i] );
                }
                self->object->mat = matlist;
-               self->object->totcol = len;
-               self->object->actcol = len;
+               self->object->totcol = (char)len;
+               self->object->actcol = (char)len;
 
                switch ( self->object->type ) {
                case OB_CURVE:  /* fall through */
@@ -2224,9 +2242,6 @@ static PyObject *Object_shareFrom( BPy_Object * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "type not supported" );
        }
-
-       Py_INCREF( Py_None );
-       return ( Py_None );
 }
 
 
@@ -2245,11 +2260,11 @@ static PyObject *Object_Select( BPy_Object * self, PyObject * args )
                if( base->object == self->object ) {
                        if( sel == 1 ) {
                                base->flag |= SELECT;
-                               self->object->flag = base->flag;
+                               self->object->flag = (short)base->flag;
                                set_active_base( base );
                        } else {
                                base->flag &= ~SELECT;
-                               self->object->flag = base->flag;
+                               self->object->flag = (short)base->flag;
                        }
                        break;
                }
index 52bdbd27bf25cfd5778e766b897e884b4f3bdf9b..c97e2346c07df77a132ee05da0ae0026a18fbb00 100644 (file)
 #define EXPP_OBJECT_H
 
 #include <Python.h>
-#include <stdio.h>
-#include "BDR_editobject.h"
-#include "BKE_armature.h"
-#include "BKE_curve.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_lattice.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_scene.h"
-#include "BKE_displist.h"      /* for makeDispList */
-#include "BKE_font.h"          /* for text_to_font */
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
-#include "DNA_ID.h"
-#include "DNA_listBase.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_action_types.h"
-
-#include "gen_utils.h"
-
+#include "DNA_object_types.h"
 
 /* The Object PyType Object defined in Object.c */
 extern PyTypeObject Object_Type;
@@ -71,7 +46,8 @@ extern PyTypeObject Object_Type;
 /* Python BPy_Object structure definition.                                  */
 /*****************************************************************************/
 typedef struct {
-       PyObject_HEAD struct Object *object;
+       PyObject_HEAD 
+       struct Object *object;
 } BPy_Object;
 
 
index dc6bee205fbbdb524e0025ac3d4cfa213614b462..b790988fe68f00717eb6185e8e0deed0cacc3350 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Particle.h"
-#include "Effect.h"
+#include "Particle.h" /*This must come first */
+
+#include "DNA_object_types.h"
+#include "BKE_effect.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "gen_utils.h"
 
 /*****************************************************************************/
 /* Python BPy_Particle methods table:                                        */
@@ -205,7 +210,6 @@ PyObject *M_Particle_New( PyObject * self, PyObject * args )
        pyeffect->effect = bleffect;
 
        return ( PyObject * ) pyeffect;
-       return 0;
 }
 
 /*****************************************************************************/
@@ -582,9 +586,9 @@ PyObject *Particle_setForce( BPy_Particle * self, PyObject * args )
        float val[3];
        if( PyTuple_Size( args ) == 1 )
                args = PyTuple_GetItem( args, 0 );
-       val[0] = PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
-       val[1] = PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
-       val[2] = PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
+       val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
+       val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
+       val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
        /*
           if (!PyArg_ParseTuple(args, "fff", val,val+1,val+2 ))
           return(EXPP_ReturnPyObjError(PyExc_AttributeError,\
@@ -613,10 +617,10 @@ PyObject *Particle_setMult( BPy_Particle * self, PyObject * args )
        float val[4];
        if( PyTuple_Size( args ) == 1 )
                args = PyTuple_GetItem( args, 0 );
-       val[0] = PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
-       val[1] = PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
-       val[2] = PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
-       val[3] = PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
+       val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
+       val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
+       val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
+       val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
        ptr->mult[0] = val[0];
        ptr->mult[1] = val[1];
        ptr->mult[2] = val[2];
@@ -644,10 +648,10 @@ PyObject *Particle_setLife( BPy_Particle * self, PyObject * args )
        float val[4];
        if( PyTuple_Size( args ) == 1 )
                args = PyTuple_GetItem( args, 0 );
-       val[0] = PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
-       val[1] = PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
-       val[2] = PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
-       val[3] = PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
+       val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
+       val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
+       val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
+       val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
        ptr->life[0] = val[0];
        ptr->life[1] = val[1];
        ptr->life[2] = val[2];
@@ -674,14 +678,14 @@ PyObject *Particle_setChild( BPy_Particle * self, PyObject * args )
        float val[4];
        if( PyTuple_Size( args ) == 1 )
                args = PyTuple_GetItem( args, 0 );
-       val[0] = PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
-       val[1] = PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
-       val[2] = PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
-       val[3] = PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
-       ptr->child[0] = val[0];
-       ptr->child[1] = val[1];
-       ptr->child[2] = val[2];
-       ptr->child[3] = val[3];
+       val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
+       val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
+       val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
+       val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
+       ptr->child[0] = (short)val[0];
+       ptr->child[1] = (short)val[1];
+       ptr->child[2] = (short)val[2];
+       ptr->child[3] = (short)val[3];
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -704,14 +708,14 @@ PyObject *Particle_setMat( BPy_Particle * self, PyObject * args )
        float val[4];
        if( PyTuple_Size( args ) == 1 )
                args = PyTuple_GetItem( args, 0 );
-       val[0] = PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
-       val[1] = PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
-       val[2] = PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
-       val[3] = PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
-       ptr->mat[0] = val[0];
-       ptr->mat[1] = val[1];
-       ptr->mat[2] = val[2];
-       ptr->mat[3] = val[3];
+       val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
+       val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
+       val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
+       val[3] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 3 ) );
+       ptr->mat[0] = (short)val[0];
+       ptr->mat[1] = (short)val[1];
+       ptr->mat[2] = (short)val[2];
+       ptr->mat[3] = (short)val[3];
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -732,9 +736,9 @@ PyObject *Particle_setDefvec( BPy_Particle * self, PyObject * args )
        float val[3];
        if( PyTuple_Size( args ) == 1 )
                args = PyTuple_GetItem( args, 0 );
-       val[0] = PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
-       val[1] = PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
-       val[2] = PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
+       val[0] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 0 ) );
+       val[1] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 1 ) );
+       val[2] = (float)PyFloat_AsDouble( PyTuple_GetItem( args, 2 ) );
        ptr->defvec[0] = val[0];
        ptr->defvec[1] = val[1];
        ptr->defvec[2] = val[2];
index 9010c50f70dd816e80a227452918772ff9c0de80..b025aebaabc6ac33e7c2ff12f57e345a6c7f09a8 100644 (file)
 #define EXPP_PARTICLE_H
 
 #include <Python.h>
-#include <stdio.h>
+#include "DNA_effect_types.h"
 
-#include <BLI_arithb.h>
-#include <BLI_blenlib.h>
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <DNA_effect_types.h>
-
-#include "gen_utils.h"
 
 extern PyTypeObject Particle_Type;
 
index bf839630aa2925fc22215a46a2e4d619af718ac1..8fa77b20741fc24d52d95795a081eed51ab934a9 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "Registry.h"
-
-#include <stdio.h>
-#include <BKE_global.h> /* G.f & G_DEBUG */
+#include "Registry.h" /*This must come first */
 
+#include "BKE_global.h"
 #include "gen_utils.h"
 
 
index b9ae673ffb11060bbede8fa92392dfa0f9fbf0f7..896038cb91cbde4609f4a0a65ac31d5624a536f8 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
-
-#include <MEM_guardedalloc.h>  /* for MEM_callocN */
-
-#include <DNA_screen_types.h>  /* SPACE_VIEW3D, SPACE_SEQ */
-#include <DNA_scriptlink_types.h>
-
-#include <BKE_depsgraph.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_main.h>
-#include <BKE_scene.h>
-
-#include <BLI_blenlib.h>
-
-#include <BSE_drawview.h>      /* for play_anim */
-#include <BSE_headerbuttons.h> /* for copy_scene */
-
-#include <BIF_drawscene.h>     /* for set_scene */
-#include <BIF_space.h>         /* for copy_view3d_lock() */
-#include <BIF_screen.h>                /* curarea */
-
-#include <mydevice.h>          /* for #define REDRAW */
-
+struct View3D;
+
+#include "Scene.h" /*This must come first */
+
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "MEM_guardedalloc.h"  /* for MEM_callocN */
+#include "DNA_screen_types.h"  /* SPACE_VIEW3D, SPACE_SEQ */
+#include "BKE_depsgraph.h"
+#include "BKE_library.h"
+#include "BKE_scene.h"
+#include "BLI_blenlib.h"
+#include "BSE_drawview.h"      /* for play_anim */
+#include "BSE_headerbuttons.h" /* for copy_scene */
+#include "BIF_drawscene.h"     /* for set_scene */
+#include "BIF_space.h"         /* for copy_view3d_lock() */
+#include "BIF_screen.h"                /* curarea */
+#include "mydevice.h"          /* for #define REDRAW */
+#include "DNA_view3d_types.h"
 #include "Object.h"
-#include "constant.h"
 #include "gen_utils.h"
 #include "sceneRender.h"
 #include "sceneRadio.h"
 
-#include "Scene.h"
 
 static Base *EXPP_Scene_getObjectBase( Scene * scene, Object * object );
 PyObject *M_Object_Get( PyObject * self, PyObject * args ); /* from Object.c */
index 0c04dd498f00cab8943344817ba2d89d933f4b88..56a97ab6bf61e9b098b96cba71c564e6927704de 100644 (file)
@@ -34,7 +34,7 @@
 #define EXPP_SCENE_H
 
 #include <Python.h>
-#include <DNA_scene_types.h>
+#include "DNA_scene_types.h"
 
 /* The Scene PyType Object defined in Scene.c */
 extern PyTypeObject Scene_Type;
@@ -44,7 +44,8 @@ extern PyTypeObject Scene_Type;
 
 //---------------------------Python BPy_Scene structure definition----------
 typedef struct {
-       PyObject_HEAD Scene * scene;
+       PyObject_HEAD 
+       Scene * scene;
 } BPy_Scene;
 //---------------------------Python BPy_Scene visible prototypes-----------
 // Python Scene_Type helper functions needed by Blender (the Init function) and Object modules. 
index 8ba3bd23b8199423d05c4a15d65c33a74673f7cf..21aa8af0691765f8747d05aae28d6180fb3c323d 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_sound.h>
-#include <BLI_blenlib.h>
-#include <BIF_editsound.h>
-#include <BIF_space.h>         /* EXPP_allqueue() */
+#include "Sound.h" /*This must come first*/
 
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BLI_blenlib.h"
+#include "BIF_editsound.h"
 #include "mydevice.h"          /* redraw defines */
-
 #include "gen_utils.h"
 
-#include "Sound.h"
-
 /*****************************************************************************/
 /* Python BPy_Sound defaults:                                  */
 /*****************************************************************************/
@@ -485,7 +480,7 @@ static PyObject *Sound_getAttr( BPy_Sound * self, char *name )
 static int Sound_setAttr( BPy_Sound * self, char *name, PyObject * value )
 {
        PyObject *valtuple;
-       PyObject *error = NULL;
+//     PyObject *error = NULL;
 
 /* We're playing a trick on the Python API users here. Even if they use
  * Sound.member = val instead of Sound.setMember(value), we end up using the
@@ -508,13 +503,15 @@ static int Sound_setAttr( BPy_Sound * self, char *name, PyObject * value )
                                              "attribute not found or immutable" ) );
        }
 
+/*     ===This code is unreachable===
        Py_DECREF( valtuple );
 
        if( error != Py_None )
                return -1;
 
-       Py_DECREF( Py_None );   /* incref'ed by the called set* function */
-       return 0;               /* normal exit */
+       Py_DECREF( Py_None );   // incref'ed by the called set* function /
+       return 0;               // normal exit 
+       */
 }
 
 /*****************************************************************************/
index 22872cec36385fb88760eba204f5eb3c905845c3..fdebc67568f852032106648f6512742fc10a6b06 100644 (file)
 #define EXPP_SOUND_H
 
 #include <Python.h>
-#include <DNA_sound_types.h>
+#include "DNA_sound_types.h"
 
 /*****************************************************************************/
 /* Python BPy_Sound structure definition                                     */
 /*****************************************************************************/
 typedef struct {
-       PyObject_HEAD bSound * sound;
+       PyObject_HEAD 
+       bSound * sound;
 } BPy_Sound;
 
 /*****************************************************************************/
index 64bdc49bf79b6bd6274454ec09d91cd751a957e4..39258f4359584631497ce62db34eb684c097fa43 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <BKE_utildefines.h>
-#include <BLI_blenlib.h>
-#include <DNA_scene_types.h> /* G.scene->r.cfra */
-#include <PIL_time.h>
-#include <Python.h>
-#include <sys/stat.h>
-#include "gen_utils.h"
+#include "Sys.h" /*This must come first*/
 
-#include "Sys.h"
+#include "BKE_utildefines.h"
+#include "BKE_global.h"
+#include "BLI_blenlib.h"
+#include "DNA_scene_types.h" /* G.scene-"r.cfra */
+#include "PIL_time.h"
+#include "gen_utils.h"
 
 /*****************************************************************************/
 /* Python API function prototypes for the sys module.                        */
index 46f3017111d3fade3bd7115ba1c8ab62201eab39..d6e2689bba5b279e21b1e3524f62a8832f5188bd 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef EXPP_sys_H
 #define EXPP_sys_H
 
+#include <Python.h>
+
 PyObject *sys_Init( void );
 
 #endif                         /* EXPP_sys_H */
index 90de9b5bed1f59d32218065a2485e4855281afb2..ab7a1561f58bb4a598e88ca308e8d9ced2391b95 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <Python.h>
-#include <stdio.h>
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_library.h>
-#include <BKE_sca.h>
-#include <BIF_drawtext.h>
-#include <BKE_text.h>
-#include <BLI_blenlib.h>
-#include <DNA_space_types.h>
-#include <DNA_text_types.h>
-
-#include "Text.h"
+#include "Text.h" /*This must come first*/
+
+#include "BKE_library.h"
+#include "BKE_sca.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BIF_drawtext.h"
+#include "BKE_text.h"
+#include "BLI_blenlib.h"
+#include "DNA_space_types.h"
 #include "gen_utils.h"
 #include "../BPY_extern.h"
 
index cf2b29986b4e9d04d44553702a6ae80acafa581b..175cc235bc908c3aa7cd478e49a83f6183e0b296 100644 (file)
@@ -33,7 +33,8 @@
 #ifndef EXPP_TEXT_H
 #define EXPP_TEXT_H
 
-#include <DNA_text_types.h>
+#include <Python.h>
+#include "DNA_text_types.h"
 
 PyObject *Text_Init( void );
 PyObject *Text_CreatePyObject( Text * txt );
index 36888c16d5097fc8c7baafe7c0c5cfbff2af3f05..aa0e6026cfd4fab7d5c1f47a4ff11dfcb85fc906 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
+#include "Text3d.h" /*This must come first*/
 #include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_vfont_types.h"
 #include "MEM_guardedalloc.h"
-#include "BKE_object.h"
-#include "BDR_editobject.h"
-#include "BKE_displist.h"
-#include "MEM_guardedalloc.h"
-#include "mydevice.h"
-#include "blendef.h"
-#include "Text3d.h"
+#include "BKE_curve.h"
+#include "BKE_library.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 #include "Curve.h"
 #include "constant.h"
 #include "Types.h"
 #include "Font.h"
-
-#include "mydevice.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
+#include "gen_utils.h"
 
 //no prototypes declared in header files - external linkage outside of python
 extern VFont *get_builtin_font(void);  
@@ -495,8 +488,8 @@ static PyObject *Text3d_setText( BPy_Text3d * self, PyObject * args )
                MEM_freeN( self->curve->str );
                self->curve->str = MEM_mallocN( strlen (text)+1, "str" );
                strcpy( self->curve->str, text );
-               self->curve->pos = strlen ( text );
-               self->curve->len = strlen ( text );
+               self->curve->pos = (short)strlen ( text );
+               self->curve->len = (short)strlen ( text );
        }
        Py_INCREF( Py_None );
        return Py_None;
@@ -955,7 +948,7 @@ PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * args )
        if( file || !strcmp (fontfile, "<builtin>") ) {
                load_vfont( fontfile );
                if(file) fclose( file );
-               if( (vf=exist_vfont( fontfile )) )
+               if( (vf == exist_vfont( fontfile )) )
                        return Font_CreatePyObject( vf );
                return EXPP_incr_ret( Py_None );
        }
index 26bf1c197c9560ddf616d7aeea830ad2f9f12c7c..f57debdbe3295e32f5d2f83c11d76825a5d0935d 100644 (file)
 #define EXPP_TEXT3D_H
 
 #include <Python.h>
-#include <stdio.h>
-#include <BLI_arithb.h>
-#include <BLI_blenlib.h>
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BKE_curve.h>
-#include <DNA_curve_types.h>
-#include"gen_utils.h"
+#include "DNA_curve_types.h"
 
 #define BPy_Text3d_Check(v) ((v)->ob_type==&Text3d_Type)
 typedef Curve Text3d; 
index 62e57d594d27d0c96b44ac2d80463aec3679d7e5..dbb49fc79fa2109795cbdbb6f413283a5121d74d 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
-
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <BKE_texture.h>
-#include <BKE_utildefines.h>
-
+#include "Texture.h" /*This must come first*/
+
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+#include "DNA_material_types.h"
 #include "MTex.h"
-#include "Texture.h"
 #include "Image.h"
 #include "Ipo.h"
 #include "constant.h"
 #include "gen_utils.h"
 
 
-
 /*****************************************************************************/
 /* Blender.Texture constants                                                 */
 /*****************************************************************************/
@@ -962,7 +960,7 @@ static PyObject *Texture_setAnimFrames( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "frames cannot be negative" );
 
-       self->texture->frames = frames;
+       self->texture->frames = (short)frames;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -979,7 +977,7 @@ static PyObject *Texture_setAnimLength( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "length cannot be negative" );
 
-       self->texture->len = length;
+       self->texture->len = (short)length;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1006,7 +1004,7 @@ static PyObject *Texture_setAnimMontage( BPy_Texture * self, PyObject * args )
 
        for( i = 0; i < 4; ++i )
                for( j = 0; j < 2; ++j )
-                       self->texture->fradur[i][j] = fradur[i][j];
+                       self->texture->fradur[i][j] = (short)fradur[i][j];
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1020,7 +1018,7 @@ static PyObject *Texture_setAnimOffset( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected an int" );
 
-       self->texture->offset = offset;
+       self->texture->offset = (short)offset;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1038,7 +1036,7 @@ static PyObject *Texture_setAnimStart( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "start must be greater than zero" );
 
-       self->texture->sfra = sfra;
+       self->texture->sfra = (short)sfra;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1132,7 +1130,7 @@ static PyObject *Texture_setIntExtend( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "invalid extend mode" );
 
-       self->texture->extend = extend;
+       self->texture->extend = (short)extend;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1150,7 +1148,7 @@ static PyObject *Texture_setFieldsPerImage( BPy_Texture * self,
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "value must be in range [1,200]" );
 
-       self->texture->fie_ima = fie_ima;
+       self->texture->fie_ima = (short)fie_ima;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1207,7 +1205,7 @@ static PyObject *Texture_setIntFlags( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected int argument" );
 
-       self->texture->flag = flags;
+       self->texture->flag = (short)flags;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1286,7 +1284,7 @@ static PyObject *Texture_setIntImageFlags( BPy_Texture * self,
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "image flags MIPMAP and FIELDS cannot be used together" );
 
-       self->texture->imaflag = flags;
+       self->texture->imaflag = (short)flags;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1319,7 +1317,7 @@ static PyObject *Texture_setNoiseDepth( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "value must be in range [0,6]" );
 
-       self->texture->noisedepth = depth;
+       self->texture->noisedepth = (short)depth;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1414,8 +1412,8 @@ static PyObject *Texture_setRepeat( BPy_Texture * self, PyObject * args )
                        return EXPP_ReturnPyObjError( PyExc_ValueError,
                                                      "values must be in range [1,512]" );
 
-       self->texture->xrepeat = repeat[0];
-       self->texture->yrepeat = repeat[1];
+       self->texture->xrepeat = (short)repeat[0];
+       self->texture->yrepeat = (short)repeat[1];
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1488,9 +1486,9 @@ static PyObject *Texture_setIntSType( BPy_Texture * self, PyObject * args )
                                              "invalid stype (for this type)" );
 
        if( self->texture->type == EXPP_TEX_TYPE_ENVMAP )
-               self->texture->env->stype = stype;
+               self->texture->env->stype = (short)stype;
        else
-               self->texture->stype = stype;
+               self->texture->stype = (short)stype;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1608,7 +1606,7 @@ static PyObject *Texture_setIntType( BPy_Texture * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_ValueError,
                                              "invalid type number" );
 
-       self->texture->type = type;
+       self->texture->type = (short)type;
 
        Py_INCREF( Py_None );
        return Py_None;
@@ -1804,7 +1802,7 @@ static PyObject *Texture_getAttr( BPy_Texture * self, char *name )
        else if( STREQ( name, "type" ) )
                attr = PyInt_FromLong( tex->type );
        else if( STREQ( name, "hFracDim" ) )
-               attr = PyInt_FromLong( tex->mg_H );
+               attr = PyInt_FromLong( (long)tex->mg_H );
        else if( STREQ( name, "lacunarity" ) )
                attr = PyFloat_FromDouble( tex->mg_lacunarity );
        else if( STREQ( name, "octs" ) )
index 19788e54c5a62275e4220b3c21ee975e367b1480..d4fcd805ad1cd79470b3fa28c5a452a99b87ec72 100644 (file)
 #define EXPP_TEXTURE_H
 
 #include <Python.h>
-#include <DNA_texture_types.h>
-#include <BKE_texture.h>
-
+#include "DNA_texture_types.h"
 
 /*****************************************************************************/
 /* Python BPy_Texture structure definition                                   */
 /*****************************************************************************/
 
 typedef struct {
-       PyObject_HEAD Tex * texture;
+       PyObject_HEAD 
+       Tex * texture;
 } BPy_Texture;
 
 extern PyTypeObject Texture_Type;
index a4722c17c6ebc86252a775c4b03cfbb779283797..44414e604fb16b4d86919d14feffae30139d092a 100644 (file)
@@ -29,7 +29,7 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "Types.h"
+#include "Types.h" 
 
 char M_Types_doc[] = "The Blender Types module\n\n\
 This module is a dictionary of all Blender Python types";
@@ -103,73 +103,73 @@ PyObject *Types_Init( void )
        /* The Blender Object Type */
 
        PyDict_SetItemString( dict, "ObjectType",
-                             ( PyObject * ) & Object_Type );
+                             ( PyObject * ) &Object_Type );
 
        /* Blender Object Data Types */
 
-       PyDict_SetItemString( dict, "SceneType", ( PyObject * ) & Scene_Type );
+       PyDict_SetItemString( dict, "SceneType", ( PyObject * ) &Scene_Type );
        PyDict_SetItemString( dict, "RenderDataType",
-                             ( PyObject * ) & RenderData_Type );
+                             ( PyObject * ) &RenderData_Type );
 
-       PyDict_SetItemString( dict, "NMeshType", ( PyObject * ) & NMesh_Type );
+       PyDict_SetItemString( dict, "NMeshType", ( PyObject * ) &NMesh_Type );
        PyDict_SetItemString( dict, "NMFaceType",
-                             ( PyObject * ) & NMFace_Type );
+                             ( PyObject * ) &NMFace_Type );
        PyDict_SetItemString( dict, "NMVertType",
-                             ( PyObject * ) & NMVert_Type );
-       PyDict_SetItemString( dict, "NMColType", ( PyObject * ) & NMCol_Type );
+                             ( PyObject * ) &NMVert_Type );
+       PyDict_SetItemString( dict, "NMColType", ( PyObject * ) &NMCol_Type );
 
        PyDict_SetItemString( dict, "ArmatureType",
-                             ( PyObject * ) & Armature_Type );
-       PyDict_SetItemString( dict, "BoneType", ( PyObject * ) & Bone_Type );
+                             ( PyObject * ) &Armature_Type );
+       PyDict_SetItemString( dict, "BoneType", ( PyObject * ) &Bone_Type );
 
        PyDict_SetItemString( dict, "CurNurb_Type",
-                             ( PyObject * ) & CurNurb_Type );
-       PyDict_SetItemString( dict, "CurveType", ( PyObject * ) & Curve_Type );
+                             ( PyObject * ) &CurNurb_Type );
+       PyDict_SetItemString( dict, "CurveType", ( PyObject * ) &Curve_Type );
 
-       PyDict_SetItemString( dict, "IpoType", ( PyObject * ) & Ipo_Type );
+       PyDict_SetItemString( dict, "IpoType", ( PyObject * ) &Ipo_Type );
        PyDict_SetItemString( dict, "MetaballType",
-                             ( PyObject * ) & Metaball_Type );
+                             ( PyObject * ) &Metaball_Type );
 
        PyDict_SetItemString( dict, "CameraType",
-                             ( PyObject * ) & Camera_Type );
-       PyDict_SetItemString( dict, "ImageType", ( PyObject * ) & Image_Type );
-       PyDict_SetItemString( dict, "LampType", ( PyObject * ) & Lamp_Type );
-       PyDict_SetItemString( dict, "TextType", ( PyObject * ) & Text_Type );
-       PyDict_SetItemString( dict, "Text3dType", ( PyObject * ) & Text3d_Type );
+                             ( PyObject * ) &Camera_Type );
+       PyDict_SetItemString( dict, "ImageType", ( PyObject * ) &Image_Type );
+       PyDict_SetItemString( dict, "LampType", ( PyObject * ) &Lamp_Type );
+       PyDict_SetItemString( dict, "TextType", ( PyObject * ) &Text_Type );
+       PyDict_SetItemString( dict, "Text3dType", ( PyObject * ) &Text3d_Type );
        PyDict_SetItemString( dict, "MaterialType",
-                             ( PyObject * ) & Material_Type );
+                             ( PyObject * ) &Material_Type );
 
        PyDict_SetItemString( dict, "ButtonType",
-                             ( PyObject * ) & Button_Type );
+                             ( PyObject * ) &Button_Type );
 
        PyDict_SetItemString( dict, "LatticeType",
-                             ( PyObject * ) & Lattice_Type );
+                             ( PyObject * ) &Lattice_Type );
 
        PyDict_SetItemString( dict, "TextureType",
-                             ( PyObject * ) & Texture_Type );
-       PyDict_SetItemString( dict, "MTexType", ( PyObject * ) & MTex_Type );
+                             ( PyObject * ) &Texture_Type );
+       PyDict_SetItemString( dict, "MTexType", ( PyObject * ) &MTex_Type );
 
        /* External helper Types available to the main ones above */
 
        PyDict_SetItemString( dict, "vectorType",
-                             ( PyObject * ) & vector_Type );
+                             ( PyObject * ) &vector_Type );
        PyDict_SetItemString( dict, "bufferType",
-                             ( PyObject * ) & buffer_Type );
+                             ( PyObject * ) &buffer_Type );
        PyDict_SetItemString( dict, "constantType",
-                             ( PyObject * ) & constant_Type );
+                             ( PyObject * ) &constant_Type );
        PyDict_SetItemString( dict, "rgbTupleType",
-                             ( PyObject * ) & rgbTuple_Type );
+                             ( PyObject * ) &rgbTuple_Type );
        PyDict_SetItemString( dict, "matrix_Type",
-                             ( PyObject * ) & matrix_Type );
-       PyDict_SetItemString( dict, "eulerType", ( PyObject * ) & euler_Type );
+                             ( PyObject * ) &matrix_Type );
+       PyDict_SetItemString( dict, "eulerType", ( PyObject * ) &euler_Type );
        PyDict_SetItemString( dict, "quaternionType",
-                             ( PyObject * ) & quaternion_Type );
+                             ( PyObject * ) &quaternion_Type );
        PyDict_SetItemString( dict, "BezTripleType",
-                             ( PyObject * ) & BezTriple_Type );
+                             ( PyObject * ) &BezTriple_Type );
        PyDict_SetItemString( dict, "ActionType",
-                             ( PyObject * ) & Action_Type );
+                             ( PyObject * ) &Action_Type );
        PyDict_SetItemString( dict, "propertyType",
-                             ( PyObject * ) & property_Type );
+                             ( PyObject * ) &property_Type );
 
        return submodule;
 }
index e8bbf77c5d1d47714f5a72212bde17eff5d39249..f29ba04a976fdee09eba091b05cba98a26ac2e1c 100644 (file)
@@ -33,7 +33,7 @@
 #ifndef EXPP_TYPES_H
 #define EXPP_TYPES_H
 
-#include "Python.h"
+#include <Python.h>
 
 extern PyTypeObject Action_Type, Armature_Type;
 extern PyTypeObject BezTriple_Type, Bone_Type, Build_Type, Button_Type;
index 930e6e4bd4fad3ebfc697837e4c701de90f8129a..5b0abacc782e4e1147aa4f3837b09af4e23d73b6 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "Wave.h"
-#include "Effect.h"
+#include "Wave.h" /*This must come first*/
+
+#include "DNA_object_types.h"
+#include "BKE_effect.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "gen_utils.h"
 
 /******* prototypes **********/
 PyObject *Wave_Init( void );
@@ -183,7 +188,6 @@ PyObject *M_Wave_New( PyObject * self, PyObject * args )
        pyeffect->effect = bleffect;
 
        return ( PyObject * ) pyeffect;
-       return 0;
 }
 
 /*****************************************************************************/
index 91daf22c0fd939b3e0967dd0390b45f047071b17..194642d36a13f759edfde58e1958b226a662e648 100644 (file)
 #define EXPP_WAVE_H
 
 #include <Python.h>
-#include <stdio.h>
-
-#include <BLI_arithb.h>
-#include <BLI_blenlib.h>
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <DNA_effect_types.h>
-
-#include"Effect.h"
-#include "gen_utils.h"
-
+#include "Effect.h"
 
 extern PyTypeObject Wave_Type;
 
@@ -66,7 +54,6 @@ PyObject *M_Wave_New( PyObject * self, PyObject * args );
 PyObject *M_Wave_Get( PyObject * self, PyObject * args );
 
 
-
 /*****************************************************************************/
 /* Python BPy_Wave methods declarations:                                    */
 /*****************************************************************************/
index 96e33245bf0e208acc0982efea7f8a744b1929bb..17784d87c1f17bce56839b258c2cae1cc846f2b2 100644 (file)
 */
 
 #include <Python.h>
-#include <stdio.h>
 
-#include "blendef.h"           /* OBACT */
 #include "BDR_editobject.h"    /* enter / leave editmode */
 #include "BKE_global.h"
-#include "BKE_library.h"
+#include "BKE_main.h"
 #include "BKE_object.h"                /* for during_script() and during_scriptlink() */
 #include "BKE_scene.h"         /* scene_find_camera() */
-#include "BIF_usiblender.h"
+#include "BPI_script.h"
 #include "BIF_mywindow.h"
 #include "BSE_headerbuttons.h"
 #include "BSE_filesel.h"
 #include "BIF_screen.h"
 #include "BIF_space.h"
 #include "BIF_drawtext.h"
-#include "BIF_mywindow.h" /* L/M/R_MOUSE bitflags */
-#include "BIF_spacetypes.h"
-#include "mydevice.h"
 #include "DNA_view3d_types.h"
-#include "DNA_screen_types.h"
 #include "DNA_space_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_text_types.h"
-#include "DNA_vec_types.h"     /* for rcti struct */
-
+#include "DNA_object_types.h"
+#include "mydevice.h"
+#include "blendef.h"           /* OBACT */
 #include "windowTheme.h"
-#include "gen_utils.h"
-#include "matrix.h"
-#include "vector.h"
+#include "Mathutils.h"
 #include "constant.h"
+#include "gen_utils.h"
 
 
 /* See Draw.c */
 extern int EXPP_disable_force_draw;
+extern void setcameratoview3d(void);
 
 /*****************************************************************************/
 /* Python API function prototypes for the Window module.               */
index 25250724e832fcd527cf11948269c512806f72c0..a39856ecd588cb3c6715b688cce031e1eb2b6afe 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef EXPP_WINDOW_H
 #define EXPP_WINDOW_H
 
+#include <Python.h>
+
 PyObject *Window_Init( void );
 PyObject *M_Window_Redraw( PyObject * self, PyObject * args );
 
index f0a4da4473d28ba4d2a9144362cf2d9f934361b8..f065f3ebf588820730c94c8a88a67e233a8e5713 100644 (file)
  * (self, name = "MyName")
  */
 
-#include <BKE_main.h>
-#include <BKE_global.h>
-#include <BKE_object.h>
-#include <BKE_library.h>
-#include <BLI_blenlib.h>
-#include <BSE_editipo.h>
-#include <BIF_space.h>
-#include <mydevice.h>
-
-#include <DNA_scene_types.h>  /* for G.scene */
-
-#include "World.h"
+#include "World.h"  /*This must come first*/
+
+#include "DNA_scene_types.h"  /* for G.scene */
+#include "BKE_global.h"
+#include "BKE_world.h"
+#include "BKE_main.h"
+#include "BKE_library.h"
+#include "BLI_blenlib.h"
+#include "BSE_editipo.h"
+#include "BIF_space.h"
+#include "mydevice.h"
 #include "Ipo.h"
-
-
-#include "constant.h"
-#include "rgbTuple.h"
 #include "gen_utils.h"
 
+
 #define IPOKEY_ZENITH   0
 #define IPOKEY_HORIZON  1
 #define IPOKEY_MIST     2
@@ -579,7 +575,7 @@ static PyObject *World_setSkytype( BPy_World * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "i", &skytype ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument" ) );
-       self->world->skytype = skytype;
+       self->world->skytype = (short)skytype;
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -616,7 +612,7 @@ static PyObject *World_setMode( BPy_World * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "i", &mode ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument" ) );
-       self->world->mode = mode;
+       self->world->mode = (short)mode;
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -665,7 +661,7 @@ static PyObject *World_setMistype( BPy_World * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "i", &mistype ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected int argument" ) );
-       self->world->mistype = mistype;
+       self->world->mistype = (short)mistype;
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -693,9 +689,9 @@ static PyObject *World_setHor( BPy_World * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "O", &listargs ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected list argument" ) );
-       self->world->horr = PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
-       self->world->horg = PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
-       self->world->horb = PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+       self->world->horr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+       self->world->horg = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+       self->world->horb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -720,9 +716,9 @@ static PyObject *World_setZen( BPy_World * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "O", &listargs ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected list argument" ) );
-       self->world->zenr = PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
-       self->world->zeng = PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
-       self->world->zenb = PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+       self->world->zenr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+       self->world->zeng = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+       self->world->zenb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -755,9 +751,9 @@ static PyObject *World_setAmb( BPy_World * self, PyObject * args )
        if( PyList_Size( listargs ) != 3 )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "wrong list size" ) );
-       self->world->ambr = PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
-       self->world->ambg = PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
-       self->world->ambb = PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+       self->world->ambr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+       self->world->ambg = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+       self->world->ambb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -792,17 +788,17 @@ static PyObject *World_setStar( BPy_World * self, PyObject * args )
        if( PyList_Size( listargs ) != 7 )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "wrong list size" ) );
-       self->world->starr = PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
-       self->world->starg = PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
-       self->world->starb = PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+       self->world->starr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+       self->world->starg = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+       self->world->starb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        self->world->starsize =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );
        self->world->starmindist =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 4 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 4 ) );
        self->world->stardist =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 5 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 5 ) );
        self->world->starcolnoise =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 6 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 6 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
@@ -838,13 +834,13 @@ static PyObject *World_setMist( BPy_World * self, PyObject * args )
        if( PyList_Size( listargs ) != 4 )
                return ( EXPP_ReturnPyObjError
                         ( PyExc_TypeError, "wrong list size" ) );
-       self->world->misi = PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
+       self->world->misi = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) );
        self->world->miststa =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
        self->world->mistdist =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
        self->world->misthi =
-               PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );
+               (float)PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );
        Py_INCREF( Py_None );
        return Py_None;
 }
index 81d38f68545327cc1c3d6d2ee102eb2c1dc8cff6..d085c3f28bb6a801450ff83726c38d2dc7a15977 100644 (file)
 #define EXPP_WORLD_H
 
 #include <Python.h>
-
-#include <DNA_world_types.h>
-//#include "bpy_types.h"
-
+#include "DNA_world_types.h"
 
 #define BPy_World_Check(v) ((v)->ob_type==&World_Type)
 
index d8144de5bb735aed41c6d8d65b24a1082c2818ec..0b83db6c6746a8e58826feb3aede48250ebfe6f6 100644 (file)
 #ifndef EXPP_bpy_types_h
 #define EXPP_bpy_types_h
 
-#include <Python.h>
-
-
-
-
-#include <DNA_curve_types.h>
-
-
 
 /*****************************************************************************/
 /* Camera Data                                                               */
index 690361eed5d617ec3e2c964cb0cbba7c255e2f90..768970881661b21cb0132b4e6c0c1ef3f630799c 100644 (file)
@@ -30,7 +30,8 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "charRGBA.h"
+#include "charRGBA.h" /*This must come first */
+#include "gen_utils.h"
 
 /* This file is heavily based on the old bpython Constant object code in
         Blender */
@@ -167,10 +168,10 @@ PyObject *charRGBA_setCol( BPy_charRGBA * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected 1-byte ints [b,b,b,b] or b,b,b,b as arguments (or nothing)" );
 
-       *( self->rgba[0] ) = EXPP_ClampInt( r, 0, 255 );
-       *( self->rgba[1] ) = EXPP_ClampInt( g, 0, 255 );
-       *( self->rgba[2] ) = EXPP_ClampInt( b, 0, 255 );
-       *( self->rgba[3] ) = EXPP_ClampInt( a, 0, 255 );
+       *( self->rgba[0] ) = (char)EXPP_ClampInt( r, 0, 255 );
+       *( self->rgba[1] ) = (char)EXPP_ClampInt( g, 0, 255 );
+       *( self->rgba[2] ) = (char)EXPP_ClampInt( b, 0, 255 );
+       *( self->rgba[3] ) = (char)EXPP_ClampInt( a, 0, 255 );
 
        return EXPP_incr_ret( Py_None );
 }
@@ -226,7 +227,7 @@ static int charRGBA_setAttr( BPy_charRGBA * self, char *name, PyObject * v )
                return EXPP_ReturnIntError( PyExc_TypeError,
                                            "expected char argument" );
 
-       value = EXPP_ClampInt( value, 0, 255 );
+       value = (char)EXPP_ClampInt( value, 0, 255 );
 
        if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
                *( self->rgba[0] ) = value;
@@ -311,7 +312,7 @@ static int charRGBAAssSubscript( BPy_charRGBA * self, PyObject * key,
        else
                return EXPP_ReturnIntError( PyExc_AttributeError, name );
 
-       *( self->rgba[i] ) = EXPP_ClampInt( PyInt_AsLong( v ), 0, 255 );
+       *( self->rgba[i] ) = (char)EXPP_ClampInt( PyInt_AsLong( v ), 0, 255 );
 
        return 0;
 }
@@ -361,7 +362,7 @@ static int charRGBAAssItem( BPy_charRGBA * self, int i, PyObject * ob )
                return EXPP_ReturnIntError( PyExc_IndexError,
                                            "color component must be a number" );
 
-       *( self->rgba[i] ) = EXPP_ClampInt( PyInt_AsLong( ob ), 0, 255 );
+       *( self->rgba[i] ) = (char)EXPP_ClampInt( PyInt_AsLong( ob ), 0, 255 );
 
        return 0;
 }
@@ -395,7 +396,7 @@ static int charRGBAAssSlice( BPy_charRGBA * self, int begin, int end,
                        return -1;
                }
 
-               *( self->rgba[count] ) = EXPP_ClampInt( value, 0, 255 );
+               *( self->rgba[count] ) = (char)EXPP_ClampInt( value, 0, 255 );
 
                Py_DECREF( ob );
        }
index dc59a244b6dbe38bb6f94bcd5d6b757540827085..d9056f05652d9763a166482d740b8d08d15a62d8 100644 (file)
@@ -34,9 +34,6 @@
 #define EXPP_charRGBA_H
 
 #include <Python.h>
-#include <stdio.h>
-
-#include "gen_utils.h"
 
 /* Objects of <type 'charRGBA'> are used inside other Blender Python
  * objects, so this header file must contain only 'public' declarations */
@@ -45,7 +42,8 @@
 /* Python BPy_charRGBA structure definition: */
 
 typedef struct {
-       PyObject_HEAD char *rgba[4];    /* array of four pointers to chars */
+       PyObject_HEAD 
+       char *rgba[4];  /* array of four pointers to chars */
 
 } BPy_charRGBA;
 
index 481ab17e7320bab679667a14b30002d7ddf13e6d..eb1667e48e0bb9dfd33c29a3a419f42fe297213e 100644 (file)
@@ -30,7 +30,9 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "constant.h"
+#include "constant.h" /*This must come first */
+
+#include "gen_utils.h"
 
 /* This file is heavily based on the old bpython Constant object code in 
    Blender */
index 450529822b0c54fc4de7062629189ccfe7be8750..1b92dfab2be06e0556730fc7ee253b9ac76b6e45 100644 (file)
@@ -34,9 +34,6 @@
 #define EXPP_constant_H
 
 #include <Python.h>
-#include <stdio.h>
-
-#include "gen_utils.h"
 
 #define BPy_Constant_Check(v) ((v)->ob_type==&constant_Type)
 
@@ -52,7 +49,8 @@ PyObject *M_constant_New( void );
 /* Python BPy_constant structure definition:                                 */
 /*****************************************************************************/
 typedef struct {
-       PyObject_HEAD PyObject * dict;
+       PyObject_HEAD 
+       PyObject * dict;
 
 } BPy_constant;
 
index d5b7b61c8a7637303ad1096cad925c56f42b5ee7..103537aa8bafafaad30278f05efe36b2ed494b3c 100644 (file)
  * ***** 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
index 1b5dca26df76adb363c2acf6a3db5355b34e6516..c7faef1c9078476758800a163ff3dcb5c015a618 100644 (file)
@@ -34,6 +34,8 @@
 #ifndef EXPP_euler_h
 #define EXPP_euler_h
 
+#include <Python.h>
+
 #define EulerObject_Check(v) ((v)->ob_type == &euler_Type)
 
 typedef struct {
index 61cf81785108bb20b54e8e5bb0ba6a27376e367e..6a0aff3a04e1f47ca5b92736a438b643b13191ce 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
+#include "gen_utils.h" /*This must come first*/
+
 #include "DNA_text_types.h"
 #include "MEM_guardedalloc.h"
 #include "BLI_blenlib.h"
 #include "BIF_space.h"
-
-#include "gen_utils.h"
-#include "constant.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
 
 /*****************************************************************************/
 /* Description: This function clamps an int to the given interval        */
@@ -281,7 +282,7 @@ int EXPP_map_getShortVal( const EXPP_map_pair * map,
 {
        while( map->sval ) {
                if( StringEqual( sval, map->sval ) ) {
-                       *ival = map->ival;
+                       *ival = (short)map->ival;
                        return 1;
                }
                ++map;
@@ -420,7 +421,7 @@ PyObject *EXPP_clearScriptLinks( ScriptLink * slink, PyObject * args )
        */
 
        if ( slink->totscript > deleted ) {
-               slink->totscript -= deleted;
+               slink->totscript = slink->totscript - (short)deleted;
 
                stmp = slink->scripts;
                slink->scripts =
@@ -527,7 +528,7 @@ PyObject *EXPP_addScriptLink(ScriptLink *slink, PyObject *args, int is_scene)
        }
 
        slink->scripts[slink->totscript] = ( ID * ) bltxt;
-       slink->flag[slink->totscript] = event;
+       slink->flag[slink->totscript] = (short)event;
 
        slink->totscript++;
 
index df85c92dae4a0a613d082089e7d4996c7f92b1ce..eaee7ae5d2bbe9c52038303bcefd7d7374f563f3 100644 (file)
 #define EXPP_gen_utils_h
 
 #include <Python.h>
-#include "compile.h"
-#include "eval.h"              /* for PyEval_GetLocals */
-#include <stdio.h>
-#include <string.h>
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BPI_script.h"
-
 #include "DNA_ID.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
 #include "DNA_scriptlink_types.h"
 #include "DNA_listBase.h"
 
index 3ab543c27505a9780ad6c675039eec7eb9f0701c..50163af41fc5e6928f395972fbee65db8cc1b6e3 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "logic.h"
+#include "logic.h" /*This must come first*/
+
+#include "MEM_guardedalloc.h"
+#include "BLI_blenlib.h"
 #include "gen_utils.h"
-#include <MEM_guardedalloc.h>
-#include <BLI_blenlib.h>
 
 //--------------- Python BPy_Property methods declarations:---------------
 static PyObject *Property_getName( BPy_Property * self );
@@ -121,7 +122,6 @@ int updatePyProperty( BPy_Property * self )
                }
                return 1;
        }
-       return 0;
 }
 
 //--------------- updatePropertyData------------------------------------
@@ -146,7 +146,6 @@ int updateProperyData( BPy_Property * self )
                }
                return 1;
        }
-       return 0;
 }
 
 //--------------- checkValidData_ptr--------------------------------
@@ -379,7 +378,7 @@ PyObject *newPropertyObject( char *name, PyObject * data, int type )
 
        BLI_strncpy( py_property->name, name, 32 );
        py_property->data = data;
-       py_property->type = type;
+       py_property->type = (short)type;
 
        return ( PyObject * ) py_property;
 }
index dfd42f19b723a9bb19c7c028b8eed3fac151d342..c2b37b16360194fdb1bb931187fa73d5c8015078 100644 (file)
@@ -33,8 +33,8 @@
 #ifndef EXPP_LOGIC_H
 #define EXPP_LOGIC_H
 
-#include "Python.h"
-#include <DNA_property_types.h>
+#include <Python.h>
+#include "DNA_property_types.h"
 
 //--------------------------Python BPy_Property structure definition.----
 typedef struct {
index 8b0add848a2929cdbfce36600c2ce169f2030f1b..9d65e995c560bafc01b8b52147d4c82d6988659d 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
+#include "Mathutils.h"
+
 #include "BKE_utildefines.h"
 #include "BLI_arithb.h"
-#include "Mathutils.h"
-#include "gen_utils.h"
 #include "BLI_blenlib.h"
+#include "gen_utils.h"
 
 //-------------------------DOC STRINGS ---------------------------
 char Matrix_Zero_doc[] = "() - set all values in the matrix to 0";
@@ -205,7 +206,7 @@ PyObject *Matrix_Invert(MatrixObject * self)
 
        //calculate the determinant
        f = Matrix_Determinant(self);
-       det = PyFloat_AS_DOUBLE(f);
+       det = (float)PyFloat_AS_DOUBLE(f);
 
        if(det != 0) {
                //calculate the classical adjoint
@@ -425,7 +426,7 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob)
                                return EXPP_ReturnIntError(PyExc_TypeError, 
                                        "matrix[attribute] = x: sequence argument not a number\n");
                        }
-                       vec[x] = PyFloat_AS_DOUBLE(f);
+                       vec[x] = (float)PyFloat_AS_DOUBLE(f);
                        EXPP_decr2(m, f);
                }
                //parsed well - now set in matrix
@@ -505,7 +506,7 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end,
                                                return EXPP_ReturnIntError(PyExc_TypeError, 
                                                        "matrix[begin:end] = []: sequence argument not a number\n");
                                        }
-                                       mat[(i * self->colSize) + y] = PyFloat_AS_DOUBLE(f);
+                                       mat[(i * self->colSize) + y] = (float)PyFloat_AS_DOUBLE(f);
                                        EXPP_decr2(f, m);
                                }
                        }else{
@@ -614,7 +615,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2)
                                return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                        "Matrix multiplication: arguments not acceptable for this operation\n");
                        }
-                       scalar = PyFloat_AS_DOUBLE(f);
+                       scalar = (float)PyFloat_AS_DOUBLE(f);
                        for(x = 0; x < mat2->rowSize; x++) {
                                for(y = 0; y < mat2->colSize; y++) {
                                        mat[((x * mat2->colSize) + y)] = scalar * mat2->matrix[x][y];
@@ -638,7 +639,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2)
                                        return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                                "Matrix multiplication: arguments not acceptable for this operation\n");
                                }
-                               scalar = PyFloat_AS_DOUBLE(f);
+                               scalar = (float)PyFloat_AS_DOUBLE(f);
                                for(x = 0; x < mat1->rowSize; x++) {
                                        for(y = 0; y < mat1->colSize; y++) {
                                                mat[((x * mat1->colSize) + y)] = scalar * mat1->matrix[x][y];
@@ -658,7 +659,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2)
                                        for(z = 0; z < mat1->colSize; z++) {
                                                dot += (mat1->matrix[x][z] * mat2->matrix[z][y]);
                                        }
-                                       mat[((x * mat1->rowSize) + y)] = dot;
+                                       mat[((x * mat1->rowSize) + y)] = (float)dot;
                                        dot = 0.0f;
                                }
                        }
index 9c114867786b11cca30b2dd3b93939f16600684f..af329d7f85c787452129c54e5efe75e4ac831b60 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef EXPP_matrix_h
 #define EXPP_matrix_h
 
+#include <Python.h>
+
 #define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type)
 
 typedef float **ptRow;
index fc8eb4449255b838d49832c8aac15ddbe179fe8d..fd03469f772fd6bcac90886e82587de3d6117f68 100644 (file)
@@ -43,38 +43,7 @@ The #includes commented out below currently do not exist.
 Their *_Init() method declarations are hacked in down below.
 ************************************************************/
 
-
-#include "Armature.h"
-#include "BezTriple.h"
-#include "BGL.h" 
-#include "Blender.h"
-#include "Camera.h"
-#include "Curve.h"
-#include "CurNurb.h"
-#include "Draw.h"
-#include "Effect.h"
-#include "Ipo.h"
-#include "Ipocurve.h"
-#include "Lamp.h"
-#include "Lattice.h"
-/* #include "Library.h" */
-#include "Material.h"
-#include "Mathutils.h"
-#include "Metaball.h"
-#include "NLA.h"
-#include "NMesh.h"
-/* #include "Noise.h" */
-#include "Object.h"
-#include "Registry.h"
-#include "Scene.h"
-#include "Sound.h"
-#include "Sys.h"
-#include "Text.h"
-#include "Text3d.h"
-#include "Texture.h"
-#include "Types.h"
-#include "Window.h"
-#include "World.h"
+#include <Python.h>
 
 /*****************************************************************************/
 /* Global variables                                                          */
index 78944b9f7d5819e00733997eef7a93190dbbecb4..d16de9d5785c2b96500b9b8f52ce340b6358bb99 100644 (file)
  * ***** 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 Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)";
@@ -105,7 +107,7 @@ PyObject *Quaternion_Inverse(QuaternionObject * self)
        }
        mag = sqrt(mag);
        for(x = 0; x < 4; x++) {
-               self->quat[x] /= (mag * mag);
+               self->quat[x] /= (float)(mag * mag);
        }
 
        return (PyObject*)self;
@@ -186,7 +188,7 @@ static PyObject *Quaternion_getattr(QuaternionObject * self, char *name)
                mag = 2 * (acos(mag));
                mag = sin(mag / 2);
                for(x = 0; x < 3; x++) {
-                       vec[x] = (self->quat[x + 1] / mag);
+                       vec[x] = (float)(self->quat[x + 1] / mag);
                }
                Normalise(vec);
                return (PyObject *) newVectorObject(vec, 3, Py_NEW);
@@ -207,13 +209,13 @@ static int Quaternion_setattr(QuaternionObject * self, char *name, PyObject * q)
        }
 
        if(STREQ(name,"w")){
-               self->quat[0] = PyFloat_AS_DOUBLE(f);
+               self->quat[0] = (float)PyFloat_AS_DOUBLE(f);
        }else if(STREQ(name, "x")){
-               self->quat[1] = PyFloat_AS_DOUBLE(f);
+               self->quat[1] = (float)PyFloat_AS_DOUBLE(f);
        }else if(STREQ(name, "y")){
-               self->quat[2] = PyFloat_AS_DOUBLE(f);
+               self->quat[2] = (float)PyFloat_AS_DOUBLE(f);
        }else if(STREQ(name, "z")){
-               self->quat[3] = PyFloat_AS_DOUBLE(f);
+               self->quat[3] = (float)PyFloat_AS_DOUBLE(f);
        }else{
                Py_DECREF(f);
                return EXPP_ReturnIntError(PyExc_AttributeError,
@@ -279,7 +281,7 @@ static int Quaternion_ass_item(QuaternionObject * self, int i, PyObject * ob)
                return EXPP_ReturnIntError(PyExc_IndexError,
                        "quaternion[attribute] = x: array assignment index out of range\n");
        }
-       self->quat[i] = PyFloat_AS_DOUBLE(f);
+       self->quat[i] = (float)PyFloat_AS_DOUBLE(f);
        Py_DECREF(f);
        return 0;
 }
@@ -334,7 +336,7 @@ static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end,
                        return EXPP_ReturnIntError(PyExc_TypeError, 
                                "quaternion[begin:end] = []: sequence argument not a number\n");
                }
-               quat[i] = PyFloat_AS_DOUBLE(f);
+               quat[i] = (float)PyFloat_AS_DOUBLE(f);
                EXPP_decr2(f,q);
        }
        //parsed well - now set in vector
@@ -414,7 +416,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2)
                                return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                        "Quaternion multiplication: arguments not acceptable for this operation\n");
                        }
-                       scalar = PyFloat_AS_DOUBLE(f);
+                       scalar = (float)PyFloat_AS_DOUBLE(f);
                        for(x = 0; x < 4; x++) {
                                quat[x] = quat2->quat[x] * scalar;
                        }
@@ -431,7 +433,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2)
                                        return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                                "Quaternion multiplication: arguments not acceptable for this operation\n");
                                }
-                               scalar = PyFloat_AS_DOUBLE(f);
+                               scalar = (float)PyFloat_AS_DOUBLE(f);
                                for(x = 0; x < 4; x++) {
                                        quat[x] = quat1->quat[x] * scalar;
                                }
index 8be94ef3f42f8a940ddef1b9a0d7733520660d3a..b6228c9119e9008786d83b2511fdea21e4e91dfd 100644 (file)
@@ -34,6 +34,8 @@
 #ifndef EXPP_quat_h
 #define EXPP_quat_h
 
+#include <Python.h>
+
 #define QuaternionObject_Check(v) ((v)->ob_type == &quaternion_Type)
 
 typedef struct {
index c61120bfd75e50642d4de8706e7a79b7b9a54643..ad9eb4856670a4bfabd95f646d85ad56d8c811b2 100644 (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;
 }
index 42a5318d001769a03eadf3e813db67650d8dc347..4e113d7dd4940342d416ea3e21ca50787e1106e4 100644 (file)
@@ -34,9 +34,6 @@
 #define EXPP_rgbTuple_H
 
 #include <Python.h>
-#include <stdio.h>
-
-#include "gen_utils.h"
 
 /* Objects of <type 'rgbTuple'> are used inside other Blender Python
  * objects, so this header file must contain only 'public' declarations */
index 40be3efa3e33209964cbd8b7f4fb4557aeae3e76..48765263eea462ca568e6d252f02acf32d030f9c 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include "sceneRadio.h"                /* includes Python.h */
-#include "radio.h"
-#include <BKE_object.h>                /* disable_where_script() */
+#include "sceneRadio.h"                /*This must come first*/
 
+#include "BKE_global.h"
+#include "BKE_object.h"                /* disable_where_script() */
 #include "gen_utils.h"
 #include "constant.h"
+#include "radio.h"
+
 
 /* bitflags */
 #define EXPP_RADIO_flag_SHOWLIM 1
 #define EXPP_RADIO_maxnode_MAX 250000
 /* floats */
 #define EXPP_RADIO_convergence_MIN 0.0
-#define EXPP_RADIO_convergence_MAX 0.1
-#define EXPP_RADIO_radfac_MIN 0.001
+#define EXPP_RADIO_convergence_MAX 0.1f
+#define EXPP_RADIO_radfac_MIN 0.001f
 #define EXPP_RADIO_radfac_MAX 250.0
-#define EXPP_RADIO_gamma_MIN 0.2
+#define EXPP_RADIO_gamma_MIN 0.2f
 #define EXPP_RADIO_gamma_MAX 10.0
 /* drawtypes */
 #define EXPP_RADIO_drawtype_WIRE 0
index 7796e1f0c44e90b79a207a086c74b997577366de..3909194ca470c8b36a26c59e0f728c2cf34758e4 100644 (file)
 #define EXPP_SCENERADIO_H
 
 #include <Python.h>
-#include <DNA_radio_types.h>
-#include <DNA_scene_types.h>
+#include "DNA_radio_types.h"
+#include "DNA_scene_types.h"
 
 /* BPy_Radio declaration */
 typedef struct {
-       PyObject_HEAD struct Radio *radio;
+       PyObject_HEAD 
+       struct Radio *radio;
        struct Scene *scene;
 } BPy_Radio;
 
index eed1952c4bc40f371203d336d469d05667957566..84fa4c06720c1fbe8de18a6757a61666038265fa 100644 (file)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
-
-#include <BIF_renderwin.h>
-#include <BKE_utildefines.h>
-#include <BKE_global.h>
-#include <DNA_image_types.h>
-#include <BIF_drawscene.h>
-#include <BLI_blenlib.h>
-#include <BKE_image.h>
-#include <BIF_space.h>
-#include <DNA_scene_types.h>
-#include <DNA_space_types.h>
-#include <mydevice.h>
-#include <butspace.h>
-#include <BKE_bad_level_calls.h>
-#include <render.h> /* RE_animrender() */
-#include "sceneRender.h"
+struct View3D; /* keep me up here */
+
+#include "sceneRender.h" /*This must come first*/
+
+#include "BIF_renderwin.h"
+#include "DNA_image_types.h"
+#include "BIF_drawscene.h"
+#include "BLI_blenlib.h"
+#include "BKE_image.h"
+#include "BKE_global.h"
+#include "mydevice.h"
+#include "butspace.h"
+#include "render.h" /* RE_animrender() */
 #include "blendef.h"
-#include "Scene.h"
 #include "gen_utils.h"
 
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 //local defines
 #define PY_NONE                0
 #define PY_LOW         1
@@ -886,7 +877,7 @@ PyObject *RenderData_Render( BPy_RenderData * self )
 
                RE_animrender(NULL);
 
-               G.scene->r.efra = end_frame;
+               G.scene->r.efra = (short)end_frame;
        }
 
        return EXPP_incr_ret( Py_None );
@@ -1167,7 +1158,7 @@ PyObject *RenderData_SetOversamplingLevel( BPy_RenderData * self,
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                "expected 5,8,11, or 16" ) );
 
-       self->renderContext->osa = level;
+       self->renderContext->osa = (short)level;
        EXPP_allqueue( REDRAWBUTSSCENE, 0 );
 
        return EXPP_incr_ret( Py_None );
@@ -1281,7 +1272,7 @@ PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self, PyObject * args )
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                "expected 25, 50, 75, or 100" ) );
 
-       self->renderContext->size = size;
+       self->renderContext->size = (short)size;
        EXPP_allqueue( REDRAWBUTSSCENE, 0 );
 
        return EXPP_incr_ret( Py_None );
@@ -1330,7 +1321,7 @@ PyObject *RenderData_EnableBorderRender( BPy_RenderData * self,
 //------------------------------------RenderData.SetBorder() ------------
 PyObject *RenderData_SetBorder( BPy_RenderData * self, PyObject * args )
 {
-       float xmin, ymin, xmax, ymax;
+       float xmin = 0.0f, ymin = 0.0f, xmax = 0.0f, ymax = 0.0f;
        int status = 0;
        PyObject *ob_args;
 
@@ -1562,59 +1553,59 @@ PyObject *RenderData_SizePreset( BPy_RenderData * self, PyObject * args )
        if( type == B_PR_PAL ) {
                M_Render_DoSizePreset( self, 720, 576, 54, 51, 100,
                                       self->renderContext->xparts,
-                                      self->renderContext->yparts, 25, 0.1,
-                                      0.9, 0.1, 0.9 );
+                                      self->renderContext->yparts, 25, 0.1f,
+                                      0.9f, 0.1f, 0.9f );
                self->renderContext->mode &= ~R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else if( type == B_PR_NTSC ) {
                M_Render_DoSizePreset( self, 720, 480, 10, 11, 100, 1, 1,
-                                      30, 0.1, 0.9, 0.1, 0.9 );
+                                      30, 0.1f, 0.9f, 0.1f, 0.9f );
                self->renderContext->mode &= ~R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else if( type == B_PR_PRESET ) {
                M_Render_DoSizePreset( self, 720, 576, 54, 51, 100, 1, 1,
-                                      self->renderContext->frs_sec, 0.1, 0.9,
-                                      0.1, 0.9 );
+                                      self->renderContext->frs_sec, 0.1f, 0.9f,
+                                      0.1f, 0.9f );
                self->renderContext->mode = R_OSA + R_SHADOW + R_FIELDS;
                self->renderContext->imtype = R_TARGA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else if( type == B_PR_PRV ) {
                M_Render_DoSizePreset( self, 640, 512, 1, 1, 50, 1, 1,
-                                      self->renderContext->frs_sec, 0.1, 0.9,
-                                      0.1, 0.9 );
+                                      self->renderContext->frs_sec, 0.1f, 0.9f,
+                                      0.1f, 0.9f );
                self->renderContext->mode &= ~R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else if( type == B_PR_PC ) {
                M_Render_DoSizePreset( self, 640, 480, 100, 100, 100, 1, 1,
-                                      self->renderContext->frs_sec, 0.0, 1.0,
-                                      0.0, 1.0 );
+                                      self->renderContext->frs_sec, 0.0f, 1.0f,
+                                      0.0f, 1.0f );
                self->renderContext->mode &= ~R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.0, 1.0, 0.0,
-                              1.0 );
+               BLI_init_rctf( &self->renderContext->safety, 0.0f, 1.0f, 0.0f,
+                              1.0f );
        } else if( type == B_PR_PAL169 ) {
                M_Render_DoSizePreset( self, 720, 576, 64, 45, 100, 1, 1,
-                                      25, 0.1, 0.9, 0.1, 0.9 );
+                                      25, 0.1f, 0.9f, 0.1f, 0.9f );
                self->renderContext->mode &= ~R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else if( type == B_PR_PANO ) {
                M_Render_DoSizePreset( self, 36, 176, 115, 100, 100, 16, 1,
-                                      self->renderContext->frs_sec, 0.1, 0.9,
-                                      0.1, 0.9 );
+                                      self->renderContext->frs_sec, 0.1f, 0.9f,
+                                      0.1f, 0.9f );
                self->renderContext->mode |= R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else if( type == B_PR_FULL ) {
                M_Render_DoSizePreset( self, 1280, 1024, 1, 1, 100, 1, 1,
-                                      self->renderContext->frs_sec, 0.1, 0.9,
-                                      0.1, 0.9 );
+                                      self->renderContext->frs_sec, 0.1f, 0.9f,
+                                      0.1f, 0.9f );
                self->renderContext->mode &= ~R_PANORAMA;
-               BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
-                              0.9 );
+               BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
+                              0.9f );
        } else
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                "unknown constant - see modules dict for help" ) );
@@ -1644,7 +1635,7 @@ PyObject *RenderData_SetYafrayGIQuality( BPy_RenderData * self,
        if( type == PY_NONE || type == PY_LOW ||
            type == PY_MEDIUM || type == PY_HIGH ||
            type == PY_HIGHER || type == PY_BEST ) {
-               self->renderContext->GIquality = type;
+               self->renderContext->GIquality = (short)type;
        } else
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                "unknown constant - see modules dict for help" ) );
@@ -1664,7 +1655,7 @@ PyObject *RenderData_SetYafrayGIMethod( BPy_RenderData * self,
                                                "expected constant" ) );
 
        if( type == PY_NONE || type == PY_SKYDOME || type == PY_FULL ) {
-               self->renderContext->GImethod = type;
+               self->renderContext->GImethod = (short)type;
        } else
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                "unknown constant - see modules dict for help" ) );
index c36415227b9f3e8750ef265caa3d7ae67a25030d..32527ef6e890652838ea8c02a49c7506001f1222 100644 (file)
 #define EXPP_SCENERENDER_H
 
 #include <Python.h>
-#include <DNA_scene_types.h>
+#include "DNA_scene_types.h"
 
 //------------------------------------Struct definitions-------
 typedef struct {
-       PyObject_HEAD struct RenderData *renderContext;
+       PyObject_HEAD 
+       struct RenderData *renderContext;
        Scene *scene;
 } BPy_RenderData;
 //------------------------------------Visible prototypes-------
index ff888df12f62356b4743cd44fdb9f9233eff34c2..6e5235f2a7e3e5b5e2ad85e2f39c1d0826d96dbd 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-#include "BKE_utildefines.h"
 #include "Mathutils.h"
-#include "gen_utils.h"
+
 #include "BLI_blenlib.h"
+#include "BKE_utildefines.h"
+#include "gen_utils.h"
+
 
 //-------------------------DOC STRINGS ---------------------------
 char Vector_Zero_doc[] = "() - set all values in the vector to 0";
@@ -210,12 +212,12 @@ static int Vector_setattr(VectorObject * self, char *name, PyObject * v)
        }
 
        if(STREQ(name,"x")){
-               self->vec[0] = PyFloat_AS_DOUBLE(f);
+               self->vec[0] = (float)PyFloat_AS_DOUBLE(f);
        }else if(STREQ(name, "y")){
-               self->vec[1] = PyFloat_AS_DOUBLE(f);
+               self->vec[1] = (float)PyFloat_AS_DOUBLE(f);
        }else if(STREQ(name, "z")){
                if(self->size > 2){
-                       self->vec[2] = PyFloat_AS_DOUBLE(f);
+                       self->vec[2] = (float)PyFloat_AS_DOUBLE(f);
                }else{
                        Py_DECREF(f);
                        return EXPP_ReturnIntError(PyExc_AttributeError,
@@ -223,7 +225,7 @@ static int Vector_setattr(VectorObject * self, char *name, PyObject * v)
                }
        }else if(STREQ(name, "w")){
                if(self->size > 3){
-                       self->vec[3] = PyFloat_AS_DOUBLE(f);
+                       self->vec[3] = (float)PyFloat_AS_DOUBLE(f);
                }else{
                        Py_DECREF(f);
                        return EXPP_ReturnIntError(PyExc_AttributeError,
@@ -294,7 +296,7 @@ static int Vector_ass_item(VectorObject * self, int i, PyObject * ob)
                return EXPP_ReturnIntError(PyExc_IndexError,
                        "vector[attribute] = x: array assignment index out of range\n");
        }
-       self->vec[i] = PyFloat_AS_DOUBLE(f);
+       self->vec[i] = (float)PyFloat_AS_DOUBLE(f);
        Py_DECREF(f);
        return 0;
 }
@@ -349,7 +351,7 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end,
                        return EXPP_ReturnIntError(PyExc_TypeError, 
                                "vector[begin:end] = []: sequence argument not a number\n");
                }
-               vec[i] = PyFloat_AS_DOUBLE(f);
+               vec[i] = (float)PyFloat_AS_DOUBLE(f);
                EXPP_decr2(f,v);
        }
        //parsed well - now set in vector
@@ -444,7 +446,7 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2)
                                return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                        "Vector multiplication: arguments not acceptable for this operation\n");
                        }
-                       scalar = PyFloat_AS_DOUBLE(f);
+                       scalar = (float)PyFloat_AS_DOUBLE(f);
                        size = vec2->size;
                        for(x = 0; x < size; x++) {
                                vec[x] = vec2->vec[x] * scalar;
@@ -467,7 +469,7 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2)
                                        return EXPP_ReturnPyObjError(PyExc_TypeError, 
                                                "Vector multiplication: arguments not acceptable for this operation\n");
                                }
-                               scalar = PyFloat_AS_DOUBLE(f);
+                               scalar = (float)PyFloat_AS_DOUBLE(f);
                                size = vec1->size;
                                for(x = 0; x < size; x++) {
                                        vec[x] = vec1->vec[x] * scalar;
index 048fa1df8bc4438f9678046d52621abe27686201..e9aa00734caf44741b215b33389a4f1c54d8224d 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef EXPP_vector_h
 #define EXPP_vector_h
 
+#include <Python.h>
+
 #define VectorObject_Check(v) ((v)->ob_type == &vector_Type)
 
 typedef struct {
index 7ee6cd80a1cb53fcd32d04f6d17207533a6a4ce9..32e59ddaee6a32dafe1fcee31bb23f30a6336e49 100644 (file)
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */
 
-#include <MEM_guardedalloc.h>
-#include <BLI_blenlib.h>
-#include <DNA_screen_types.h>
-#include "windowTheme.h"
+#include "windowTheme.h" /*This must come first*/
+
+#include "BLI_blenlib.h"
+#include "MEM_guardedalloc.h"
 #include "charRGBA.h"
 #include "gen_utils.h"
 
@@ -241,7 +241,7 @@ static int ThemeSpace_setAttr( BPy_ThemeSpace * self, char *name,
                                                    "expected integer value" );
 
                val = ( int ) PyInt_AsLong( value );
-               tsp->vertex_size = EXPP_ClampInt( val,
+               tsp->vertex_size = (char)EXPP_ClampInt( val,
                                                  EXPP_THEME_VTX_SIZE_MIN,
                                                  EXPP_THEME_VTX_SIZE_MAX );
                ret = 0;
@@ -254,7 +254,7 @@ static int ThemeSpace_setAttr( BPy_ThemeSpace * self, char *name,
                                                    "expected integer value" );
 
                val = ( int ) PyInt_AsLong( value );
-               tsp->vertex_size = EXPP_ClampInt( val,
+               tsp->vertex_size = (char)EXPP_ClampInt( val,
                                                  EXPP_THEME_FDOT_SIZE_MIN,
                                                  EXPP_THEME_FDOT_SIZE_MAX );
                ret = 0;
@@ -415,7 +415,7 @@ static int ThemeUI_setAttr( BPy_ThemeUI * self, char *name, PyObject * value )
                                                    "expected integer value" );
 
                val = ( int ) PyInt_AsLong( value );
-               tui->but_drawtype = EXPP_ClampInt( val,
+               tui->but_drawtype = (char)EXPP_ClampInt( val,
                                                   EXPP_THEME_DRAWTYPE_MIN,
                                                   EXPP_THEME_DRAWTYPE_MAX );
                ret = 0;
index 83f338da95b55ca4f18acbb1491607a72ae73dac..3d3fa9a37f03d8e33b288faa5c3341b28376009a 100644 (file)
@@ -34,8 +34,8 @@
 #define EXPP_WINDOWTHEME_H
 
 #include <Python.h>
-#include <DNA_listBase.h>
-#include <DNA_userdef_types.h>
+#include "DNA_screen_types.h"
+#include "DNA_userdef_types.h"
 
 typedef struct {
        PyObject_HEAD struct bTheme *theme;