Merge with romixlab/qmsgpack:master

This commit is contained in:
Alex Makarov
2016-07-05 18:48:12 +03:00
4 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ QByteArray MsgPack::pack(const QVariant &variant)
return arr; return arr;
} }
bool MsgPack::registerPacker(QMetaType::Type qType, qint8 msgpackType, MsgPack::pack_user_f packer) bool MsgPack::registerPacker(int qType, qint8 msgpackType, MsgPack::pack_user_f packer)
{ {
return MsgPackPrivate::register_packer(qType, msgpackType, packer); return MsgPackPrivate::register_packer(qType, msgpackType, packer);
} }

View File

@ -13,7 +13,7 @@ namespace MsgPack
MSGPACK_EXPORT bool registerUnpacker(qint8 msgpackType, unpack_user_f unpacker); MSGPACK_EXPORT bool registerUnpacker(qint8 msgpackType, unpack_user_f unpacker);
MSGPACK_EXPORT QByteArray pack(const QVariant &variant); MSGPACK_EXPORT QByteArray pack(const QVariant &variant);
MSGPACK_EXPORT bool registerPacker(QMetaType::Type qType, qint8 msgpackType, pack_user_f packer); MSGPACK_EXPORT bool registerPacker(int qType, qint8 msgpackType, pack_user_f packer);
MSGPACK_EXPORT qint8 msgpackType(int qType); MSGPACK_EXPORT qint8 msgpackType(int qType);
MSGPACK_EXPORT bool registerType(QMetaType::Type qType, quint8 msgpackType); MSGPACK_EXPORT bool registerType(QMetaType::Type qType, quint8 msgpackType);

View File

@ -11,7 +11,7 @@
#include <QReadLocker> #include <QReadLocker>
#include <QWriteLocker> #include <QWriteLocker>
QHash<QMetaType::Type, MsgPackPrivate::packer_t> MsgPackPrivate::user_packers; QHash<int, MsgPackPrivate::packer_t> MsgPackPrivate::user_packers;
bool MsgPackPrivate::compatibilityMode = false; bool MsgPackPrivate::compatibilityMode = false;
QReadWriteLock MsgPackPrivate::packers_lock; QReadWriteLock MsgPackPrivate::packers_lock;
@ -319,7 +319,7 @@ quint8 *MsgPackPrivate::pack_map(const QVariantMap &map, quint8 *p, bool wr, QVe
return p; return p;
} }
bool MsgPackPrivate::register_packer(QMetaType::Type q_type, qint8 msgpack_type, MsgPack::pack_user_f packer) bool MsgPackPrivate::register_packer(int q_type, qint8 msgpack_type, MsgPack::pack_user_f packer)
{ {
QWriteLocker locker(&packers_lock); QWriteLocker locker(&packers_lock);
if (user_packers.contains(q_type)) { if (user_packers.contains(q_type)) {

View File

@ -19,9 +19,9 @@ typedef struct {
MsgPack::pack_user_f packer; MsgPack::pack_user_f packer;
qint8 type; qint8 type;
} packer_t; } packer_t;
bool register_packer(QMetaType::Type q_type, qint8 msgpack_type, MsgPack::pack_user_f packer); bool register_packer(int q_type, qint8 msgpack_type, MsgPack::pack_user_f packer);
qint8 msgpack_type(QMetaType::Type q_type); qint8 msgpack_type(QMetaType::Type q_type);
extern QHash<QMetaType::Type, packer_t> user_packers; extern QHash<int, packer_t> user_packers;
extern QReadWriteLock packers_lock; extern QReadWriteLock packers_lock;
extern bool compatibilityMode; extern bool compatibilityMode;