- warning fixes

* various warnings the python api is putting out
This commit is contained in:
2005-11-07 19:34:44 +00:00
parent f7c955b18e
commit cce655b5e7
5 changed files with 9 additions and 10 deletions

View File

@@ -1734,7 +1734,6 @@ static PyObject *reimportText( PyObject *module )
static PyObject *blender_reload( PyObject * self, PyObject * args )
{
PyObject *exception, *err, *tb;
char *name;
PyObject *module = NULL;
PyObject *newmodule = NULL;

View File

@@ -983,7 +983,7 @@ static PyObject *Effect_getTotpart( BPy_Effect * self )
static int Effect_setTotpart( BPy_Effect * self, PyObject * args )
{
return EXPP_setIValueClamped( args, &self->effect->totpart,
EXPP_EFFECT_TOTPART_MIN, EXPP_EFFECT_TOTPART_MAX, 'i' );
(int)EXPP_EFFECT_TOTPART_MIN, (int)EXPP_EFFECT_TOTPART_MAX, 'i' );
}
static PyObject *Effect_getTotkey( BPy_Effect * self )
@@ -1074,7 +1074,7 @@ static int Effect_setMult( BPy_Effect * self, PyObject * args )
return EXPP_ReturnIntError( PyExc_AttributeError,
"expected a tuple of four float arguments" );
for( i = 0; i < 4; ++i )
self->effect->mult[i] = EXPP_ClampInt( val[i],
self->effect->mult[i] = EXPP_ClampFloat( val[i],
EXPP_EFFECT_MULT_MIN, EXPP_EFFECT_MULT_MAX );
return 0;
}
@@ -1135,7 +1135,7 @@ static int Effect_setChild( BPy_Effect * self, PyObject * args )
return EXPP_ReturnIntError( PyExc_AttributeError,
"expected a tuple of four int argument" );
for( i = 0; i < 4; ++i )
self->effect->child[i] = EXPP_ClampInt( val[i],
self->effect->child[i] = (short)EXPP_ClampInt( val[i],
EXPP_EFFECT_CHILD_MIN, EXPP_EFFECT_CHILD_MAX );
return 0;
}
@@ -1165,7 +1165,7 @@ static int Effect_setMat( BPy_Effect * self, PyObject * args )
return EXPP_ReturnIntError( PyExc_AttributeError,
"expected a tuple of four int argument" );
for( i = 0; i < 4; ++i )
self->effect->mat[i] = EXPP_ClampInt( val[i],
self->effect->mat[i] = (short)EXPP_ClampInt( val[i],
EXPP_EFFECT_MAT_MIN, EXPP_EFFECT_MAT_MAX );
return 0;
}

View File

@@ -917,7 +917,7 @@ static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * args )
icu->blocktype= ipo->blocktype;
icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
icu->blocktype= ipo->blocktype;
icu->adrcode= param;
icu->adrcode= (short)param;
BLI_addtail( &(ipo->curve), icu);
allspace( REMAKEIPO, 0 );

View File

@@ -765,7 +765,7 @@ static int IpoCurve_setDriverChannel( C_IpoCurve * self, PyObject * args ){
"This IpoCurve does not have an active driver" );
code = (short)PyInt_AS_LONG ( args );
ipo->driver->adrcode = code;
ipo->driver->adrcode = (short)code;
return 0;

View File

@@ -4685,9 +4685,9 @@ static PyObject *Mesh_transform( BPy_Mesh *self, PyObject *args )
mv = mesh->mvert;
for( i = 0; i < mesh->totvert; i++, mv++ ) {
float vec[3];
vec[0] = (float)mv->no[0] / 32767.0;
vec[1] = (float)mv->no[1] / 32767.0;
vec[2] = (float)mv->no[2] / 32767.0;
vec[0] = (float)(mv->no[0] / 32767.0);
vec[1] = (float)(mv->no[1] / 32767.0);
vec[2] = (float)(mv->no[2] / 32767.0);
Mat4MulVecfl( (float(*)[4])*invmat, vec );
Normalise( vec );
mv->no[0] = (short)(vec[0] * 32767.0);