summaryrefslogtreecommitdiff
path: root/msgpack/unpack_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'msgpack/unpack_template.h')
-rw-r--r--msgpack/unpack_template.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h
index 29ac935..25229ac 100644
--- a/msgpack/unpack_template.h
+++ b/msgpack/unpack_template.h
@@ -151,8 +151,7 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
*/ \
goto _header_again
-#define NEXT_CS(p) \
- ((unsigned int)*p & 0x1f)
+#define NEXT_CS(p) ((unsigned int)*p & 0x1f)
#ifdef USE_CASE_RANGE
#define SWITCH_RANGE_BEGIN switch(*p) {
@@ -185,9 +184,6 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
push_simple_value(_false);
case 0xc3: // true
push_simple_value(_true);
- //case 0xc4:
- //case 0xc5:
- //case 0xc6:
//case 0xc7:
//case 0xc8:
//case 0xc9:
@@ -202,12 +198,15 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
case 0xd2: // signed int 32
case 0xd3: // signed int 64
again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03));
+ case 0xc4: // bin 8
+ case 0xc5: // bin 16
+ case 0xc6: // bin 32
//case 0xd4:
//case 0xd5:
//case 0xd6: // big integer 16
//case 0xd7: // big integer 32
//case 0xd8: // big float 16
- //case 0xd9: // big float 32
+ case 0xd9: // raw 8
case 0xda: // raw 16
case 0xdb: // raw 32
case 0xdc: // array 16
@@ -290,6 +289,18 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
// // FIXME
// push_variable_value(_big_float, data, n, trail);
+ case CS_BIN_8:
+ again_fixed_trail_if_zero(ACS_BIN_VALUE, *(uint8_t*)n, _bin_zero);
+ case CS_BIN_16:
+ again_fixed_trail_if_zero(ACS_BIN_VALUE, _msgpack_load16(uint16_t,n), _bin_zero);
+ case CS_BIN_32:
+ again_fixed_trail_if_zero(ACS_BIN_VALUE, _msgpack_load32(uint32_t,n), _bin_zero);
+ case ACS_BIN_VALUE:
+ _bin_zero:
+ push_variable_value(_bin, data, n, trail);
+
+ case CS_RAW_8:
+ again_fixed_trail_if_zero(ACS_RAW_VALUE, *(uint8_t*)n, _raw_zero);
case CS_RAW_16:
again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load16(uint16_t,n), _raw_zero);
case CS_RAW_32: