diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2006-04-24 19:09:07 +0400 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2006-04-24 19:09:07 +0400 |
commit | 87949e5c670e8b761ab6b86c0dff2fa5feb4295e (patch) | |
tree | 795ba502cfdfec00853e9b6cab146ca0ccb9332b /source/blender | |
parent | 4bfb0e30ec1ac6b0188b1abde14af28c9198fff4 (diff) |
warnings cleanup for the python project on windows
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 2 | ||||
-rwxr-xr-x | source/blender/python/api2_2x/Group.c | 4 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Ipo.c | 20 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Mesh.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 8 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Text3d.c | 3 | ||||
-rw-r--r-- | source/blender/python/api2_2x/sceneRender.c | 10 |
7 files changed, 26 insertions, 23 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index 0b3672ebb29..1504cff1dcf 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -570,7 +570,7 @@ static int Armature_setLayers(BPy_Armature *self, PyObject *value, void *closure } /* update any bases pointing to our object */ - self->armature->layer = layers; + self->armature->layer = (short)layers; return 0; } diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c index 83e276cc872..075730432a7 100755 --- a/source/blender/python/api2_2x/Group.c +++ b/source/blender/python/api2_2x/Group.c @@ -125,12 +125,14 @@ static int M_Group_setObjects( BPy_Group * self, PyObject * args ) "expected a list of objects, This iterator cannot be used." ); } free_group(group); /* unlink all objects from this group, keep the group */ - while ((item = PyIter_Next(iterator))) { + item = PyIter_Next(iterator); + while (item) { if ( PyObject_TypeCheck(item, &Object_Type) ) { blen_ob= ((BPy_Object *)item)->object; add_to_group_wraper(group, blen_ob); } Py_DECREF(item); + item = PyIter_Next(iterator); } Py_DECREF(iterator); diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c index 1de2ad0806a..380d9bc2923 100644 --- a/source/blender/python/api2_2x/Ipo.c +++ b/source/blender/python/api2_2x/Ipo.c @@ -533,7 +533,7 @@ static short lookup_curve_name( char *str, int blocktype, int channel ) else { int param = (short)*adrcodes & ~MA_MAP1; param |= texchannel_to_adrcode( channel ); - return param; + return (short)param; } } ++adrcodes; @@ -630,13 +630,13 @@ static short lookup_curve_adrcode( int code, int blocktype, int channel ) /* if not a texture channel, just return the adrcode */ if( channel == -1 || *adrcodes < MA_MAP1 ) - return *adrcodes; + return (short)*adrcodes; /* otherwise adjust adrcode to include current channel */ else { int param = *adrcodes & ~MA_MAP1; param |= texchannel_to_adrcode( channel ); - return param; + return (short)param; } } ++adrcodes; @@ -1057,7 +1057,7 @@ static PyObject *Ipo_getCurveNames( BPy_Ipo * self ) PyObject *dict; int *vals = NULL; char name[32]; - PyObject *attr; + PyObject *attr = Py_None; /* determine what type of Ipo we are */ @@ -1163,7 +1163,7 @@ static PyObject *Ipo_getCurveNames( BPy_Ipo * self ) char *ptr = name+3; strcpy( name+3, lookup_name( *vals ) ); while( *ptr ) { - *ptr = toupper( *ptr ); + *ptr = (char)toupper( *ptr ); ++ptr; } PyConstant_Insert( (BPy_constant *)attr, name, @@ -1175,8 +1175,8 @@ static PyObject *Ipo_getCurveNames( BPy_Ipo * self ) void generate_curveconsts( PyObject* module ) { - namefunc lookup_name; - int size; + namefunc lookup_name = NULL; + int size = 0; int *vals = NULL; char name[32]; @@ -1253,7 +1253,7 @@ void generate_curveconsts( PyObject* module ) char *ptr = name+3; strcpy( name+3, lookup_name( *vals ) ); while( *ptr ) { - *ptr = toupper( *ptr ); + *ptr = (char)toupper( *ptr ); ++ptr; } PyModule_AddIntConstant( module, name, *vals ); @@ -1498,8 +1498,8 @@ static int Ipo_setIpoCurveByName( BPy_Ipo * self, PyObject * key, if( !flt || !val ) goto AttrError; - time = PyFloat_AS_DOUBLE( flt ); - curval = PyFloat_AS_DOUBLE( val ); + time = (float)PyFloat_AS_DOUBLE( flt ); + curval = (float)PyFloat_AS_DOUBLE( val ); Py_DECREF( flt ); Py_DECREF( val ); diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index 356c3825582..7483435af6d 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -6828,7 +6828,7 @@ static PyObject *M_Mesh_Modes( PyObject * self, PyObject * args ) "value out of range" ); if( modes > 0 ) - G.scene->selectmode = modes; + G.scene->selectmode = (short)modes; return PyInt_FromLong( G.scene->selectmode ); } diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 5fe26d91f14..db012729da6 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -2366,7 +2366,7 @@ static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args ) printf("%s\n", ob->action->id.name); /* */ - extract_pose_from_action(ob->pose, sourceact->action, actframe); + extract_pose_from_action(ob->pose, sourceact->action, (float)actframe); oldframe = G.scene->r.cfra; G.scene->r.cfra = curframe; @@ -2458,7 +2458,7 @@ static PyObject *Object_insertCurrentPoseKey( BPy_Object * self, PyObject * args EXPP_allqueue(REDRAWNLA, 0); /* restore */ - extract_pose_from_action(ob->pose, ob->action, G.scene->r.cfra); + extract_pose_from_action(ob->pose, ob->action, (float)G.scene->r.cfra); where_is_pose(ob); allqueue(REDRAWACTION, 1); @@ -2519,7 +2519,7 @@ static PyObject *Object_insertMatrixKey( BPy_Object * self, PyObject * args ) G.scene->r.cfra = oldframe; /* restore, but now with the new action in place */ - extract_pose_from_action(ob->pose, ob->action, G.scene->r.cfra); + extract_pose_from_action(ob->pose, ob->action, (float)G.scene->r.cfra); where_is_pose(ob); allqueue(REDRAWACTION, 1); @@ -2557,7 +2557,7 @@ static PyObject *Object_setConstraintInfluenceForBone( BPy_Object * self, PyObje return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "expects: bonename, constraintname, influenceval" ) ); icu = verify_ipocurve((ID *)self->object, ID_CO, boneName, constName, CO_ENFORCE); - insert_vert_ipo(icu, CFRA, influence); + insert_vert_ipo(icu, (float)CFRA, influence); Py_INCREF( Py_None ); return ( Py_None ); diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c index 9991c09ccff..6ab29f8676d 100644 --- a/source/blender/python/api2_2x/Text3d.c +++ b/source/blender/python/api2_2x/Text3d.c @@ -972,7 +972,8 @@ 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 )) ) + vf = exist_vfont( fontfile ); + if(vf) return Font_CreatePyObject( vf ); return EXPP_incr_ret( Py_None ); } diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index a121bd13ad3..57cf4c22ae3 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -917,10 +917,10 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) BLI_strncpy( filepath, self->renderContext->pic, sizeof(filepath) ); strcat(filepath, name_str); - if(0) {//!R.rectot) { - return EXPP_ReturnPyObjError (PyExc_RuntimeError, - "No image rendered"); - } else { + //if(0) {//!R.rectot) { + // return EXPP_ReturnPyObjError (PyExc_RuntimeError, + // "No image rendered"); + //} else { if(G.ima[0]==0) { strcpy(dir, G.sce); BLI_splitdirstring(dir, str); @@ -942,7 +942,7 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) // schrijfplaatje(strn); strcpy(G.ima, filepath); waitcursor(0); - } + //} return EXPP_incr_ret(Py_None); } |