diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-14 23:15:21 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-14 23:15:21 +0000 |
commit | f77587b2cd9091a99a31bb0d5f99c57cc077aa8e (patch) | |
tree | 8894af7b880beece61903e47dd84c7205e3ee8d3 /numpy/core/src/scalarmathmodule.c.src | |
parent | 06acb9555bf64997423b124620fb469cab24cb2b (diff) | |
download | numpy-f77587b2cd9091a99a31bb0d5f99c57cc077aa8e.tar.gz |
Fix Python 2.5 compatibility to work with new b3 release
Diffstat (limited to 'numpy/core/src/scalarmathmodule.c.src')
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index bf99a5d26..be35878ca 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -712,8 +712,8 @@ static PyObject * /**end repeat**/ /**begin repeat - #name=(float,double,longdouble,cfloat,cdouble,clongdouble)*6# - #oper=lshift*6, rshift*6, and*6, or*6, xor*6, index*6# + #name=(float,double,longdouble,cfloat,cdouble,clongdouble)*5# + #oper=lshift*6, rshift*6, and*6, or*6, xor*6# **/ #define @name@_@oper@ NULL /**end repeat**/ @@ -819,20 +819,6 @@ static PyObject * /**end repeat**/ -#if PY_VERSION_HEX >= 0x02050000 -/**begin repeat - #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong# - #Name=Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong# -**/ -static Py_ssize_t -@name@_index(PyObject *a) -{ - return PyArrayScalar_VAL(a, @Name@); -} -/**end repeat**/ -#endif - - /**begin repeat #oper=le,ge,lt,gt,eq,ne# #op=<=,>=,<,>,==,!=# @@ -937,7 +923,7 @@ static PyNumberMethods @name@_as_number = { 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 - (lenfunc)@name@_index, /*nb_index*/ + (unaryfunc)NULL, /*nb_index*/ #endif }; /**end repeat**/ @@ -951,6 +937,9 @@ add_scalarmath(void) #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble# #NAME=Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble# **/ +#if PY_VERSION_HEX >= 0x02050000 + @name@_as_number.nb_index = Py@NAME@ArrType_Type.tp_as_number->nb_index; +#endif Py@NAME@ArrType_Type.tp_as_number = &(@name@_as_number); Py@NAME@ArrType_Type.tp_richcompare = @name@_richcompare; /**end repeat**/ |