Skip to content

Commit d1b9ecb

Browse files
committed
fix long vs long long bugs
these bugs were introduced by "fix long/int confusions in pyx version of unpack" commit.
1 parent 3dbb2d1 commit d1b9ecb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

msgpack/unpack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static inline int unpack_callback_uint64(unpack_user* u, uint64_t d, msgpack_unp
7070
{
7171
PyObject *p;
7272
if (d > LONG_MAX) {
73-
p = PyLong_FromUnsignedLongLong((unsigned long)d);
73+
p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d);
7474
} else {
7575
p = PyInt_FromLong((long)d);
7676
}
@@ -103,7 +103,7 @@ static inline int unpack_callback_int64(unpack_user* u, int64_t d, msgpack_unpac
103103
{
104104
PyObject *p;
105105
if (d > LONG_MAX || d < LONG_MIN) {
106-
p = PyLong_FromLongLong((unsigned long)d);
106+
p = PyLong_FromLongLong((unsigned PY_LONG_LONG)d);
107107
} else {
108108
p = PyInt_FromLong((long)d);
109109
}

0 commit comments

Comments
 (0)