chiark / gitweb /
*.pyx, defs.pxi, grim.h: Add awful casts to `PyObject_AsReadBuffer'.
[mLib-python] / assoc.pyx
index 2a6e6e537143dde66e181540286911623ede1fe4..38b8446f4b0ba86411b7a13706f904c7a6eb7629 100644 (file)
--- a/assoc.pyx
+++ b/assoc.pyx
@@ -34,11 +34,11 @@ cdef class AssocTable (Mapping):
     return 0
   cdef void *_find(me, object key, unsigned *f) except NULL:
     cdef void *p
-    cdef int n
+    cdef Py_ssize_t n
     cdef _assoc_entry *e
     cdef atom *a
     a = ATOM_A(atom_pyintern(key))
-    PyObject_AsReadBuffer(key, &p, &n)
+    PyObject_AsReadBuffer(key, <cvp *>&p, &n)
     if f:
       f[0] = 0
       e = <_assoc_entry *>assoc_find(&me._t, a, PSIZEOF(e), f)