Changed return type of convertToJson() and Converter::toJson() to void

This commit is contained in:
Benoit Blanchon
2021-07-23 13:23:48 +02:00
parent f5c7a6478e
commit 4073b52c00
9 changed files with 54 additions and 58 deletions

View File

@@ -85,7 +85,8 @@ class VariantRef : public VariantRefBase<VariantData>,
template <typename T>
FORCE_INLINE bool set(const T &value) const {
return Converter<T>::toJson(value, *this);
Converter<T>::toJson(value, *this);
return _pool && !_pool->overflowed();
}
bool ARDUINOJSON_DEPRECATED(
@@ -94,7 +95,8 @@ class VariantRef : public VariantRefBase<VariantData>,
template <typename T>
FORCE_INLINE bool set(T *value) const {
return Converter<T *>::toJson(value, *this);
Converter<T *>::toJson(value, *this);
return _pool && !_pool->overflowed();
}
template <typename T>
@@ -339,8 +341,8 @@ class VariantConstRef : public VariantRefBase<const VariantData>,
template <>
struct Converter<VariantRef> {
static bool toJson(VariantRef src, VariantRef dst) {
return variantCopyFrom(getData(dst), getData(src), getPool(dst));
static void toJson(VariantRef src, VariantRef dst) {
variantCopyFrom(getData(dst), getData(src), getPool(dst));
}
static VariantRef fromJson(VariantRef src) {
@@ -362,8 +364,8 @@ struct Converter<VariantRef> {
template <>
struct Converter<VariantConstRef> {
static bool toJson(VariantConstRef src, VariantRef dst) {
return variantCopyFrom(getData(dst), getData(src), getPool(dst));
static void toJson(VariantConstRef src, VariantRef dst) {
variantCopyFrom(getData(dst), getData(src), getPool(dst));
}
static VariantConstRef fromJson(VariantConstRef src) {