Project file update for elbeem

Warning clean up of python project
This commit is contained in:
2005-09-26 14:46:14 +00:00
parent 577456f86a
commit b6ecdb8c35
11 changed files with 67 additions and 41 deletions

View File

@@ -295,9 +295,9 @@ static PyObject *KeyBlock_getData( PyObject * self )
mv->co[0]=vert->co[0];
mv->co[1]=vert->co[1];
mv->co[2]=vert->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);
mv->uvco[0] = mv->uvco[1] = mv->uvco[2] = 0.0;
mv->index = i;

View File

@@ -1079,7 +1079,7 @@ static int Lamp_setMode( BPy_Lamp * self, PyObject * value )
sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
}
param = PyInt_AS_LONG ( value );
param = (short)PyInt_AS_LONG ( value );
if ( ( param & bitmask ) != param )
return EXPP_ReturnIntError( PyExc_ValueError,
@@ -1222,7 +1222,7 @@ static int Lamp_setComponent( BPy_Lamp * self, PyObject * value,
return EXPP_ReturnIntError( PyExc_TypeError,
"expected float argument in [0.0,1.0]" );
color = PyFloat_AsDouble( value );
color = (float)PyFloat_AsDouble( value );
color = EXPP_ClampFloat( color, EXPP_LAMP_COL_MIN, EXPP_LAMP_COL_MAX );
switch ( (int)closure ) {
@@ -1636,7 +1636,7 @@ static PyObject *Lamp_oldsetMode( BPy_Lamp * self, PyObject * args )
/* check each argument for type, find its value */
for ( i = PyTuple_Size( args ); i-- ; ) {
for ( i = (short)PyTuple_Size( args ); i-- ; ) {
name = PyString_AsString ( PySequence_Fast_GET_ITEM( args, i ) );
if( !name )
return EXPP_ReturnPyObjError ( PyExc_AttributeError,

View File

@@ -1987,7 +1987,7 @@ static int Material_setColorComponent( BPy_Material * self, PyObject * value,
return EXPP_ReturnIntError( PyExc_TypeError,
"expected float argument in [0.0,1.0]" );
param = PyFloat_AsDouble( value );
param = (float)PyFloat_AsDouble( value );
param = EXPP_ClampFloat( param, EXPP_MAT_COL_MIN, EXPP_MAT_COL_MAX );
switch ( (int)closure ) {

View File

@@ -1941,7 +1941,7 @@ static BPy_NMEdge *nmedge_from_index( BPy_NMesh * mesh, int v0idx, int v1idx)
{
BPy_NMVert *v1=(BPy_NMVert *)PyList_GetItem( mesh->verts, v0idx);
BPy_NMVert *v2=(BPy_NMVert *)PyList_GetItem( mesh->verts, v1idx);
return new_NMEdge(v1, v2, 0.0, 0);
return new_NMEdge(v1, v2, (char)0.0, 0);
}
static BPy_NMEdge *nmedge_from_data( BPy_NMesh * mesh, MEdge *edge )

View File

@@ -1378,10 +1378,10 @@ static int Texture_setAnimMontage( BPy_Texture * self, PyObject * value )
for( i = 0; i < 4; ++i ) {
self->texture->fradur[i][0] =
EXPP_ClampInt ( fradur[i][0], EXPP_TEX_ANIMMONSTART_MIN,
(short)EXPP_ClampInt ( fradur[i][0], EXPP_TEX_ANIMMONSTART_MIN,
EXPP_TEX_ANIMMONSTART_MAX );
self->texture->fradur[i][1] =
EXPP_ClampInt ( fradur[i][1], EXPP_TEX_ANIMMONDUR_MIN,
(short)EXPP_ClampInt ( fradur[i][1], EXPP_TEX_ANIMMONDUR_MIN,
EXPP_TEX_ANIMMONDUR_MAX );
}
@@ -1482,7 +1482,7 @@ static int Texture_setFlags( BPy_Texture * self, PyObject * value )
return EXPP_ReturnIntError( PyExc_ValueError,
"invalid bit(s) set in mask" );
self->texture->flag = param;
self->texture->flag = (short)param;
#if 0
/* if Colorband enabled, make sure we allocate memory for it */
@@ -1554,7 +1554,7 @@ static int Texture_setImageFlags( BPy_Texture * self, PyObject * value,
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
}
param = PyInt_AS_LONG( value );
param = (short)PyInt_AS_LONG( value );
if( ( param & bitmask ) != param )
return EXPP_ReturnIntError( PyExc_ValueError,
"invalid bit(s) set in mask" );
@@ -1646,7 +1646,7 @@ static int Texture_setNoiseBasis( BPy_Texture * self, PyObject * value )
return EXPP_ReturnIntError( PyExc_ValueError,
"invalid noise type" );
self->texture->noisebasis = param;
self->texture->noisebasis = (short)param;
return 0;
}
@@ -1672,7 +1672,7 @@ static int Texture_setNoiseBasis2( BPy_Texture * self, PyObject * value,
return EXPP_ReturnIntError( PyExc_ValueError,
"invalid noise type" );
self->texture->noisebasis2 = param;
self->texture->noisebasis2 = (short)param;
/*
* for other type values, the attribute is "sine", "saw" or "tri",
@@ -1688,7 +1688,7 @@ static int Texture_setNoiseBasis2( BPy_Texture * self, PyObject * value,
return EXPP_ReturnIntError( PyExc_ValueError,
"expected int value of 1" );
self->texture->noisebasis2 = (int)type;
self->texture->noisebasis2 = (short)(int)type;
}
return 0;
}
@@ -1701,9 +1701,9 @@ static int Texture_setRepeat( BPy_Texture * self, PyObject * args )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected tuple of 2 ints" );
self->texture->xrepeat = EXPP_ClampInt( repeat[0], EXPP_TEX_REPEAT_MIN,
self->texture->xrepeat = (short)EXPP_ClampInt( repeat[0], EXPP_TEX_REPEAT_MIN,
EXPP_TEX_REPEAT_MAX );
self->texture->yrepeat = EXPP_ClampInt( repeat[1], EXPP_TEX_REPEAT_MIN,
self->texture->yrepeat = (short)EXPP_ClampInt( repeat[1], EXPP_TEX_REPEAT_MIN,
EXPP_TEX_REPEAT_MAX );
return 0;
@@ -1736,7 +1736,7 @@ static int Texture_setSType( BPy_Texture * self, PyObject * value )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected int argument" );
param = PyInt_AS_LONG ( value );
param = (short)PyInt_AS_LONG ( value );
/* use the stype map to find out if this is a valid stype for this type *
* note that this will allow CLD_COLOR when type is ENVMAP. there's not *
@@ -1959,7 +1959,7 @@ static PyObject *Texture_getAnimLength( BPy_Texture *self )
if( !attr )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"couldn't get attribute" );return attr;
"couldn't get attribute" );
return attr;
}
@@ -2124,7 +2124,7 @@ static PyObject *Texture_getFlags( BPy_Texture *self )
static PyObject *Texture_getHFracDim( BPy_Texture *self )
{
PyObject *attr = PyInt_FromLong( self->texture->mg_H );
PyObject *attr = PyInt_FromLong( (long)self->texture->mg_H );
if( !attr )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
@@ -2634,7 +2634,7 @@ static PyObject *Texture_oldsetImageFlags( BPy_Texture * self, PyObject * args )
flag |= thisflag;
}
self->texture->imaflag = flag;
self->texture->imaflag = (short)flag;
Py_INCREF( Py_None );
return Py_None;

View File

@@ -614,7 +614,7 @@ int EXPP_setFloatClamped( PyObject *value, float *param,
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
}
*param = EXPP_ClampFloat( PyFloat_AsDouble( value ), min, max );
*param = EXPP_ClampFloat( (float)PyFloat_AsDouble( value ), min, max );
return 0;
}
@@ -634,13 +634,13 @@ int EXPP_setIValueClamped( PyObject *value, void *param,
switch ( type ) {
case 'b':
*(char *)param = EXPP_ClampInt( number, min, max );
*(char *)param = (char)EXPP_ClampInt( number, min, max );
return 0;
case 'h':
*(short *)param = EXPP_ClampInt( number, min, max );
*(short *)param = (short)EXPP_ClampInt( number, min, max );
return 0;
case 'H':
*(unsigned short *)param = EXPP_ClampInt( number, min, max );
*(unsigned short *)param = (unsigned short)EXPP_ClampInt( number, min, max );
return 0;
case 'i':
*(int *)param = EXPP_ClampInt( number, min, max );
@@ -679,7 +679,7 @@ int EXPP_setFloatRange( PyObject *value, float *param,
if( !PyNumber_Check ( value ) )
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
number = PyFloat_AsDouble( value );
number = (short)PyFloat_AsDouble( value );
if ( number < min || number > max )
return EXPP_ReturnIntError( PyExc_ValueError, errstr );
@@ -704,13 +704,13 @@ int EXPP_setIValueRange( PyObject *value, void *param,
switch ( type ) {
case 'b':
*(char *)param = number;
*(char *)param = (char)number;
return 0;
case 'h':
*(short *)param = number;
*(short *)param = (short)number;
return 0;
case 'H':
*(unsigned short *)param = number;
*(unsigned short *)param = (unsigned short)number;
return 0;
case 'i':
*(int *)param = number;
@@ -749,13 +749,13 @@ int EXPP_setModuleConstant ( BPy_constant *constant, void *param, char type )
switch ( type ) {
case 'h':
*(short *)param = PyInt_AS_LONG( item );
*(short *)param = (short)PyInt_AS_LONG( item );
return 0;
case 'i':
*(int *)param = PyInt_AS_LONG( item );
return 0;
case 'f':
*(float *)param = PyFloat_AS_DOUBLE( item );
*(float *)param = (float)PyFloat_AS_DOUBLE( item );
return 0;
default:
return EXPP_ReturnIntError( PyExc_RuntimeError,

View File

@@ -161,9 +161,9 @@ int rgbTuple_setCol( BPy_rgbTuple * self, PyObject * args )
PyNumber_Check( PySequence_Fast_GET_ITEM( args, 0 ) ) &&
PyNumber_Check( PySequence_Fast_GET_ITEM( args, 1 ) ) &&
PyNumber_Check( PySequence_Fast_GET_ITEM( args, 2 ) ) ) {
r = PyFloat_AsDouble( PySequence_Fast_GET_ITEM( args, 0 ) );
g = PyFloat_AsDouble( PySequence_Fast_GET_ITEM( args, 1 ) );
b = PyFloat_AsDouble( PySequence_Fast_GET_ITEM( args, 2 ) );
r = (float)PyFloat_AsDouble( PySequence_Fast_GET_ITEM( args, 0 ) );
g = (float)PyFloat_AsDouble( PySequence_Fast_GET_ITEM( args, 1 ) );
b = (float)PyFloat_AsDouble( PySequence_Fast_GET_ITEM( args, 2 ) );
ok = 1;
} else
ok = PyArg_ParseTuple( args, "fff", &r, &g, &b );