From 3dbb2d1e7e97a61a9c36e316336552dc0e20577f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 3 Jun 2013 13:18:52 +0900 Subject: fix compilation errors --- msgpack/_unpacker.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'msgpack') diff --git a/msgpack/_unpacker.pyx b/msgpack/_unpacker.pyx index 9ff1085..1f4dd85 100644 --- a/msgpack/_unpacker.pyx +++ b/msgpack/_unpacker.pyx @@ -4,7 +4,7 @@ from cpython cimport * cdef extern from "Python.h": ctypedef struct PyObject - cdef int PyObject_AsReadBuffer(object o, const void* buff, Py_ssize_t* buf_len) except -1 + cdef int PyObject_AsReadBuffer(object o, const void** buff, Py_ssize_t* buf_len) except -1 from libc.stdlib cimport * from libc.string cimport * @@ -95,7 +95,7 @@ def unpackb(object packed, object object_hook=None, object list_hook=None, cdef char* cenc = NULL cdef char* cerr = NULL - PyObject_AsReadBuffer(packed, &buf, &buf_len) + PyObject_AsReadBuffer(packed, &buf, &buf_len) if encoding is not None: if isinstance(encoding, unicode): -- cgit v1.2.1 From d1b9ecbc8e33663663f2fb2f13ac17854dd6c8d6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 3 Jun 2013 13:49:44 +0900 Subject: fix long vs long long bugs these bugs were introduced by "fix long/int confusions in pyx version of unpack" commit. --- msgpack/unpack.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'msgpack') diff --git a/msgpack/unpack.h b/msgpack/unpack.h index fb13b4e..baeed1f 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -70,7 +70,7 @@ static inline int unpack_callback_uint64(unpack_user* u, uint64_t d, msgpack_unp { PyObject *p; if (d > LONG_MAX) { - p = PyLong_FromUnsignedLongLong((unsigned long)d); + p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d); } else { p = PyInt_FromLong((long)d); } @@ -103,7 +103,7 @@ static inline int unpack_callback_int64(unpack_user* u, int64_t d, msgpack_unpac { PyObject *p; if (d > LONG_MAX || d < LONG_MIN) { - p = PyLong_FromLongLong((unsigned long)d); + p = PyLong_FromLongLong((unsigned PY_LONG_LONG)d); } else { p = PyInt_FromLong((long)d); } -- cgit v1.2.1