X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib-python/blobdiff_plain/5b1830f325c55c70d65fd020f08dd958493e528d..a19eaede18c9176b382df01e4f6c6e5c04a87d0f:/crc32.pyx diff --git a/crc32.pyx b/crc32.pyx index 5790d24..c1f3b82 100644 --- a/crc32.pyx +++ b/crc32.pyx @@ -31,8 +31,8 @@ cdef class CRC32: pass def chunk(me, data): cdef void *p - cdef int n - PyObject_AsReadBuffer(data, &p, &n) + cdef Py_ssize_t n + PyObject_AsReadBuffer(data, &p, &n) me._a = c_crc32(me._a, p, n) return me def done(me): @@ -40,9 +40,9 @@ cdef class CRC32: def crc32(data): cdef void *p - cdef int n + cdef Py_ssize_t n cdef uint32 c - PyObject_AsReadBuffer(data, &p, &n) + PyObject_AsReadBuffer(data, &p, &n) c = c_crc32(0, p, n) return _u32(c)