mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Remove support for naked char (was deprecated since 6.18.0)
				
					
				
			This commit is contained in:
		| @@ -9,32 +9,16 @@ | ||||
| #  define FORCE_INLINE  // __forceinline causes C4714 when returning std::string | ||||
| #  define NO_INLINE __declspec(noinline) | ||||
|  | ||||
| #  ifndef ARDUINOJSON_DEPRECATED | ||||
| #    define ARDUINOJSON_DEPRECATED(msg) __declspec(deprecated(msg)) | ||||
| #  endif | ||||
|  | ||||
| #elif defined(__GNUC__)  // GCC or Clang | ||||
|  | ||||
| #  define FORCE_INLINE __attribute__((always_inline)) | ||||
| #  define NO_INLINE __attribute__((noinline)) | ||||
|  | ||||
| #  ifndef ARDUINOJSON_DEPRECATED | ||||
| #    if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) | ||||
| #      define ARDUINOJSON_DEPRECATED(msg) __attribute__((deprecated(msg))) | ||||
| #    else | ||||
| #      define ARDUINOJSON_DEPRECATED(msg) __attribute__((deprecated)) | ||||
| #    endif | ||||
| #  endif | ||||
|  | ||||
| #else  // Other compilers | ||||
|  | ||||
| #  define FORCE_INLINE | ||||
| #  define NO_INLINE | ||||
|  | ||||
| #  ifndef ARDUINOJSON_DEPRECATED | ||||
| #    define ARDUINOJSON_DEPRECATED(msg) | ||||
| #  endif | ||||
|  | ||||
| #endif | ||||
|  | ||||
| #if __cplusplus >= 201103L | ||||
|   | ||||
| @@ -74,25 +74,6 @@ class JsonVariantConst : public VariantTag, | ||||
|     return Converter<T>::fromJson(*this); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use as<const char*>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariantconst/as/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char*>::value, const char*>::type | ||||
|   ARDUINOJSON_DEPRECATED("Replace as<char*>() with as<const char*>()") | ||||
|       as() const { | ||||
|     return as<const char*>(); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use as<int8_t>() or as<uint8_t>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariantconst/as/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char>::value, char>::type | ||||
|   ARDUINOJSON_DEPRECATED( | ||||
|       "Support for char is deprecated, use int8_t or uint8_t instead") | ||||
|       as() const { | ||||
|     return static_cast<char>(as<signed char>()); | ||||
|   } | ||||
|  | ||||
|   // Returns true if the value is of the specified type. | ||||
|   // https://arduinojson.org/v6/api/jsonvariantconst/is/ | ||||
|   template <typename T> | ||||
| @@ -103,25 +84,6 @@ class JsonVariantConst : public VariantTag, | ||||
|     return Converter<T>::checkJson(*this); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use is<const char*>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariantconst/is/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char*>::value, bool>::type | ||||
|   ARDUINOJSON_DEPRECATED("Replace is<char*>() with is<const char*>()") | ||||
|       is() const { | ||||
|     return is<const char*>(); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use is<int8_t>() or is<uint8_t>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariantconst/is/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char>::value, bool>::type | ||||
|   ARDUINOJSON_DEPRECATED( | ||||
|       "Support for char is deprecated, use int8_t or uint8_t instead") | ||||
|       is() const { | ||||
|     return is<signed char>(); | ||||
|   } | ||||
|  | ||||
|   template <typename T> | ||||
|   FORCE_INLINE operator T() const { | ||||
|     return as<T>(); | ||||
|   | ||||
| @@ -142,12 +142,6 @@ VariantRefBase<TDerived>::to() const { | ||||
|   return *this; | ||||
| } | ||||
|  | ||||
| // Out of class definition to avoid #1560 | ||||
| template <typename TDerived> | ||||
| inline bool VariantRefBase<TDerived>::set(char value) const { | ||||
|   return set(static_cast<signed char>(value)); | ||||
| } | ||||
|  | ||||
| template <typename TDerived> | ||||
| inline void convertToJson(const VariantRefBase<TDerived>& src, | ||||
|                           JsonVariant dst) { | ||||
|   | ||||
| @@ -62,25 +62,6 @@ class VariantRefBase : public VariantTag { | ||||
|     return Converter<T>::fromJson(getVariant()); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use as<const char*>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/as/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char*>::value, const char*>::type | ||||
|   ARDUINOJSON_DEPRECATED("Replace as<char*>() with as<const char*>()") | ||||
|       as() const { | ||||
|     return as<const char*>(); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use as<int8_t>() or as<uint8_t>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/as/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char>::value, char>::type | ||||
|   ARDUINOJSON_DEPRECATED( | ||||
|       "Support for char is deprecated, use int8_t or uint8_t instead") | ||||
|       as() const { | ||||
|     return static_cast<char>(as<signed char>()); | ||||
|   } | ||||
|  | ||||
|   template <typename T> | ||||
|   FORCE_INLINE operator T() const { | ||||
|     return as<T>(); | ||||
| @@ -126,25 +107,6 @@ class VariantRefBase : public VariantTag { | ||||
|     return Converter<T>::checkJson(getVariantConst()); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use is<const char*>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/is/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char*>::value, bool>::type | ||||
|   ARDUINOJSON_DEPRECATED("Replace is<char*>() with is<const char*>()") | ||||
|       is() const { | ||||
|     return is<const char*>(); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use is<int8_t>() or is<uint8_t>() instead. | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/is/ | ||||
|   template <typename T> | ||||
|   FORCE_INLINE typename enable_if<is_same<T, char>::value, bool>::type | ||||
|   ARDUINOJSON_DEPRECATED( | ||||
|       "Support for char is deprecated, use int8_t or uint8_t instead") | ||||
|       is() const { | ||||
|     return is<signed char>(); | ||||
|   } | ||||
|  | ||||
|   // Shallow copies the specified value. | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/shallowcopy/ | ||||
|   FORCE_INLINE void shallowCopy(JsonVariantConst target) { | ||||
| @@ -176,12 +138,6 @@ class VariantRefBase : public VariantTag { | ||||
|     return pool && !pool->overflowed(); | ||||
|   } | ||||
|  | ||||
|   // Deprecated: use int8_t or uint8_t instead | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/set/ | ||||
|   bool ARDUINOJSON_DEPRECATED( | ||||
|       "Support for char is deprecated, use int8_t or uint8_t instead") | ||||
|       set(char value) const; | ||||
|  | ||||
|   // Returns the size of the array or object. | ||||
|   // https://arduinojson.org/v6/api/jsonvariant/size/ | ||||
|   FORCE_INLINE size_t size() const { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user