diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2005-09-26 18:46:14 +0400 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2005-09-26 18:46:14 +0400 |
commit | b6ecdb8c354233c33dcd1282ddf8bc7e68120c37 (patch) | |
tree | 77db145a7d4c931584012ba23832960bb194ca47 /source/blender | |
parent | 577456f86af8fc3390a274da7e28281fff0fe43f (diff) |
Project file update for elbeem
Warning clean up of python project
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/api2_2x/Key.c | 6 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Lamp.c | 6 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Material.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/NMesh.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Texture.c | 26 | ||||
-rw-r--r-- | source/blender/python/api2_2x/gen_utils.c | 20 | ||||
-rw-r--r-- | source/blender/python/api2_2x/rgbTuple.c | 6 |
7 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/python/api2_2x/Key.c b/source/blender/python/api2_2x/Key.c index 997d4e36400..543b8d80e33 100644 --- a/source/blender/python/api2_2x/Key.c +++ b/source/blender/python/api2_2x/Key.c @@ -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; diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index 3a1e4a815e5..9f684e914ed 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -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, diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index fc550545857..31f6bb2290c 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -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 ) { diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c index 53a3271aa5f..b777e2406ef 100644 --- a/source/blender/python/api2_2x/NMesh.c +++ b/source/blender/python/api2_2x/NMesh.c @@ -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 ) diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 7682facd817..9a9dc93af85 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -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; diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c index e76943573a0..885e7fbf7a0 100644 --- a/source/blender/python/api2_2x/gen_utils.c +++ b/source/blender/python/api2_2x/gen_utils.c @@ -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, diff --git a/source/blender/python/api2_2x/rgbTuple.c b/source/blender/python/api2_2x/rgbTuple.c index f7ad9dc10af..2e228e70661 100644 --- a/source/blender/python/api2_2x/rgbTuple.c +++ b/source/blender/python/api2_2x/rgbTuple.c @@ -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 ); |