mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	accept() ignores pointers (6796,5602)
This commit is contained in:
		| @@ -25,7 +25,7 @@ class JsonSerializer : public Visitor<size_t> { | ||||
|     VariantSlot *slot = array.head(); | ||||
|  | ||||
|     while (slot != 0) { | ||||
|       slot->data()->accept(*this); | ||||
|       slot->data()->resolve()->accept(*this); | ||||
|  | ||||
|       slot = slot->next(); | ||||
|       if (slot == 0) | ||||
| @@ -46,7 +46,7 @@ class JsonSerializer : public Visitor<size_t> { | ||||
|     while (slot != 0) { | ||||
|       _formatter.writeString(slot->key()); | ||||
|       write(':'); | ||||
|       slot->data()->accept(*this); | ||||
|       slot->data()->resolve()->accept(*this); | ||||
|  | ||||
|       slot = slot->next(); | ||||
|       if (slot == 0) | ||||
|   | ||||
| @@ -25,7 +25,7 @@ class PrettyJsonSerializer : public JsonSerializer<TWriter> { | ||||
|       _nesting++; | ||||
|       while (slot != 0) { | ||||
|         indent(); | ||||
|         slot->data()->accept(*this); | ||||
|         slot->data()->resolve()->accept(*this); | ||||
|  | ||||
|         slot = slot->next(); | ||||
|         base::write(slot ? ",\r\n" : "\r\n"); | ||||
| @@ -48,7 +48,7 @@ class PrettyJsonSerializer : public JsonSerializer<TWriter> { | ||||
|         indent(); | ||||
|         base::visitString(slot->key()); | ||||
|         base::write(": "); | ||||
|         slot->data()->accept(*this); | ||||
|         slot->data()->resolve()->accept(*this); | ||||
|  | ||||
|         slot = slot->next(); | ||||
|         base::write(slot ? ",\r\n" : "\r\n"); | ||||
|   | ||||
| @@ -56,7 +56,7 @@ class MsgPackSerializer : public Visitor<size_t> { | ||||
|       writeInteger(uint32_t(n)); | ||||
|     } | ||||
|     for (VariantSlot* slot = array.head(); slot; slot = slot->next()) { | ||||
|       slot->data()->accept(*this); | ||||
|       slot->data()->resolve()->accept(*this); | ||||
|     } | ||||
|     return bytesWritten(); | ||||
|   } | ||||
| @@ -74,7 +74,7 @@ class MsgPackSerializer : public Visitor<size_t> { | ||||
|     } | ||||
|     for (VariantSlot* slot = object.head(); slot; slot = slot->next()) { | ||||
|       visitString(slot->key()); | ||||
|       slot->data()->accept(*this); | ||||
|       slot->data()->resolve()->accept(*this); | ||||
|     } | ||||
|     return bytesWritten(); | ||||
|   } | ||||
|   | ||||
| @@ -68,10 +68,6 @@ class VariantData { | ||||
|       case VALUE_IS_BOOLEAN: | ||||
|         return visitor.visitBoolean(_content.asBoolean != 0); | ||||
|  | ||||
|       case VALUE_IS_POINTER:  // P+0 G+46 | ||||
|         ARDUINOJSON_ASSERT(_content.asPointer != 0); | ||||
|         return _content.asPointer->accept(visitor); | ||||
|  | ||||
|       default: | ||||
|         return visitor.visitNull(); | ||||
|     } | ||||
|   | ||||
| @@ -14,7 +14,7 @@ template <typename TVisitor> | ||||
| inline typename TVisitor::result_type variantAccept(const VariantData *var, | ||||
|                                                     TVisitor &visitor) { | ||||
|   if (var != 0) | ||||
|     return var->accept(visitor); | ||||
|     return var->resolve()->accept(visitor); | ||||
|   else | ||||
|     return visitor.visitNull(); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user