mirror of
				https://github.com/msgpack/msgpack-c.git
				synced 2025-11-04 04:09:59 +01:00 
			
		
		
		
	Modified unpack_user* to unpack_user&.
Removed redundant 'static'.
This commit is contained in:
		@@ -60,74 +60,74 @@ private:
 | 
				
			|||||||
	bool referenced_;
 | 
						bool referenced_;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline object template_callback_root(unpack_user* u)
 | 
					inline object template_callback_root(unpack_user&)
 | 
				
			||||||
{ object o; return o; }
 | 
					{ object o; return o; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_uint8(unpack_user* u, uint8_t d, object& o)
 | 
					inline int template_callback_uint8(unpack_user&, uint8_t d, object& o)
 | 
				
			||||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_uint16(unpack_user* u, uint16_t d, object& o)
 | 
					inline int template_callback_uint16(unpack_user&, uint16_t d, object& o)
 | 
				
			||||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_uint32(unpack_user* u, uint32_t d, object& o)
 | 
					inline int template_callback_uint32(unpack_user&, uint32_t d, object& o)
 | 
				
			||||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_uint64(unpack_user* u, uint64_t d, object& o)
 | 
					inline int template_callback_uint64(unpack_user&, uint64_t d, object& o)
 | 
				
			||||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_int8(unpack_user* u, int8_t d, object& o)
 | 
					inline int template_callback_int8(unpack_user&, int8_t d, object& o)
 | 
				
			||||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
		else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
							else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_int16(unpack_user* u, int16_t d, object& o)
 | 
					inline int template_callback_int16(unpack_user&, int16_t d, object& o)
 | 
				
			||||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
		else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
							else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_int32(unpack_user* u, int32_t d, object& o)
 | 
					inline int template_callback_int32(unpack_user&, int32_t d, object& o)
 | 
				
			||||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
		else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
							else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_int64(unpack_user* u, int64_t d, object& o)
 | 
					inline int template_callback_int64(unpack_user&, int64_t d, object& o)
 | 
				
			||||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
					{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; return 0; }
 | 
				
			||||||
		else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
							else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; return 0; } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_float(unpack_user* u, float d, object& o)
 | 
					inline int template_callback_float(unpack_user&, float d, object& o)
 | 
				
			||||||
{ o.type = type::DOUBLE; o.via.dec = d; return 0; }
 | 
					{ o.type = type::DOUBLE; o.via.dec = d; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_double(unpack_user* u, double d, object& o)
 | 
					inline int template_callback_double(unpack_user&, double d, object& o)
 | 
				
			||||||
{ o.type = type::DOUBLE; o.via.dec = d; return 0; }
 | 
					{ o.type = type::DOUBLE; o.via.dec = d; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_nil(unpack_user* u, object& o)
 | 
					inline int template_callback_nil(unpack_user&, object& o)
 | 
				
			||||||
{ o.type = type::NIL; return 0; }
 | 
					{ o.type = type::NIL; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_true(unpack_user* u, object& o)
 | 
					inline int template_callback_true(unpack_user&, object& o)
 | 
				
			||||||
{ o.type = type::BOOLEAN; o.via.boolean = true; return 0; }
 | 
					{ o.type = type::BOOLEAN; o.via.boolean = true; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_false(unpack_user* u, object& o)
 | 
					inline int template_callback_false(unpack_user&, object& o)
 | 
				
			||||||
{ o.type = type::BOOLEAN; o.via.boolean = false; return 0; }
 | 
					{ o.type = type::BOOLEAN; o.via.boolean = false; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_array(unpack_user* u, unsigned int n, object& o)
 | 
					inline int template_callback_array(unpack_user&u, unsigned int n, object& o)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	o.type = type::ARRAY;
 | 
						o.type = type::ARRAY;
 | 
				
			||||||
	o.via.array.size = 0;
 | 
						o.via.array.size = 0;
 | 
				
			||||||
	o.via.array.ptr = (object*)u->z().malloc(n*sizeof(object));
 | 
						o.via.array.ptr = (object*)u.z().malloc(n*sizeof(object));
 | 
				
			||||||
	if(o.via.array.ptr == NULL) { return -1; }
 | 
						if(o.via.array.ptr == NULL) { return -1; }
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_array_item(unpack_user* u, object& c, object const& o)
 | 
					inline int template_callback_array_item(unpack_user&, object& c, object const& o)
 | 
				
			||||||
{ c.via.array.ptr[c.via.array.size++] = o; return 0; }
 | 
					{ c.via.array.ptr[c.via.array.size++] = o; return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_map(unpack_user* u, unsigned int n, object& o)
 | 
					inline int template_callback_map(unpack_user& u, unsigned int n, object& o)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	o.type = type::MAP;
 | 
						o.type = type::MAP;
 | 
				
			||||||
	o.via.map.size = 0;
 | 
						o.via.map.size = 0;
 | 
				
			||||||
	o.via.map.ptr = (object_kv*)u->z().malloc(n*sizeof(object_kv));
 | 
						o.via.map.ptr = (object_kv*)u.z().malloc(n*sizeof(object_kv));
 | 
				
			||||||
	if(o.via.map.ptr == NULL) { return -1; }
 | 
						if(o.via.map.ptr == NULL) { return -1; }
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_map_item(unpack_user* u, object& c, object const& k, object const& v)
 | 
					inline int template_callback_map_item(unpack_user&, object& c, object const& k, object const& v)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	c.via.map.ptr[c.via.map.size].key = k;
 | 
						c.via.map.ptr[c.via.map.size].key = k;
 | 
				
			||||||
	c.via.map.ptr[c.via.map.size].val = v;
 | 
						c.via.map.ptr[c.via.map.size].val = v;
 | 
				
			||||||
@@ -135,12 +135,12 @@ inline int template_callback_map_item(unpack_user* u, object& c, object const& k
 | 
				
			|||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline int template_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int l, object& o)
 | 
					inline int template_callback_raw(unpack_user& u, const char* b, const char* p, unsigned int l, object& o)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	o.type = type::RAW;
 | 
						o.type = type::RAW;
 | 
				
			||||||
	o.via.raw.ptr = p;
 | 
						o.via.raw.ptr = p;
 | 
				
			||||||
	o.via.raw.size = l;
 | 
						o.via.raw.size = l;
 | 
				
			||||||
	u->set_referenced(true);
 | 
						u.set_referenced(true);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -192,7 +192,7 @@ class template_context {
 | 
				
			|||||||
public:
 | 
					public:
 | 
				
			||||||
	template_context():cs_(CS_HEADER), trail_(0), top_(0)
 | 
						template_context():cs_(CS_HEADER), trail_(0), top_(0)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		stack_[0].setObj(template_callback_root(&user_));
 | 
							stack_[0].setObj(template_callback_root(user_));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void init()
 | 
						void init()
 | 
				
			||||||
@@ -200,7 +200,7 @@ public:
 | 
				
			|||||||
		cs_ = CS_HEADER;
 | 
							cs_ = CS_HEADER;
 | 
				
			||||||
		trail_ = 0;
 | 
							trail_ = 0;
 | 
				
			||||||
		top_ = 0;
 | 
							top_ = 0;
 | 
				
			||||||
		stack_[0].setObj(template_callback_root(&user_));
 | 
							stack_[0].setObj(template_callback_root(user_));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	object const& data() const
 | 
						object const& data() const
 | 
				
			||||||
@@ -230,7 +230,6 @@ public:
 | 
				
			|||||||
		unsigned int cs = cs_;
 | 
							unsigned int cs = cs_;
 | 
				
			||||||
		unsigned int top = top_;
 | 
							unsigned int top = top_;
 | 
				
			||||||
		template_unpack_stack* stack = stack_;
 | 
							template_unpack_stack* stack = stack_;
 | 
				
			||||||
		unpack_user* user = &user_;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		object obj;
 | 
							object obj;
 | 
				
			||||||
		template_unpack_stack* c = nullptr;
 | 
							template_unpack_stack* c = nullptr;
 | 
				
			||||||
@@ -244,23 +243,23 @@ public:
 | 
				
			|||||||
			case CS_HEADER:
 | 
								case CS_HEADER:
 | 
				
			||||||
				if (0) {
 | 
									if (0) {
 | 
				
			||||||
				} else if(0x00 <= *p && *p <= 0x7f) { // Positive Fixnum
 | 
									} else if(0x00 <= *p && *p <= 0x7f) { // Positive Fixnum
 | 
				
			||||||
					if(template_callback_uint8(user, *(uint8_t*)p, obj) < 0) { goto _failed; }
 | 
										if(template_callback_uint8(user_, *(uint8_t*)p, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				} else if(0xe0 <= *p && *p <= 0xff) { // Negative Fixnum
 | 
									} else if(0xe0 <= *p && *p <= 0xff) { // Negative Fixnum
 | 
				
			||||||
					if(template_callback_int8(user, *(int8_t*)p, obj) < 0) { goto _failed; }
 | 
										if(template_callback_int8(user_, *(int8_t*)p, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				} else if(0xc0 <= *p && *p <= 0xdf) { // Variable
 | 
									} else if(0xc0 <= *p && *p <= 0xdf) { // Variable
 | 
				
			||||||
					switch(*p) {
 | 
										switch(*p) {
 | 
				
			||||||
					case 0xc0:	// nil
 | 
										case 0xc0:	// nil
 | 
				
			||||||
						if(template_callback_nil(user, obj) < 0) { goto _failed; }
 | 
											if(template_callback_nil(user_, obj) < 0) { goto _failed; }
 | 
				
			||||||
						goto _push;
 | 
											goto _push;
 | 
				
			||||||
					//case 0xc1:  // string
 | 
										//case 0xc1:  // string
 | 
				
			||||||
					//	again_terminal_trail(next_cs(p), p+1);
 | 
										//	again_terminal_trail(next_cs(p), p+1);
 | 
				
			||||||
					case 0xc2:	// false
 | 
										case 0xc2:	// false
 | 
				
			||||||
						if(template_callback_false(user, obj) < 0) { goto _failed; }
 | 
											if(template_callback_false(user_, obj) < 0) { goto _failed; }
 | 
				
			||||||
						goto _push;
 | 
											goto _push;
 | 
				
			||||||
					case 0xc3:	// true
 | 
										case 0xc3:	// true
 | 
				
			||||||
						if(template_callback_true(user, obj) < 0) { goto _failed; }
 | 
											if(template_callback_true(user_, obj) < 0) { goto _failed; }
 | 
				
			||||||
						goto _push;
 | 
											goto _push;
 | 
				
			||||||
					case 0xc4: // bin 8
 | 
										case 0xc4: // bin 8
 | 
				
			||||||
					case 0xc5: // bin 16
 | 
										case 0xc5: // bin 16
 | 
				
			||||||
@@ -314,7 +313,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
				} else if(0x90 <= *p && *p <= 0x9f) { // FixArray
 | 
									} else if(0x90 <= *p && *p <= 0x9f) { // FixArray
 | 
				
			||||||
					if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
										if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
				
			||||||
					if(template_callback_array(user, ((unsigned int)*p) & 0x0f, stack[top].obj()) < 0) { goto _failed; }
 | 
										if(template_callback_array(user_, ((unsigned int)*p) & 0x0f, stack[top].obj()) < 0) { goto _failed; }
 | 
				
			||||||
					if((((unsigned int)*p) & 0x0f) == 0) { obj = stack[top].obj(); goto _push; }
 | 
										if((((unsigned int)*p) & 0x0f) == 0) { obj = stack[top].obj(); goto _push; }
 | 
				
			||||||
					stack[top].set_ct(CT_ARRAY_ITEM);
 | 
										stack[top].set_ct(CT_ARRAY_ITEM);
 | 
				
			||||||
					stack[top].set_count(((unsigned int)*p) & 0x0f);
 | 
										stack[top].set_count(((unsigned int)*p) & 0x0f);
 | 
				
			||||||
@@ -323,7 +322,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
				} else if(0x80 <= *p && *p <= 0x8f) { // FixMap
 | 
									} else if(0x80 <= *p && *p <= 0x8f) { // FixMap
 | 
				
			||||||
					if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
										if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
				
			||||||
					if(template_callback_map(user, ((unsigned int)*p) & 0x0f, stack[top].obj()) < 0) { goto _failed; }
 | 
										if(template_callback_map(user_, ((unsigned int)*p) & 0x0f, stack[top].obj()) < 0) { goto _failed; }
 | 
				
			||||||
					if((((unsigned int)*p) & 0x0f) == 0) { obj = stack[top].obj(); goto _push; }
 | 
										if((((unsigned int)*p) & 0x0f) == 0) { obj = stack[top].obj(); goto _push; }
 | 
				
			||||||
					stack[top].set_ct(CT_MAP_KEY);
 | 
										stack[top].set_ct(CT_MAP_KEY);
 | 
				
			||||||
					stack[top].set_count(((unsigned int)*p) & 0x0f);
 | 
										stack[top].set_count(((unsigned int)*p) & 0x0f);
 | 
				
			||||||
@@ -348,7 +347,7 @@ _fixed_trail_again:
 | 
				
			|||||||
				case CS_FLOAT: {
 | 
									case CS_FLOAT: {
 | 
				
			||||||
					union { uint32_t i; float f; } mem;
 | 
										union { uint32_t i; float f; } mem;
 | 
				
			||||||
					mem.i = _msgpack_load32(uint32_t,n);
 | 
										mem.i = _msgpack_load32(uint32_t,n);
 | 
				
			||||||
					if(template_callback_float(user, mem.f, obj) < 0) { goto _failed; }
 | 
										if(template_callback_float(user_, mem.f, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push; }
 | 
										goto _push; }
 | 
				
			||||||
				case CS_DOUBLE: {
 | 
									case CS_DOUBLE: {
 | 
				
			||||||
					union { uint64_t i; double f; } mem;
 | 
										union { uint64_t i; double f; } mem;
 | 
				
			||||||
@@ -357,32 +356,32 @@ _fixed_trail_again:
 | 
				
			|||||||
					// https://github.com/msgpack/msgpack-perl/pull/1
 | 
										// https://github.com/msgpack/msgpack-perl/pull/1
 | 
				
			||||||
					mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
 | 
										mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
					if(template_callback_double(user, mem.f, obj) < 0) { goto _failed; }
 | 
										if(template_callback_double(user_, mem.f, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push; }
 | 
										goto _push; }
 | 
				
			||||||
				case CS_UINT_8:
 | 
									case CS_UINT_8:
 | 
				
			||||||
					if(template_callback_uint8(user, *(uint8_t*)n, obj) < 0) { goto _failed; }
 | 
										if(template_callback_uint8(user_, *(uint8_t*)n, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_UINT_16:
 | 
									case CS_UINT_16:
 | 
				
			||||||
					if(template_callback_uint16(user, _msgpack_load16(uint16_t,n), obj) < 0) { goto _failed; }
 | 
										if(template_callback_uint16(user_, _msgpack_load16(uint16_t,n), obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_UINT_32:
 | 
									case CS_UINT_32:
 | 
				
			||||||
					if(template_callback_uint32(user, _msgpack_load32(uint32_t,n), obj) < 0) { goto _failed; }
 | 
										if(template_callback_uint32(user_, _msgpack_load32(uint32_t,n), obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_UINT_64:
 | 
									case CS_UINT_64:
 | 
				
			||||||
					if(template_callback_uint64(user, _msgpack_load64(uint64_t,n), obj) < 0) { goto _failed; }
 | 
										if(template_callback_uint64(user_, _msgpack_load64(uint64_t,n), obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				case CS_INT_8:
 | 
									case CS_INT_8:
 | 
				
			||||||
					if(template_callback_int8(user, *(int8_t*)n, obj) < 0) { goto _failed; }
 | 
										if(template_callback_int8(user_, *(int8_t*)n, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_INT_16:
 | 
									case CS_INT_16:
 | 
				
			||||||
					if(template_callback_int16(user, _msgpack_load16(int16_t,n), obj) < 0) { goto _failed; }
 | 
										if(template_callback_int16(user_, _msgpack_load16(int16_t,n), obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_INT_32:
 | 
									case CS_INT_32:
 | 
				
			||||||
					if(template_callback_int32(user, _msgpack_load32(int32_t,n), obj) < 0) { goto _failed; }
 | 
										if(template_callback_int32(user_, _msgpack_load32(int32_t,n), obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_INT_64:
 | 
									case CS_INT_64:
 | 
				
			||||||
					if(template_callback_int64(user, _msgpack_load64(int64_t,n), obj) < 0) { goto _failed; }
 | 
										if(template_callback_int64(user_, _msgpack_load64(int64_t,n), obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				case CS_BIN_8:
 | 
									case CS_BIN_8:
 | 
				
			||||||
@@ -405,11 +404,11 @@ _fixed_trail_again:
 | 
				
			|||||||
					goto _fixed_trail_again;
 | 
										goto _fixed_trail_again;
 | 
				
			||||||
				case ACS_RAW_VALUE:
 | 
									case ACS_RAW_VALUE:
 | 
				
			||||||
_raw_zero:
 | 
					_raw_zero:
 | 
				
			||||||
					if(template_callback_raw(user, (const char*)data, (const char*)n, trail, obj) < 0) { goto _failed; }
 | 
										if(template_callback_raw(user_, (const char*)data, (const char*)n, trail, obj) < 0) { goto _failed; }
 | 
				
			||||||
					goto _push;
 | 
										goto _push;
 | 
				
			||||||
				case CS_ARRAY_16:
 | 
									case CS_ARRAY_16:
 | 
				
			||||||
					if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
										if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
				
			||||||
					if(template_callback_array(user, _msgpack_load16(uint16_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
										if(template_callback_array(user_, _msgpack_load16(uint16_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
				
			||||||
					if(_msgpack_load16(uint16_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
										if(_msgpack_load16(uint16_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
				
			||||||
					stack[top].set_ct(CT_ARRAY_ITEM);
 | 
										stack[top].set_ct(CT_ARRAY_ITEM);
 | 
				
			||||||
					stack[top].set_count(_msgpack_load16(uint16_t, n));
 | 
										stack[top].set_count(_msgpack_load16(uint16_t, n));
 | 
				
			||||||
@@ -418,7 +417,7 @@ _raw_zero:
 | 
				
			|||||||
				case CS_ARRAY_32:
 | 
									case CS_ARRAY_32:
 | 
				
			||||||
					/* FIXME security guard */
 | 
										/* FIXME security guard */
 | 
				
			||||||
					if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
										if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
				
			||||||
					if(template_callback_array(user, _msgpack_load32(uint32_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
										if(template_callback_array(user_, _msgpack_load32(uint32_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
				
			||||||
					if(_msgpack_load32(uint32_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
										if(_msgpack_load32(uint32_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
				
			||||||
					stack[top].set_ct(CT_ARRAY_ITEM);
 | 
										stack[top].set_ct(CT_ARRAY_ITEM);
 | 
				
			||||||
					stack[top].set_count(_msgpack_load32(uint32_t, n));
 | 
										stack[top].set_count(_msgpack_load32(uint32_t, n));
 | 
				
			||||||
@@ -427,7 +426,7 @@ _raw_zero:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
				case CS_MAP_16:
 | 
									case CS_MAP_16:
 | 
				
			||||||
					if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
										if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
				
			||||||
					if(template_callback_map(user, _msgpack_load16(uint16_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
										if(template_callback_map(user_, _msgpack_load16(uint16_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
				
			||||||
					if(_msgpack_load16(uint16_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
										if(_msgpack_load16(uint16_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
				
			||||||
					stack[top].set_ct(CT_MAP_KEY);
 | 
										stack[top].set_ct(CT_MAP_KEY);
 | 
				
			||||||
					stack[top].set_count(_msgpack_load16(uint16_t, n));
 | 
										stack[top].set_count(_msgpack_load16(uint16_t, n));
 | 
				
			||||||
@@ -436,7 +435,7 @@ _raw_zero:
 | 
				
			|||||||
				case CS_MAP_32:
 | 
									case CS_MAP_32:
 | 
				
			||||||
					/* FIXME security guard */
 | 
										/* FIXME security guard */
 | 
				
			||||||
					if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
										if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */
 | 
				
			||||||
					if(template_callback_map(user, _msgpack_load32(uint32_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
										if(template_callback_map(user_, _msgpack_load32(uint32_t, n), stack[top].obj()) < 0) { goto _failed; }
 | 
				
			||||||
					if(_msgpack_load32(uint32_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
										if(_msgpack_load32(uint32_t, n) == 0) { obj = stack[top].obj(); goto _push; }
 | 
				
			||||||
					stack[top].set_ct(CT_MAP_KEY);
 | 
										stack[top].set_ct(CT_MAP_KEY);
 | 
				
			||||||
					stack[top].set_count(_msgpack_load32(uint32_t, n));
 | 
										stack[top].set_count(_msgpack_load32(uint32_t, n));
 | 
				
			||||||
@@ -453,7 +452,7 @@ _push:
 | 
				
			|||||||
			c = &stack[top-1];
 | 
								c = &stack[top-1];
 | 
				
			||||||
			switch(c->ct()) {
 | 
								switch(c->ct()) {
 | 
				
			||||||
			case CT_ARRAY_ITEM:
 | 
								case CT_ARRAY_ITEM:
 | 
				
			||||||
				if(template_callback_array_item(user, c->obj(), obj) < 0) { goto _failed; }
 | 
									if(template_callback_array_item(user_, c->obj(), obj) < 0) { goto _failed; }
 | 
				
			||||||
				if(c->decl_count() == 0) {
 | 
									if(c->decl_count() == 0) {
 | 
				
			||||||
					obj = c->obj();
 | 
										obj = c->obj();
 | 
				
			||||||
					--top;
 | 
										--top;
 | 
				
			||||||
@@ -466,7 +465,7 @@ _push:
 | 
				
			|||||||
				c->set_ct(CT_MAP_VALUE);
 | 
									c->set_ct(CT_MAP_VALUE);
 | 
				
			||||||
				goto _header_again;
 | 
									goto _header_again;
 | 
				
			||||||
			case CT_MAP_VALUE:
 | 
								case CT_MAP_VALUE:
 | 
				
			||||||
				if(template_callback_map_item(user, c->obj(), c->map_key(), obj) < 0) { goto _failed; }
 | 
									if(template_callback_map_item(user_, c->obj(), c->map_key(), obj) < 0) { goto _failed; }
 | 
				
			||||||
				if(c->decl_count() == 0) {
 | 
									if(c->decl_count() == 0) {
 | 
				
			||||||
					obj = c->obj();
 | 
										obj = c->obj();
 | 
				
			||||||
					--top;
 | 
										--top;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user