mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 08:48:27 +01:00
Rename Float to JsonFloat
This commit is contained in:
@@ -101,7 +101,7 @@ struct Converter<T, typename enable_if<is_floating_point<T>::value>::type>
|
||||
static void toJson(T src, VariantRef dst) {
|
||||
VariantData* data = getData(dst);
|
||||
if (data)
|
||||
data->setFloat(static_cast<Float>(src));
|
||||
data->setFloat(static_cast<JsonFloat>(src));
|
||||
}
|
||||
|
||||
static T fromJson(VariantConstRef src) {
|
||||
|
||||
@@ -52,7 +52,7 @@ struct Comparer<T, typename enable_if<is_integral<T>::value ||
|
||||
|
||||
explicit Comparer(T value) : rhs(value) {}
|
||||
|
||||
CompareResult visitFloat(Float lhs) {
|
||||
CompareResult visitFloat(JsonFloat lhs) {
|
||||
return arithmeticCompare(lhs, rhs);
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ struct VariantComparer : ComparerBase {
|
||||
return accept(comparer);
|
||||
}
|
||||
|
||||
CompareResult visitFloat(Float lhs) {
|
||||
Comparer<Float> comparer(lhs);
|
||||
CompareResult visitFloat(JsonFloat lhs) {
|
||||
Comparer<JsonFloat> comparer(lhs);
|
||||
return accept(comparer);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <stddef.h> // size_t
|
||||
|
||||
#include <ArduinoJson/Collection/CollectionData.hpp>
|
||||
#include <ArduinoJson/Numbers/Float.hpp>
|
||||
#include <ArduinoJson/Numbers/Integer.hpp>
|
||||
#include <ArduinoJson/Numbers/JsonFloat.hpp>
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
@@ -44,7 +44,7 @@ struct RawData {
|
||||
};
|
||||
|
||||
union VariantContent {
|
||||
Float asFloat;
|
||||
JsonFloat asFloat;
|
||||
bool asBoolean;
|
||||
UInt asUnsignedInteger;
|
||||
Integer asSignedInteger;
|
||||
|
||||
@@ -172,7 +172,7 @@ class VariantData {
|
||||
_content.asBoolean = value;
|
||||
}
|
||||
|
||||
void setFloat(Float value) {
|
||||
void setFloat(JsonFloat value) {
|
||||
setType(VALUE_IS_FLOAT);
|
||||
_content.asFloat = value;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Collection/CollectionData.hpp>
|
||||
#include <ArduinoJson/Numbers/Float.hpp>
|
||||
#include <ArduinoJson/Numbers/Integer.hpp>
|
||||
#include <ArduinoJson/Numbers/JsonFloat.hpp>
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
@@ -22,7 +22,7 @@ struct Visitor {
|
||||
return TResult();
|
||||
}
|
||||
|
||||
TResult visitFloat(Float) {
|
||||
TResult visitFloat(JsonFloat) {
|
||||
return TResult();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user