Skip to content

Commit

Permalink
[C++] curly brace by code style
Browse files Browse the repository at this point in the history
  • Loading branch information
bakinovsky-m committed May 29, 2020
1 parent d23de8e commit 63e3723
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 28 deletions.
3 changes: 1 addition & 2 deletions samples/monster_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Vec3 FLATBUFFERS_FINAL_CLASS {
Vec3()
: x_(0),
y_(0),
z_(0)
{
z_(0) {
}
Vec3(float _x, float _y, float _z)
: x_(flatbuffers::EndianScalar(_x)),
Expand Down
3 changes: 1 addition & 2 deletions src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2894,8 +2894,7 @@ class CppGenerator : public BaseGenerator {
code_.SetValue("INIT_LIST", init_list);
code_.SetValue("DEFAULT_CONSTRUCTOR_BODY", body);
code_ += " {{STRUCT_NAME}}()";
code_ += " : {{INIT_LIST}}";
code_ += " {";
code_ += " : {{INIT_LIST}} {";
code_ += "{{DEFAULT_CONSTRUCTOR_BODY}} }";
}
}
Expand Down
6 changes: 2 additions & 4 deletions tests/arrays_test_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) NestedStruct FLATBUFFERS_FINAL_CLASS {
c_(),
padding0__(0),
padding1__(0),
d_()
{
d_() {
(void)padding0__;
(void)padding1__;
}
Expand Down Expand Up @@ -159,8 +158,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) ArrayStruct FLATBUFFERS_FINAL_CLASS {
d_(),
e_(0),
padding3__(0),
f_()
{
f_() {
(void)padding0__;
(void)padding1__;
(void)padding2__;
Expand Down
9 changes: 3 additions & 6 deletions tests/cpp17/generated_cpp17/monster_test_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) Test FLATBUFFERS_FINAL_CLASS {
Test()
: a_(0),
b_(0),
padding0__(0)
{
padding0__(0) {
(void)padding0__;
}
Test(int16_t _a, int8_t _b)
Expand Down Expand Up @@ -529,8 +528,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Vec3 FLATBUFFERS_FINAL_CLASS {
test2_(0),
padding1__(0),
test3_(),
padding2__(0)
{
padding2__(0) {
(void)padding0__;
(void)padding1__;
(void)padding2__;
Expand Down Expand Up @@ -596,8 +594,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Ability FLATBUFFERS_FINAL_CLASS {
}
Ability()
: id_(0),
distance_(0)
{
distance_(0) {
}
Ability(uint32_t _id, uint32_t _distance)
: id_(flatbuffers::EndianScalar(_id)),
Expand Down
9 changes: 3 additions & 6 deletions tests/monster_test_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) Test FLATBUFFERS_FINAL_CLASS {
Test()
: a_(0),
b_(0),
padding0__(0)
{
padding0__(0) {
(void)padding0__;
}
Test(int16_t _a, int8_t _b)
Expand Down Expand Up @@ -655,8 +654,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Vec3 FLATBUFFERS_FINAL_CLASS {
test2_(0),
padding1__(0),
test3_(),
padding2__(0)
{
padding2__(0) {
(void)padding0__;
(void)padding1__;
(void)padding2__;
Expand Down Expand Up @@ -737,8 +735,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Ability FLATBUFFERS_FINAL_CLASS {
}
Ability()
: id_(0),
distance_(0)
{
distance_(0) {
}
Ability(uint32_t _id, uint32_t _distance)
: id_(flatbuffers::EndianScalar(_id)),
Expand Down
3 changes: 1 addition & 2 deletions tests/namespace_test/namespace_test1_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS
}
StructInNestedNS()
: a_(0),
b_(0)
{
b_(0) {
}
StructInNestedNS(int32_t _a, int32_t _b)
: a_(flatbuffers::EndianScalar(_a)),
Expand Down
3 changes: 1 addition & 2 deletions tests/native_type_test_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Vector3D FLATBUFFERS_FINAL_CLASS {
Vector3D()
: x_(0),
y_(0),
z_(0)
{
z_(0) {
}
Vector3D(float _x, float _y, float _z)
: x_(flatbuffers::EndianScalar(_x)),
Expand Down
6 changes: 2 additions & 4 deletions tests/union_vector/union_vector_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Rapunzel FLATBUFFERS_FINAL_CLASS {
return RapunzelTypeTable();
}
Rapunzel()
: hair_length_(0)
{
: hair_length_(0) {
}
Rapunzel(int32_t _hair_length)
: hair_length_(flatbuffers::EndianScalar(_hair_length)) {
Expand Down Expand Up @@ -237,8 +236,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) BookReader FLATBUFFERS_FINAL_CLASS {
return BookReaderTypeTable();
}
BookReader()
: books_read_(0)
{
: books_read_(0) {
}
BookReader(int32_t _books_read)
: books_read_(flatbuffers::EndianScalar(_books_read)) {
Expand Down

0 comments on commit 63e3723

Please sign in to comment.