me.ctx.maxline = maxline
def encode(me, text):
cdef void *p
- cdef int len
+ cdef Py_ssize_t len
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:
me.ctx.indent = NULL
def decode(me, text):
cdef void *p
- cdef int len
+ cdef Py_ssize_t len
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: