Skip to content

Commit 33a4773

Browse files
committed
Set clang-format standard to C++11 (#1820)
1 parent daa87e1 commit 33a4773

File tree

16 files changed

+32
-32
lines changed

16 files changed

+32
-32
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
22

33
BasedOnStyle: Google
4-
Standard: Cpp03
4+
Standard: c++11
55
AllowShortFunctionsOnASingleLine: Empty
66
IncludeBlocks: Preserve
77
IndentPPDirectives: AfterHash

extras/tests/JsonVariant/stl_containers.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace ArduinoJson {
1414
template <typename T>
15-
struct Converter<std::vector<T> > {
15+
struct Converter<std::vector<T>> {
1616
static void toJson(const std::vector<T>& src, JsonVariant dst) {
1717
JsonArray array = dst.to<JsonArray>();
1818
for (T item : src)
@@ -36,7 +36,7 @@ struct Converter<std::vector<T> > {
3636
};
3737

3838
template <typename T, size_t N>
39-
struct Converter<std::array<T, N> > {
39+
struct Converter<std::array<T, N>> {
4040
static void toJson(const std::array<T, N>& src, JsonVariant dst) {
4141
JsonArray array = dst.to<JsonArray>();
4242
for (T item : src)
@@ -79,22 +79,22 @@ TEST_CASE("vector<int>") {
7979
doc.add(1);
8080
doc.add(2);
8181

82-
auto v = doc.as<std::vector<int> >();
82+
auto v = doc.as<std::vector<int>>();
8383
REQUIRE(v.size() == 2);
8484
CHECK(v[0] == 1);
8585
CHECK(v[1] == 2);
8686
}
8787

8888
SECTION("checkJson") {
8989
StaticJsonDocument<128> doc;
90-
CHECK(doc.is<std::vector<int> >() == false);
90+
CHECK(doc.is<std::vector<int>>() == false);
9191

9292
doc.add(1);
9393
doc.add(2);
94-
CHECK(doc.is<std::vector<int> >() == true);
94+
CHECK(doc.is<std::vector<int>>() == true);
9595

9696
doc.add("foo");
97-
CHECK(doc.is<std::vector<int> >() == false);
97+
CHECK(doc.is<std::vector<int>>() == false);
9898
}
9999
}
100100

extras/tests/Misc/StringAdapters.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ struct EmptyStruct {};
9191

9292
TEST_CASE("IsString<T>") {
9393
CHECK(IsString<std::string>::value == true);
94-
CHECK(IsString<std::basic_string<wchar_t> >::value == false);
94+
CHECK(IsString<std::basic_string<wchar_t>>::value == false);
9595
CHECK(IsString<custom_string>::value == true);
9696
CHECK(IsString<const __FlashStringHelper*>::value == true);
9797
CHECK(IsString<const char*>::value == true);
9898
CHECK(IsString<const char[8]>::value == true);
99-
CHECK(IsString< ::String>::value == true);
100-
CHECK(IsString< ::StringSumHelper>::value == true);
99+
CHECK(IsString<::String>::value == true);
100+
CHECK(IsString<::StringSumHelper>::value == true);
101101
CHECK(IsString<const EmptyStruct*>::value == false);
102102
}
103103

extras/tests/Misc/StringWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ TEST_CASE("Writer<std::string>") {
6565

6666
TEST_CASE("Writer<String>") {
6767
::String output;
68-
Writer< ::String> writer(output);
68+
Writer<::String> writer(output);
6969

7070
SECTION("write(char)") {
7171
SECTION("writes to temporary buffer") {

extras/tests/TextFormatter/writeFloat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ template <typename TFloat>
1717
void check(TFloat input, const std::string& expected) {
1818
std::string output;
1919
Writer<std::string> sb(output);
20-
TextFormatter<Writer<std::string> > writer(sb);
20+
TextFormatter<Writer<std::string>> writer(sb);
2121
writer.writeFloat(input);
2222
REQUIRE(writer.bytesWritten() == output.size());
2323
CHECK(expected == output);

src/ArduinoJson/Array/ElementProxy.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1111
// A proxy class to get or set an element of an array.
1212
// https://arduinojson.org/v6/api/jsonarray/subscript/
1313
template <typename TUpstream>
14-
class ElementProxy : public VariantRefBase<ElementProxy<TUpstream> >,
15-
public VariantOperators<ElementProxy<TUpstream> > {
14+
class ElementProxy : public VariantRefBase<ElementProxy<TUpstream>>,
15+
public VariantOperators<ElementProxy<TUpstream>> {
1616
friend class VariantAttorney;
1717

1818
public:

src/ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp

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

1111
template <typename TSource>
1212
struct Reader<TSource,
13-
typename enable_if<is_base_of< ::String, TSource>::value>::type>
13+
typename enable_if<is_base_of<::String, TSource>::value>::type>
1414
: BoundedReader<const char*> {
1515
explicit Reader(const ::String& s)
1616
: BoundedReader<const char*>(s.c_str(), s.length()) {}

src/ArduinoJson/Document/JsonDocument.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
173173
template <typename TString>
174174
FORCE_INLINE typename detail::enable_if<
175175
detail::IsString<TString>::value,
176-
detail::MemberProxy<JsonDocument&, TString> >::type
176+
detail::MemberProxy<JsonDocument&, TString>>::type
177177
operator[](const TString& key) {
178178
return {*this, key};
179179
}
@@ -183,7 +183,7 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
183183
template <typename TChar>
184184
FORCE_INLINE typename detail::enable_if<
185185
detail::IsString<TChar*>::value,
186-
detail::MemberProxy<JsonDocument&, TChar*> >::type
186+
detail::MemberProxy<JsonDocument&, TChar*>>::type
187187
operator[](TChar* key) {
188188
return {*this, key};
189189
}

src/ArduinoJson/Object/JsonObject.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ class JsonObject : public detail::VariantOperators<JsonObject> {
108108
// Gets or sets the member with specified key.
109109
// https://arduinojson.org/v6/api/jsonobject/subscript/
110110
template <typename TString>
111-
FORCE_INLINE typename detail::enable_if<
112-
detail::IsString<TString>::value,
113-
detail::MemberProxy<JsonObject, TString> >::type
114-
operator[](const TString& key) const {
111+
FORCE_INLINE
112+
typename detail::enable_if<detail::IsString<TString>::value,
113+
detail::MemberProxy<JsonObject, TString>>::type
114+
operator[](const TString& key) const {
115115
return {*this, key};
116116
}
117117

@@ -120,7 +120,7 @@ class JsonObject : public detail::VariantOperators<JsonObject> {
120120
template <typename TChar>
121121
FORCE_INLINE
122122
typename detail::enable_if<detail::IsString<TChar*>::value,
123-
detail::MemberProxy<JsonObject, TChar*> >::type
123+
detail::MemberProxy<JsonObject, TChar*>>::type
124124
operator[](TChar* key) const {
125125
return {*this, key};
126126
}

src/ArduinoJson/Object/JsonObjectImpl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ VariantRefBase<TDerived>::containsKey(TChar* key) const {
6969
template <typename TDerived>
7070
template <typename TString>
7171
inline typename enable_if<IsString<TString*>::value,
72-
MemberProxy<TDerived, TString*> >::type
72+
MemberProxy<TDerived, TString*>>::type
7373
VariantRefBase<TDerived>::operator[](TString* key) const {
7474
return MemberProxy<TDerived, TString*>(derived(), key);
7575
}
7676

7777
template <typename TDerived>
7878
template <typename TString>
7979
inline typename enable_if<IsString<TString>::value,
80-
MemberProxy<TDerived, TString> >::type
80+
MemberProxy<TDerived, TString>>::type
8181
VariantRefBase<TDerived>::operator[](const TString& key) const {
8282
return MemberProxy<TDerived, TString>(derived(), key);
8383
}

0 commit comments

Comments
 (0)