Răsfoiți Sursa

Fixed warnings `floating constant exceeds range of float`and `floating constant truncated to zero` (issue #483)

Benoit Blanchon 8 ani în urmă
părinte
comite
c3e1677b7d
2 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 1 0
      CHANGELOG.md
  2. 1 1
      src/ArduinoJson/TypeTraits/FloatTraits.hpp

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@ HEAD
 * Added `JsonObject::remove(iterator)`
 * Renamed `JsonArray::removeAt(size_t)` into `remove(size_t)`
 * Renamed folder `include/` to `src/`
+* Fixed warnings `floating constant exceeds range of float`and `floating constant truncated to zero` (issue #483)
 
 v5.8.4
 ------

+ 1 - 1
src/ArduinoJson/TypeTraits/FloatTraits.hpp

@@ -17,7 +17,7 @@ namespace TypeTraits {
 template <typename T, size_t = sizeof(T)>
 struct FloatTraits {};
 
-#ifndef ARDUINO_ARCH_AVR  // double is 32 bits, so 1e64 gives a warning
+#if !defined(__SIZEOF_DOUBLE__) || __SIZEOF_DOUBLE__ >= 8
 template <typename T>
 struct FloatTraits<T, 8 /*64bits*/> {
   typedef int64_t mantissa_type;