diff options
author | Ken Hughes <khughes@pacific.edu> | 2005-10-04 02:06:16 +0400 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2005-10-04 02:06:16 +0400 |
commit | b777b23e073193108a656b026e59e44f59c5d392 (patch) | |
tree | fbf9e5cb839df6ce8256282444ec507043f29f11 /source/blender/python/api2_2x/gen_utils.c | |
parent | b4c85d58f6f7d8d5d5ea62bf508dcd5da812d317 (diff) |
Bugfixes for #3102, #3104
- Fix incorrect usage of PySequence_Fast_GET_ITEM()
- make EXPP_setFloatRange() convert its argument to float instead of short
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.c')
-rw-r--r-- | source/blender/python/api2_2x/gen_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c index 885e7fbf7a0..b88d8e22010 100644 --- a/source/blender/python/api2_2x/gen_utils.c +++ b/source/blender/python/api2_2x/gen_utils.c @@ -672,14 +672,14 @@ int EXPP_setFloatRange( PyObject *value, float *param, float min, float max ) { char errstr[128]; - short number; + float number; sprintf ( errstr, "expected int argument in [%f,%f]", min, max ); if( !PyNumber_Check ( value ) ) return EXPP_ReturnIntError( PyExc_TypeError, errstr ); - number = (short)PyFloat_AsDouble( value ); + number = (float)PyFloat_AsDouble( value ); if ( number < min || number > max ) return EXPP_ReturnIntError( PyExc_ValueError, errstr ); @@ -843,7 +843,7 @@ PyObject *EXPP_setterWrapper ( PyObject * self, PyObject * args, return EXPP_ReturnPyObjError( PyExc_RuntimeError, "expected tuple of one item" ); - error = func ( self, PySequence_Fast_GET_ITEM( args, 0 ), NULL ); + error = func ( self, PyTuple_GET_ITEM( args, 0 ), NULL ); if ( !error ) { Py_INCREF( Py_None ); return Py_None; |