diff options
author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-04-27 15:19:14 +0000 |
---|---|---|
committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-04-27 15:19:14 +0000 |
commit | f10f690cdd3ea96dc0f2700f9daea8127f5537bf (patch) | |
tree | 258700d0e5d27a80ecd8ff4d0b668b9b79c60825 /cpp/src/qmf/engine/ValueImpl.cpp | |
parent | 165d9cb4734734882082d472db91aabc846c6909 (diff) | |
download | qpid-python-f10f690cdd3ea96dc0f2700f9daea8127f5537bf.tar.gz |
QPID-2556: fix conversion of signed integers in maps and lists.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@938506 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/engine/ValueImpl.cpp')
-rw-r--r-- | cpp/src/qmf/engine/ValueImpl.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cpp/src/qmf/engine/ValueImpl.cpp b/cpp/src/qmf/engine/ValueImpl.cpp index 72c68c420b..c58c28e166 100644 --- a/cpp/src/qmf/engine/ValueImpl.cpp +++ b/cpp/src/qmf/engine/ValueImpl.cpp @@ -121,10 +121,14 @@ void ValueImpl::initMap(const FieldTable& ft) case 0x22 : subval->setUint(fvalue.get<int>()); break; } insert(name.c_str(), subval); - } else if ((amqType & 0xCF) == 0x01) { + } else if (amqType == 0x31) { // int64 Value* subval(new Value(TYPE_INT64)); subval->setInt64(fvalue.get<int64_t>()); insert(name.c_str(), subval); + } else if ((amqType & 0xCF) == 0x01) { // 0x01:int8, 0x11:int16, 0x21:int21 + Value* subval(new Value(TYPE_INT32)); + subval->setInt((int32_t)fvalue.get<int>()); + insert(name.c_str(), subval); } else if (amqType == 0x85 || amqType == 0x95) { Value* subval(new Value(TYPE_LSTR)); subval->setString(fvalue.get<string>().c_str()); @@ -233,15 +237,19 @@ void ValueImpl::initList(const List& fl) } else if ((amqType & 0xCF) == 0x02) { Value* subval(new Value(TYPE_UINT32)); switch (amqType) { - case 0x02 : subval->setUint(fvalue.get<int>()); break; - case 0x12 : subval->setUint(fvalue.get<int>()); break; - case 0x22 : subval->setUint(fvalue.get<int>()); break; + case 0x02 : subval->setUint(fvalue.get<int>()); break; // uint8 + case 0x12 : subval->setUint(fvalue.get<int>()); break; // uint16 + case 0x22 : subval->setUint(fvalue.get<int>()); break; // uint32 } appendToList(subval); - } else if ((amqType & 0xCF) == 0x01) { + } else if (amqType == 0x31) { // int64 Value* subval(new Value(TYPE_INT64)); subval->setInt64(fvalue.get<int64_t>()); appendToList(subval); + } else if ((amqType & 0xCF) == 0x01) { // 0x01:int8, 0x11:int16, 0x21:int32 + Value* subval(new Value(TYPE_INT32)); + subval->setInt((int32_t)fvalue.get<int>()); + appendToList(subval); } else if (amqType == 0x85 || amqType == 0x95) { Value* subval(new Value(TYPE_LSTR)); subval->setString(fvalue.get<string>().c_str()); |