*.pyx, defs.pxi, grim.h: Add awful casts to `PyObject_AsReadBuffer'.
[mLib-python] / codec.pyx.in
index a1199c6..37e0293 100644 (file)
@@ -64,7 +64,7 @@ cdef class %CLASS%Encode:
     cdef dstr d
     DCREATE(&d)
     try:
-      PyObject_AsReadBuffer(text, &p, &len)
+      PyObject_AsReadBuffer(text, <cvp *>&p, &len)
       _%PREFIX%_encode(&me.ctx, p, len, &d)
       rc = PyString_FromStringAndSize(d.buf, d.len)
     finally:
@@ -95,7 +95,7 @@ cdef class %CLASS%Decode:
     cdef dstr d
     DCREATE(&d)
     try:
-      PyObject_AsReadBuffer(text, &p, &len)
+      PyObject_AsReadBuffer(text, <cvp *>&p, &len)
       _%PREFIX%_decode(&me.ctx, p, len, &d)
       rc = PyString_FromStringAndSize(d.buf, d.len)
     finally: