From f5ea140bc2ce2c27b0ab7ee851338ff97e766c1b Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 14 Oct 2018 04:01:02 +0300 Subject: [PATCH] Update clang-format to 8.0. GitOrigin-RevId: 170be47e4b47607a2bca81d2ed6b5b3d547982ca --- .clang-format | 15 ++++++++++++--- tddb/td/db/binlog/BinlogHelper.h | 7 +++---- tdutils/td/utils/Slice.h | 3 +-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.clang-format b/.clang-format index 3df452852..2f75c24a1 100644 --- a/.clang-format +++ b/.clang-format @@ -17,7 +17,7 @@ AllowShortLoopsOnASingleLine: false # true AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true -AlwaysBreakTemplateDeclarations: true +AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BraceWrapping: @@ -39,6 +39,7 @@ BraceWrapping: BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeInheritanceComma: true # false +BreakInheritanceList: BeforeComma # BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: true # false BreakConstructorInitializers: BeforeComma # BeforeColon @@ -55,7 +56,9 @@ DerivePointerAlignment: true DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true -ForEachMacros: [ Q_FOREACH_THIS_LIST_MUST_BE_NON_EMPTY ] +ForEachMacros: + - Q_FOREACH_THIS_LIST_MUST_BE_NON_EMPTY +IncludeBlocks: Preserve IndentCaseLabels: true IndentPPDirectives: None IndentWidth: 2 @@ -67,14 +70,16 @@ MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None +# ObjCBinPackProtocolList: Never # ObjCBlockIndentWidth: 2 # ObjCSpaceAfterProperty: false -# ObjCSpaceBeforeProtocolList: false +# ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left @@ -84,7 +89,11 @@ SortUsingDeclarations: false # true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 SpacesInAngles: false diff --git a/tddb/td/db/binlog/BinlogHelper.h b/tddb/td/db/binlog/BinlogHelper.h index ed9cb2988..17c7c5d64 100644 --- a/tddb/td/db/binlog/BinlogHelper.h +++ b/tddb/td/db/binlog/BinlogHelper.h @@ -15,8 +15,7 @@ namespace td { template -uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, - Promise<> promise = Promise<>()) { +uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, Promise<> promise = Promise<>()) { auto logevent_id = binlog_ptr->next_id(); binlog_ptr->add_raw_event(logevent_id, BinlogEvent::create_raw(logevent_id, type, 0, storer), std::move(promise)); return logevent_id; @@ -24,7 +23,7 @@ uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, template uint64 binlog_rewrite(const BinlogT &binlog_ptr, uint64 logevent_id, int32 type, const StorerT &storer, - Promise<> promise = Promise<>()) { + Promise<> promise = Promise<>()) { auto seq_no = binlog_ptr->next_id(); binlog_ptr->add_raw_event(seq_no, BinlogEvent::create_raw(logevent_id, type, BinlogEvent::Flags::Rewrite, storer), std::move(promise)); @@ -35,7 +34,7 @@ uint64 binlog_rewrite(const BinlogT &binlog_ptr, uint64 logevent_id, int32 type, template uint64 binlog_erase_impl(BinlogDebugInfo info, const BinlogT &binlog_ptr, uint64 logevent_id, - Promise<> promise = Promise<>()) { + Promise<> promise = Promise<>()) { auto seq_no = binlog_ptr->next_id(); binlog_ptr->add_raw_event(info, seq_no, BinlogEvent::create_raw(logevent_id, BinlogEvent::ServiceTypes::Empty, diff --git a/tdutils/td/utils/Slice.h b/tdutils/td/utils/Slice.h index c3dea9972..5b923959a 100644 --- a/tdutils/td/utils/Slice.h +++ b/tdutils/td/utils/Slice.h @@ -165,8 +165,7 @@ Slice::Slice(T s, std::enable_if_t>: } template -Slice::Slice(T s, std::enable_if_t>::value, private_tag>) - : s_(s) { +Slice::Slice(T s, std::enable_if_t>::value, private_tag>) : s_(s) { CHECK(s_ != nullptr); len_ = std::strlen(s_); }