Commit d2081a55 authored by Robert Bradshaw's avatar Robert Bradshaw

Merge pull request #224 from gandalf013/pyssize_t

int -> Py_ssize_t in cpython pxd files
parents d905deb9 0eda1140
......@@ -56,7 +56,7 @@ cdef extern from "Python.h":
void* PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices)
# ??
int PyBuffer_SizeFromFormat(char *) # actually const char
Py_ssize_t PyBuffer_SizeFromFormat(char *) # actually const char
# Return the implied ~Py_buffer.itemsize from the struct-stype
# ~Py_buffer.format
......@@ -90,7 +90,7 @@ cdef extern from "Python.h":
void PyBuffer_FillContiguousStrides(int ndims,
Py_ssize_t *shape,
Py_ssize_t *strides,
int itemsize,
Py_ssize_t itemsize,
char fort)
# Fill the strides array with byte-strides of a contiguous
# (Fortran-style if fort is 'F' or C-style otherwise) array of the
......
......@@ -84,7 +84,7 @@ cdef extern from "Python.h":
# value, return 1, otherwise return 0. On error, return -1. This
# is equivalent to the Python expression "value in o".
int PySequence_Index(object o, object value) except -1
Py_ssize_t PySequence_Index(object o, object value) except -1
# Return the first index i for which o[i] == value. On error,
# return -1. This is equivalent to the Python expression
# "o.index(value)".
......@@ -126,7 +126,7 @@ cdef extern from "Python.h":
# PySequence_Check(o) is true and without adjustment for negative
# indices.
int PySequence_Fast_GET_SIZE(object o)
Py_ssize_t PySequence_Fast_GET_SIZE(object o)
# Returns the length of o, assuming that o was returned by
# PySequence_Fast() and that o is not NULL. The size can also be
# gotten by calling PySequence_Size() on o, but
......
......@@ -66,12 +66,12 @@ cdef extern from "Python.h":
# The following functions and macros are available for instances
# of set or frozenset or instances of their subtypes.
int PySet_Size(object anyset) except -1
Py_ssize_t PySet_Size(object anyset) except -1
# Return the length of a set or frozenset object. Equivalent to
# "len(anyset)". Raises a PyExc_SystemError if anyset is not a
# set, frozenset, or an instance of a subtype.
int PySet_GET_SIZE(object anyset)
Py_ssize_t PySet_GET_SIZE(object anyset)
# Macro form of PySet_Size() without error checking.
bint PySet_Contains(object anyset, object key) except -1
......
......@@ -24,10 +24,10 @@ cdef extern from "Python.h":
# pointing to Python objects. "PyTuple_Pack(2, a, b)" is
# equivalent to "Py_BuildValue("(OO)", a, b)".
int PyTuple_Size(object p) except -1
Py_ssize_t PyTuple_Size(object p) except -1
# Take a pointer to a tuple object, and return the size of that tuple.
int PyTuple_GET_SIZE(object p)
Py_ssize_t PyTuple_GET_SIZE(object p)
# Return the size of the tuple p, which must be non-NULL and point
# to a tuple; no error checking is performed.
......
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