chiark / gitweb /
ident.pyx: Remove traces of bogus `failed' and `eof' callbacks.
[mLib-python] / codec.pyx
index 1b395af67e26f3041956f76f6e66cb702a910208..b9f910fd1ab3fb09547f6b05f46de8f9a0b1e0b5 100644 (file)
--- a/codec.pyx
+++ b/codec.pyx
@@ -108,14 +108,14 @@ cdef class _BaseCodec:
       me.c.ops.destroy(me.c)
   cdef code(me, text, int finishp):
     cdef void *p
-    cdef int len
+    cdef Py_ssize_t len
     cdef dstr d
     cdef int err
     if me.c is NULL:
       raise ValueError, 'Encoding finished'
     DCREATE(&d)
     try:
-      PyObject_AsReadBuffer(text, &p, &len)
+      PyObject_AsReadBuffer(text, <cvp *>&p, &len)
       code(me.c, p, len, &d)
       if finishp:
         code(me.c, NULL, 0, &d)