diff --git a/third-party/ArduinoJson/extras/ci/arduino.sh b/third-party/ArduinoJson/extras/ci/arduino.sh deleted file mode 100644 index f4c168a..0000000 --- a/third-party/ArduinoJson/extras/ci/arduino.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -eux - -/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16 -sleep 3 -export DISPLAY=:1.0 - -mkdir -p /tmp/arduino -curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tar.xz | tar xJ -C /tmp/arduino --strip 1 || -curl -sS http://downloads.arduino.cc/arduino-$VERSION-linux64.tgz | tar xz -C /tmp/arduino --strip 1 -export PATH=$PATH:/tmp/arduino/ - -if [[ "$BOARD" =~ "arduino:samd:" ]]; then - arduino --install-boards arduino:samd -fi - -ln -s $PWD /tmp/arduino/libraries/ArduinoJson - -for EXAMPLE in $PWD/examples/*/*.ino; do - arduino --verify --board $BOARD $EXAMPLE -done diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/undefined.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/undefined.cpp deleted file mode 100644 index f33cc19..0000000 --- a/third-party/ArduinoJson/extras/tests/JsonArray/undefined.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#include -#include - -using namespace Catch::Matchers; - -TEST_CASE("Undefined JsonArray") { - JsonArray array; - - SECTION("SubscriptFails") { - REQUIRE(array[0].isNull()); - } - - SECTION("AddFails") { - array.add(1); - REQUIRE(0 == array.size()); - } - - SECTION("CreateNestedArrayFails") { - REQUIRE(array.createNestedArray().isNull()); - } - - SECTION("CreateNestedObjectFails") { - REQUIRE(array.createNestedObject().isNull()); - } - - SECTION("PrintToWritesBrackets") { - char buffer[32]; - serializeJson(array, buffer, sizeof(buffer)); - REQUIRE_THAT(buffer, Equals("null")); - } -} diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/undefined.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/undefined.cpp deleted file mode 100644 index 8c5fdcc..0000000 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/undefined.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#include -#include - -TEST_CASE("JsonVariant undefined") { - JsonVariant variant; - - SECTION("as()") { - SECTION("long") { - REQUIRE(variant.as() == 0); - } - - SECTION("unsigned") { - REQUIRE(variant.as() == 0); - } - - SECTION("const char*") { - REQUIRE(variant.as() == 0); - } - - SECTION("double") { - REQUIRE(variant.as() == 0); - } - - SECTION("bool") { - REQUIRE(variant.as() == false); - } - - SECTION("JsonArray") { - REQUIRE(variant.as().isNull()); - } - - SECTION("JsonObject") { - REQUIRE(variant.as().isNull()); - } - } - - SECTION("is()") { - SECTION("long") { - REQUIRE(variant.is() == false); - } - - SECTION("unsigned") { - REQUIRE(variant.is() == false); - } - - SECTION("const char*") { - REQUIRE(variant.is() == false); - } - - SECTION("double") { - REQUIRE(variant.is() == false); - } - - SECTION("bool") { - REQUIRE(variant.is() == false); - } - - SECTION("JsonArray") { - REQUIRE(variant.is() == false); - } - - SECTION("JsonObject") { - REQUIRE(variant.is() == false); - } - } - - SECTION("set()") { - SECTION("long") { - REQUIRE(variant.set(42L) == false); - } - - SECTION("unsigned") { - REQUIRE(variant.set(42U) == false); - } - - SECTION("const char*") { - REQUIRE(variant.set("42") == false); - } - - SECTION("Serialized") { - REQUIRE(variant.set(serialized("42")) == false); - } - - SECTION("double") { - REQUIRE(variant.set(42.0) == false); - } - - SECTION("bool") { - REQUIRE(variant.set(true) == false); - } - } -} diff --git a/third-party/ArduinoJson/src/ArduinoJson/Polyfills/safe_strcmp.hpp b/third-party/ArduinoJson/src/ArduinoJson/Polyfills/safe_strcmp.hpp deleted file mode 100644 index e017b5d..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Polyfills/safe_strcmp.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -#include // int8_t - -namespace ARDUINOJSON_NAMESPACE { - -inline int safe_strcmp(const char* a, const char* b) { - if (a == b) - return 0; - if (!a) - return -1; - if (!b) - return 1; - return strcmp(a, b); -} - -inline int safe_strncmp(const char* a, const char* b, size_t n) { - if (a == b) - return 0; - if (!a) - return -1; - if (!b) - return 1; - return strncmp(a, b, n); -} -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp b/third-party/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp deleted file mode 100644 index c99bc99..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include "type_traits.hpp" - -namespace ARDUINOJSON_NAMESPACE { -template -inline void swap(T& a, T& b) { - T t(a); - a = b; - b = t; -} - -#if ARDUINOJSON_HAS_RVALUE_REFERENCES -template -typename remove_reference::type&& move(T&& t) { - return static_cast::type&&>(t); -} -#else -template -T& move(T& t) { - return t; -} -#endif -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ArduinoStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ArduinoStringAdapter.hpp deleted file mode 100644 index 3d52040..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ArduinoStringAdapter.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template <> -class StringAdapter< ::String> { - public: - StringAdapter(const ::String& str) : _str(&str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str->c_str(), n); - } - - bool isNull() const { - // Arduino's String::c_str() can return NULL - return !_str->c_str(); - } - - int compare(const char* other) const { - // Arduino's String::c_str() can return NULL - const char* me = _str->c_str(); - return safe_strcmp(me, other); - } - - size_t size() const { - return _str->length(); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const ::String* _str; -}; - -template <> -class StringAdapter< ::StringSumHelper> : public StringAdapter< ::String> { - public: - StringAdapter(const ::String& s) : StringAdapter< ::String>(s) {} -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ConstRamStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ConstRamStringAdapter.hpp deleted file mode 100644 index b4a696e..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ConstRamStringAdapter.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include // size_t -#include // strcmp - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template <> -class StringAdapter { - public: - StringAdapter(const char* str = 0) : _str(str) {} - - int compare(const char* other) const { - return safe_strcmp(_str, other); - } - - bool isNull() const { - return !_str; - } - - size_t size() const { - if (!_str) - return 0; - return strlen(_str); - } - - const char* data() const { - return _str; - } - - typedef storage_policies::store_by_address storage_policy; - - protected: - const char* _str; -}; - -template -class StringAdapter : public StringAdapter { - public: - StringAdapter(const char* s) : StringAdapter(s) {} -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/FlashStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/FlashStringAdapter.hpp deleted file mode 100644 index 3a95818..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/FlashStringAdapter.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template <> -class StringAdapter { - public: - StringAdapter(const __FlashStringHelper* str) : _str(str) {} - - int compare(const char* other) const { - if (!other && !_str) - return 0; - if (!_str) - return -1; - if (!other) - return 1; - return -strcmp_P(other, reinterpret_cast(_str)); - } - - bool isNull() const { - return !_str; - } - - void copyTo(char* p, size_t n) const { - memcpy_P(p, reinterpret_cast(_str), n); - } - - size_t size() const { - if (!_str) - return 0; - return strlen_P(reinterpret_cast(_str)); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const __FlashStringHelper* _str; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/JsonStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/JsonStringAdapter.hpp deleted file mode 100644 index c34abce..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/JsonStringAdapter.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template <> -class StringAdapter : public StringAdapter { - public: - StringAdapter(const String& str) - : StringAdapter(str.c_str()), _isStatic(str.isStatic()) {} - - bool isStatic() const { - return _isStatic; - } - - typedef storage_policies::decide_at_runtime storage_policy; - - private: - bool _isStatic; -}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/RamStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/RamStringAdapter.hpp deleted file mode 100644 index f2b01d1..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/RamStringAdapter.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -class StringAdapter::value>::type> - : public StringAdapter { - public: - StringAdapter(const TChar* str) - : StringAdapter(reinterpret_cast(str)) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str, n); - } - - typedef ARDUINOJSON_NAMESPACE::storage_policies::store_by_copy storage_policy; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/SizedFlashStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/SizedFlashStringAdapter.hpp deleted file mode 100644 index b2d012f..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/SizedFlashStringAdapter.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -template <> -class StringAdapter { - public: - StringAdapter(const __FlashStringHelper* str, size_t sz) - : _str(str), _size(sz) {} - - int compare(const char* other) const { - if (!other && !_str) - return 0; - if (!_str) - return -1; - if (!other) - return 1; - return -strncmp_P(other, reinterpret_cast(_str), _size); - } - - bool isNull() const { - return !_str; - } - - void copyTo(char* p, size_t n) const { - memcpy_P(p, reinterpret_cast(_str), n); - } - - size_t size() const { - return _size; - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const __FlashStringHelper* _str; - size_t _size; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/SizedRamStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/SizedRamStringAdapter.hpp deleted file mode 100644 index a18d5ab..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/SizedRamStringAdapter.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#include // strcmp - -namespace ARDUINOJSON_NAMESPACE { - -template -class StringAdapter { - public: - StringAdapter(const char* str, size_t n) : _str(str), _size(n) {} - - int compare(const char* other) const { - return safe_strncmp(_str, other, _size); - } - - bool isNull() const { - return !_str; - } - - void copyTo(char* p, size_t n) const { - memcpy(p, _str, n); - } - - size_t size() const { - return _size; - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const char* _str; - size_t _size; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StdStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StdStringAdapter.hpp deleted file mode 100644 index 4d2d32c..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StdStringAdapter.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -class StringAdapter > { - public: - typedef std::basic_string string_type; - - StringAdapter(const string_type& str) : _str(&str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str->c_str(), n); - } - - bool isNull() const { - return false; - } - - int compare(const char* other) const { - if (!other) - return 1; - return _str->compare(other); - } - - size_t size() const { - return _str->size(); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const string_type* _str; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringViewAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringViewAdapter.hpp deleted file mode 100644 index 787f7c2..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringViewAdapter.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template <> -class StringAdapter { - public: - StringAdapter(std::string_view str) : _str(str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str.data(), n); - } - - bool isNull() const { - return false; - } - - int compare(const char* other) const { - if (!other) - return 1; - return _str.compare(other); - } - - size_t size() const { - return _str.size(); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - std::string_view _str; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/ArduinoStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/ArduinoStringAdapter.hpp deleted file mode 100644 index 3797d68..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/ArduinoStringAdapter.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class ArduinoStringAdapter { - public: - ArduinoStringAdapter(const ::String& str) : _str(&str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str->c_str(), n); - } - - bool isNull() const { - // Arduino's String::c_str() can return NULL - return !_str->c_str(); - } - - int compare(const char* other) const { - // Arduino's String::c_str() can return NULL - const char* me = _str->c_str(); - return safe_strcmp(me, other); - } - - bool equals(const char* expected) const { - return compare(expected) == 0; - } - - size_t size() const { - return _str->length(); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const ::String* _str; -}; - -template <> -struct IsString< ::String> : true_type {}; - -template <> -struct IsString< ::StringSumHelper> : true_type {}; - -inline ArduinoStringAdapter adaptString(const ::String& str) { - return ArduinoStringAdapter(str); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/ConstRamStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/ConstRamStringAdapter.hpp deleted file mode 100644 index 92298ac..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/ConstRamStringAdapter.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include // size_t -#include // strcmp - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class ConstRamStringAdapter { - public: - ConstRamStringAdapter(const char* str = 0) : _str(str) {} - - int compare(const char* other) const { - return safe_strcmp(_str, other); - } - - bool equals(const char* expected) const { - return compare(expected) == 0; - } - - bool isNull() const { - return !_str; - } - - size_t size() const { - if (!_str) - return 0; - return strlen(_str); - } - - const char* data() const { - return _str; - } - - typedef storage_policies::store_by_address storage_policy; - - protected: - const char* _str; -}; - -template <> -struct IsString : true_type {}; - -template -struct IsString : true_type {}; - -inline ConstRamStringAdapter adaptString(const char* str) { - return ConstRamStringAdapter(str); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/FlashStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/FlashStringAdapter.hpp deleted file mode 100644 index 918a535..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/FlashStringAdapter.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class FlashStringAdapter { - public: - FlashStringAdapter(const __FlashStringHelper* str) : _str(str) {} - - int compare(const char* other) const { - if (!other && !_str) - return 0; - if (!_str) - return -1; - if (!other) - return 1; - return -strcmp_P(other, reinterpret_cast(_str)); - } - - bool equals(const char* expected) const { - return compare(expected) == 0; - } - - bool isNull() const { - return !_str; - } - - void copyTo(char* p, size_t n) const { - memcpy_P(p, reinterpret_cast(_str), n); - } - - size_t size() const { - if (!_str) - return 0; - return strlen_P(reinterpret_cast(_str)); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const __FlashStringHelper* _str; -}; - -inline FlashStringAdapter adaptString(const __FlashStringHelper* str) { - return FlashStringAdapter(str); -} - -template <> -struct IsString : true_type {}; -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/IsWriteableString.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/IsWriteableString.hpp deleted file mode 100644 index 556c476..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/IsWriteableString.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include - -#if ARDUINOJSON_ENABLE_ARDUINO_STRING -# include -#endif - -#if ARDUINOJSON_ENABLE_STD_STRING -# include -#endif - -namespace ARDUINOJSON_NAMESPACE { - -template -struct IsWriteableString : false_type {}; - -#if ARDUINOJSON_ENABLE_ARDUINO_STRING - -template <> -struct IsWriteableString< ::String> : true_type {}; - -#endif - -#if ARDUINOJSON_ENABLE_STD_STRING - -template -struct IsWriteableString > - : true_type {}; - -#endif -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/RamStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/RamStringAdapter.hpp deleted file mode 100644 index eded6c9..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/RamStringAdapter.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class RamStringAdapter : public ConstRamStringAdapter { - public: - RamStringAdapter(const char* str) : ConstRamStringAdapter(str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str, n); - } - - typedef ARDUINOJSON_NAMESPACE::storage_policies::store_by_copy storage_policy; -}; - -template -inline RamStringAdapter adaptString(const TChar* str) { - return RamStringAdapter(reinterpret_cast(str)); -} - -inline RamStringAdapter adaptString(char* str) { - return RamStringAdapter(str); -} - -template -struct IsString { - static const bool value = sizeof(TChar) == 1; -}; - -template <> -struct IsString { - static const bool value = false; -}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp deleted file mode 100644 index 1055f66..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -namespace ARDUINOJSON_NAMESPACE { - -class SizedFlashStringAdapter { - public: - SizedFlashStringAdapter(const __FlashStringHelper* str, size_t sz) - : _str(str), _size(sz) {} - - int compare(const char* other) const { - if (!other && !_str) - return 0; - if (!_str) - return -1; - if (!other) - return 1; - return -strncmp_P(other, reinterpret_cast(_str), _size); - } - - bool equals(const char* expected) const { - return compare(expected) == 0; - } - - bool isNull() const { - return !_str; - } - - void copyTo(char* p, size_t n) const { - memcpy_P(p, reinterpret_cast(_str), n); - } - - size_t size() const { - return _size; - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const __FlashStringHelper* _str; - size_t _size; -}; - -inline SizedFlashStringAdapter adaptString(const __FlashStringHelper* str, - size_t sz) { - return SizedFlashStringAdapter(str, sz); -} -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/SizedRamStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/SizedRamStringAdapter.hpp deleted file mode 100644 index 62460a1..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/SizedRamStringAdapter.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#include // strcmp - -namespace ARDUINOJSON_NAMESPACE { - -class SizedRamStringAdapter { - public: - SizedRamStringAdapter(const char* str, size_t n) : _str(str), _size(n) {} - - int compare(const char* other) const { - return safe_strncmp(_str, other, _size); - } - - bool equals(const char* expected) const { - return compare(expected) == 0; - } - - bool isNull() const { - return !_str; - } - - void copyTo(char* p, size_t n) const { - memcpy(p, _str, n); - } - - size_t size() const { - return _size; - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const char* _str; - size_t _size; -}; - -template -inline SizedRamStringAdapter adaptString(const TChar* str, size_t size) { - return SizedRamStringAdapter(reinterpret_cast(str), size); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/StdStringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/StdStringAdapter.hpp deleted file mode 100644 index 3979070..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/StdStringAdapter.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -class StdStringAdapter { - public: - StdStringAdapter(const TString& str) : _str(&str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str->c_str(), n); - } - - bool isNull() const { - return false; - } - - int compare(const char* other) const { - if (!other) - return 1; - return _str->compare(other); - } - - bool equals(const char* expected) const { - if (!expected) - return false; - return *_str == expected; - } - - size_t size() const { - return _str->size(); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - const TString* _str; -}; - -template -struct IsString > : true_type { -}; - -template -inline StdStringAdapter > -adaptString(const std::basic_string& str) { - return StdStringAdapter >( - str); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/StringAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/StringAdapter.hpp deleted file mode 100644 index 1d55b21..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/StringAdapter.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include - -namespace ARDUINOJSON_NAMESPACE { - -template -class StringAdapter; - -template -inline StringAdapter adaptString(const T& str) { - return StringAdapter(str); -} - -template -inline StringAdapter adaptString(const T& str, size_t sz) { - return StringAdapter(str, sz); -} - -template -struct IsString : false_type {}; - -template -struct IsString< - T, typename make_void::storage_policy>::type> - : true_type {}; - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/ArduinoJson/src/ArduinoJson/Strings/StringViewAdapter.hpp b/third-party/ArduinoJson/src/ArduinoJson/Strings/StringViewAdapter.hpp deleted file mode 100644 index 4720660..0000000 --- a/third-party/ArduinoJson/src/ArduinoJson/Strings/StringViewAdapter.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// ArduinoJson - https://arduinojson.org -// Copyright Benoit Blanchon 2014-2021 -// MIT License - -#pragma once - -#include -#include -#include - -#include - -namespace ARDUINOJSON_NAMESPACE { - -class StringViewAdapter { - public: - StringViewAdapter(std::string_view str) : _str(str) {} - - void copyTo(char* p, size_t n) const { - memcpy(p, _str.data(), n); - } - - bool isNull() const { - return false; - } - - int compare(const char* other) const { - if (!other) - return 1; - return _str.compare(other); - } - - bool equals(const char* expected) const { - if (!expected) - return false; - return _str == expected; - } - - size_t size() const { - return _str.size(); - } - - typedef storage_policies::store_by_copy storage_policy; - - private: - std::string_view _str; -}; - -template <> -struct IsString : true_type {}; - -inline StringViewAdapter adaptString(const std::string_view& str) { - return StringViewAdapter(str); -} - -} // namespace ARDUINOJSON_NAMESPACE diff --git a/third-party/Synth_Dexed/src/compressor.h b/third-party/Synth_Dexed/src/compressor.h index 22331eb..396d416 100644 --- a/third-party/Synth_Dexed/src/compressor.h +++ b/third-party/Synth_Dexed/src/compressor.h @@ -87,7 +87,8 @@ class Compressor arm_scale_f32(audio_block, pre_gain, audio_block, len); //use ARM DSP for speed! //calculate the level of the audio (ie, calculate a smoothed version of the signal power) - float32_t* audio_level_dB_block = (float32_t*)malloc(sizeof(float32_t)*len); + //float32_t* audio_level_dB_block = (float32_t*)malloc(sizeof(float32_t)*len); + float32_t* audio_level_dB_block = new float32_t[len]; if(!audio_level_dB_block) { printf("Cannot allocate memory for \"audio_level_dB_block\" - stopping\n"); @@ -100,7 +101,8 @@ class Compressor calcAudioLevel_dB(audio_block, audio_level_dB_block, len); //returns through audio_level_dB_block //compute the desired gain based on the observed audio level - float32_t* gain_block=(float32_t*)malloc(sizeof(float32_t)*len); + //float32_t* gain_block=(float32_t*)malloc(sizeof(float32_t)*len); + float32_t* gain_block=new float32_t[len]; if(!gain_block) { printf("Cannot allocate memory for \"gain_block\" - stopping\n"); @@ -130,7 +132,8 @@ class Compressor void calcAudioLevel_dB(float32_t *wav_block, float32_t *level_dB_block, uint16_t len) { // calculate the instantaneous signal power (square the signal) - float32_t* wav_pow_block=(float32_t*)malloc(sizeof(float32_t)*len); + //float32_t* wav_pow_block=(float32_t*)malloc(sizeof(float32_t)*len); + float32_t* wav_pow_block=new float32_t[len]; if(!wav_pow_block) { printf("Cannot allocate memory for \"wav_pow_block\" - stopping\n"); @@ -172,7 +175,8 @@ class Compressor void calcGain(float32_t *audio_level_dB_block, float32_t *gain_block,uint16_t len) { //first, calculate the instantaneous target gain based on the compression ratio - float32_t* inst_targ_gain_dB_block=(float32_t*)malloc(sizeof(float32_t)*len); + //float32_t* inst_targ_gain_dB_block=(float32_t*)malloc(sizeof(float32_t)*len); + float32_t* inst_targ_gain_dB_block=new float32_t[len]; if(!inst_targ_gain_dB_block) { printf("Cannot allocate memory for \"inst_targ_gain_dB_block\" - stopping\n"); @@ -183,7 +187,8 @@ class Compressor calcInstantaneousTargetGain(audio_level_dB_block, inst_targ_gain_dB_block,len); //second, smooth in time (attack and release) by stepping through each sample - float32_t *gain_dB_block = (float32_t*)malloc(sizeof(float32_t)*len); + //float32_t *gain_dB_block = (float32_t*)malloc(sizeof(float32_t)*len); + float32_t *gain_dB_block = new float32_t[len]; if(!gain_dB_block) { printf("Cannot allocate memory for \"gain_dB_block\" - stopping\n"); @@ -212,7 +217,8 @@ class Compressor void calcInstantaneousTargetGain(float32_t *audio_level_dB_block, float32_t *inst_targ_gain_dB_block, uint16_t len) { // how much are we above the compression threshold? - float32_t* above_thresh_dB_block=(float32_t*)malloc(sizeof(float32_t)*len); + //float32_t* above_thresh_dB_block=(float32_t*)malloc(sizeof(float32_t)*len); + float32_t* above_thresh_dB_block=new float32_t[len]; if(!above_thresh_dB_block) { printf("Cannot allocate memory for \"above_thresh_dB_block\" - stopping\n");