From 63e3723eeea093d37ec05f893cb5bd23f9495341 Mon Sep 17 00:00:00 2001 From: bakinovsky-m Date: Fri, 29 May 2020 20:04:43 +0300 Subject: [PATCH] [C++] curly brace by code style --- samples/monster_generated.h | 3 +-- src/idl_gen_cpp.cpp | 3 +-- tests/arrays_test_generated.h | 6 ++---- tests/cpp17/generated_cpp17/monster_test_generated.h | 9 +++------ tests/monster_test_generated.h | 9 +++------ tests/namespace_test/namespace_test1_generated.h | 3 +-- tests/native_type_test_generated.h | 3 +-- tests/union_vector/union_vector_generated.h | 6 ++---- 8 files changed, 14 insertions(+), 28 deletions(-) diff --git a/samples/monster_generated.h b/samples/monster_generated.h index ab88a767eb2..42482f6ed42 100644 --- a/samples/monster_generated.h +++ b/samples/monster_generated.h @@ -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)), diff --git a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp index 8e26ab09354..5c69a369ed6 100644 --- a/src/idl_gen_cpp.cpp +++ b/src/idl_gen_cpp.cpp @@ -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}} }"; } } diff --git a/tests/arrays_test_generated.h b/tests/arrays_test_generated.h index 9baacfb6363..b7aae3b1eaa 100644 --- a/tests/arrays_test_generated.h +++ b/tests/arrays_test_generated.h @@ -81,8 +81,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) NestedStruct FLATBUFFERS_FINAL_CLASS { c_(), padding0__(0), padding1__(0), - d_() - { + d_() { (void)padding0__; (void)padding1__; } @@ -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__; diff --git a/tests/cpp17/generated_cpp17/monster_test_generated.h b/tests/cpp17/generated_cpp17/monster_test_generated.h index 81f2118905a..c8fbb254953 100644 --- a/tests/cpp17/generated_cpp17/monster_test_generated.h +++ b/tests/cpp17/generated_cpp17/monster_test_generated.h @@ -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) @@ -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__; @@ -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)), diff --git a/tests/monster_test_generated.h b/tests/monster_test_generated.h index d06bb8a704d..38f33eb4ce4 100644 --- a/tests/monster_test_generated.h +++ b/tests/monster_test_generated.h @@ -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) @@ -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__; @@ -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)), diff --git a/tests/namespace_test/namespace_test1_generated.h b/tests/namespace_test/namespace_test1_generated.h index 6fc00f4b2b7..f711b14e186 100644 --- a/tests/namespace_test/namespace_test1_generated.h +++ b/tests/namespace_test/namespace_test1_generated.h @@ -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)), diff --git a/tests/native_type_test_generated.h b/tests/native_type_test_generated.h index 7b96977291d..1b38724ff3a 100644 --- a/tests/native_type_test_generated.h +++ b/tests/native_type_test_generated.h @@ -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)), diff --git a/tests/union_vector/union_vector_generated.h b/tests/union_vector/union_vector_generated.h index 51e0f139c10..8ff683fcca9 100644 --- a/tests/union_vector/union_vector_generated.h +++ b/tests/union_vector/union_vector_generated.h @@ -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)) { @@ -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)) {