Commit b95b5789 authored by Robert Bradshaw's avatar Robert Bradshaw

fix size_t conversions

parent e4f6e4ca
......@@ -1725,9 +1725,11 @@ class DefNode(FuncDefNode):
(arg.type.is_extension_type or arg.type.is_builtin_type):
arg.needs_type_test = 1
any_type_tests_needed = 1
elif arg.type is PyrexTypes.c_py_ssize_t_type:
# Want to use __index__ rather than __int__ method
# that PyArg_ParseTupleAndKeywords calls
elif (arg.type is PyrexTypes.c_py_ssize_t_type
or arg.type is PyrexTypes.c_size_t_type):
# Don't use PyArg_ParseTupleAndKeywords's parsing
# Py_ssize_t: want to use __index__ rather than __int__
# size_t: no Python format char
arg.needs_conversion = 1
arg.hdr_type = PyrexTypes.py_object_type
arg.hdr_cname = Naming.arg_prefix + arg.name
......
......@@ -1191,7 +1191,7 @@ c_slong_type = CIntType(3, 2, "T_LONG")
c_slonglong_type = CLongLongType(4, 2, "T_LONGLONG")
c_py_ssize_t_type = CPySSizeTType(5, 1)
c_size_t_type = CSizeTType(6, 1)
c_size_t_type = CSizeTType(6, 1, "(sizeof(size_t) == sizeof(unsigned long) ? T_ULONG : T_ULONGLONG)")
c_float_type = CFloatType(7, "T_FLOAT")
c_double_type = CFloatType(8, "T_DOUBLE")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment