Skip to content

Commit c6c0649

Browse files
committed
Replace typedef with using
1 parent 61ec2c4 commit c6c0649

30 files changed

+54
-54
lines changed

extras/tests/JsonDocument/ElementProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "Literals.hpp"
99

10-
typedef ArduinoJson::detail::ElementProxy<JsonDocument&> ElementProxy;
10+
using ElementProxy = ArduinoJson::detail::ElementProxy<JsonDocument&>;
1111

1212
TEST_CASE("ElementProxy::add()") {
1313
JsonDocument doc;

extras/tests/JsonDocument/MemberProxy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
using ArduinoJson::detail::sizeofArray;
1515
using ArduinoJson::detail::sizeofObject;
1616

17-
typedef ArduinoJson::detail::MemberProxy<JsonDocument&, const char*>
18-
MemberProxy;
17+
using MemberProxy =
18+
ArduinoJson::detail::MemberProxy<JsonDocument&, const char*>;
1919

2020
TEST_CASE("MemberProxy::add()") {
2121
JsonDocument doc;

extras/tests/JsonVariant/stl_containers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ TEST_CASE("vector<int>") {
9999
}
100100

101101
TEST_CASE("array<int, 2>") {
102-
typedef std::array<int, 2> array_type;
102+
using array_type = std::array<int, 2>;
103103

104104
SECTION("toJson") {
105105
array_type v;

extras/tests/Misc/custom_string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
struct custom_char_traits : std::char_traits<char> {};
1010

11-
typedef std::basic_string<char, custom_char_traits> custom_string;
11+
using custom_string = std::basic_string<char, custom_char_traits>;

src/ArduinoJson/Array/JsonArray.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class JsonArray : public detail::VariantOperators<JsonArray> {
1717
friend class detail::VariantAttorney;
1818

1919
public:
20-
typedef JsonArrayIterator iterator;
20+
using iterator = JsonArrayIterator;
2121

2222
// Constructs an unbound reference.
2323
JsonArray() : data_(0), resources_(0) {}

src/ArduinoJson/Array/JsonArrayConst.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class JsonArrayConst : public detail::VariantOperators<JsonArrayConst> {
1919
friend class detail::VariantAttorney;
2020

2121
public:
22-
typedef JsonArrayConstIterator iterator;
22+
using iterator = JsonArrayConstIterator;
2323

2424
// Returns an iterator to the first element of the array.
2525
// https://arduinojson.org/v7/api/jsonarrayconst/begin/

src/ArduinoJson/Json/PrettyJsonSerializer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1313

1414
template <typename TWriter>
1515
class PrettyJsonSerializer : public JsonSerializer<TWriter> {
16-
typedef JsonSerializer<TWriter> base;
16+
using base = JsonSerializer<TWriter>;
1717

1818
public:
1919
PrettyJsonSerializer(TWriter writer, const ResourceManager* resources)

src/ArduinoJson/Json/TextFormatter.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class TextFormatter {
105105

106106
template <typename T>
107107
enable_if_t<is_signed<T>::value> writeInteger(T value) {
108-
typedef make_unsigned_t<T> unsigned_type;
108+
using unsigned_type = make_unsigned_t<T>;
109109
unsigned_type unsigned_value;
110110
if (value < 0) {
111111
writeRaw('-');

src/ArduinoJson/Numbers/FloatParts.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct FloatParts {
2020

2121
template <typename TFloat>
2222
inline int16_t normalize(TFloat& value) {
23-
typedef FloatTraits<TFloat> traits;
23+
using traits = FloatTraits<TFloat>;
2424
int16_t powersOf10 = 0;
2525

2626
int8_t index = sizeof(TFloat) == 8 ? 8 : 5;

src/ArduinoJson/Numbers/FloatTraits.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ struct FloatTraits {};
2121

2222
template <typename T>
2323
struct FloatTraits<T, 8 /*64bits*/> {
24-
typedef uint64_t mantissa_type;
24+
using mantissa_type = uint64_t;
2525
static const short mantissa_bits = 52;
2626
static const mantissa_type mantissa_max =
2727
(mantissa_type(1) << mantissa_bits) - 1;
2828

29-
typedef int16_t exponent_type;
29+
using exponent_type = int16_t;
3030
static const exponent_type exponent_max = 308;
3131

3232
static pgm_ptr<T> positiveBinaryPowersOfTen() {
@@ -105,12 +105,12 @@ struct FloatTraits<T, 8 /*64bits*/> {
105105

106106
template <typename T>
107107
struct FloatTraits<T, 4 /*32bits*/> {
108-
typedef uint32_t mantissa_type;
108+
using mantissa_type = uint32_t;
109109
static const short mantissa_bits = 23;
110110
static const mantissa_type mantissa_max =
111111
(mantissa_type(1) << mantissa_bits) - 1;
112112

113-
typedef int8_t exponent_type;
113+
using exponent_type = int8_t;
114114
static const exponent_type exponent_max = 38;
115115

116116
static pgm_ptr<T> positiveBinaryPowersOfTen() {

0 commit comments

Comments
 (0)