diff options
| author | Antonio Cuni <anto.cuni@gmail.com> | 2013-10-19 18:04:30 +0200 |
|---|---|---|
| committer | Antonio Cuni <anto.cuni@gmail.com> | 2013-10-19 18:04:30 +0200 |
| commit | c9b97f078854dda02dc9404ee9d88ca5e16fb493 (patch) | |
| tree | b48859b91cac80fe350a7e624f1cc389880b41e8 /msgpack/unpack_template.h | |
| parent | 56dd1650a42a454027ba335b494100a9f211758e (diff) | |
| download | msgpack-python-c9b97f078854dda02dc9404ee9d88ca5e16fb493.tar.gz | |
implement unpacking of ext 8,16,32
Diffstat (limited to 'msgpack/unpack_template.h')
| -rw-r--r-- | msgpack/unpack_template.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h index b051075..0c6af0e 100644 --- a/msgpack/unpack_template.h +++ b/msgpack/unpack_template.h @@ -188,9 +188,12 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l //case 0xc4: //case 0xc5: //case 0xc6: - //case 0xc7: - //case 0xc8: - //case 0xc9: + case 0xc7: // ext 8 + again_fixed_trail(NEXT_CS(p), 1); + case 0xc8: // ext 16 + again_fixed_trail(NEXT_CS(p), 2); + case 0xc9: // ext 32 + again_fixed_trail(NEXT_CS(p), 4); case 0xca: // float case 0xcb: // double case 0xcc: // unsigned int 8 @@ -242,8 +245,16 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l if((size_t)(pe - p) < trail) { goto _out; } n = p; p += trail - 1; switch(cs) { - //case CS_ - //case CS_ + case CS_EXT_8: + again_fixed_trail_if_zero(ACS_EXT_VALUE, *(uint8_t*)n+1, _ext_zero); + case CS_EXT_16: + again_fixed_trail_if_zero(ACS_EXT_VALUE, + _msgpack_load16(uint16_t,n)+1, + _ext_zero); + case CS_EXT_32: + again_fixed_trail_if_zero(ACS_EXT_VALUE, + _msgpack_load32(uint32_t,n)+1, + _ext_zero); case CS_FLOAT: { union { uint32_t i; float f; } mem; mem.i = _msgpack_load32(uint32_t,n); |
