Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yksten committed Oct 19, 2020
1 parent 59e809b commit 6e1bf13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/msgpack/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ namespace msgpack {
value.b = false;
bResult = true;
++sz;
++size;
--size;
}break;
case 0xc3: { // true
value.type = Value::VALUEBOOL;
value.b = true;
bResult = true;
++sz;
++size;
--size;
}break;
case 0xca: { // float
++sz; --size;
Expand Down Expand Up @@ -153,6 +153,7 @@ namespace msgpack {
value.type = Value::VALUEINT;
value.i = *sz - 0x00;
bResult = true;
++sz; --size;
} else {
value.type = Value::VALUESTR;
bResult = getFieldName(sz, size, value.bin);
Expand Down Expand Up @@ -181,6 +182,10 @@ namespace msgpack {
if (!(*pFunction)(&value.b))
return false;
}break;
case Value::VALUEINT: {
if (!(*pFunction)(&value.i))
return false;
}break;
case Value::VALUEFLOAT: {
if (!(*pFunction)(&value.f))
return false;
Expand Down
2 changes: 1 addition & 1 deletion tester/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct struExampleEnum {

template<typename T>
void serialize(T& t) {
SERIALIZATION(t, /*id,*/ str, f, db/*, v*/, e);
SERIALIZATION(t, id, str, f, db/*, v*/, e);
}
};

Expand Down

0 comments on commit 6e1bf13

Please sign in to comment.