Skip to content

Commit

Permalink
Fix 64bit integers pack, issue #20.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Isaikin committed Apr 26, 2016
1 parent 46f6184 commit 7cbc3c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/private/pack_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ quint8 *MsgPackPrivate::pack_uint(quint32 i, quint8 *p, bool wr)

quint8 *MsgPackPrivate::pack_longlong(qint64 i, quint8 *p, bool wr)
{
if (i >= std::numeric_limits<qint32>::min()
&& i <= std::numeric_limits<quint32>::max())
return p = pack_int(i, p, wr);
if (i >= 0 && i <= std::numeric_limits<quint32>::max())
return pack_uint(i, p, wr);
else if (i >= std::numeric_limits<qint32>::min()
&& i <= std::numeric_limits<qint32>::max())
return pack_int(i, p, wr);
if (wr) *p = 0xd3;
p++;
if (wr) _msgpack_store64(p, i);
Expand Down

0 comments on commit 7cbc3c3

Please sign in to comment.