Skip to content

Commit f5ea140

Browse files
committed
Update clang-format to 8.0.
GitOrigin-RevId: 170be47e4b47607a2bca81d2ed6b5b3d547982ca
1 parent 24a66bf commit f5ea140

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

‎.clang-format

+12-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AllowShortLoopsOnASingleLine: false # true
1717
AlwaysBreakAfterDefinitionReturnType: None
1818
AlwaysBreakAfterReturnType: None
1919
AlwaysBreakBeforeMultilineStrings: true
20-
AlwaysBreakTemplateDeclarations: true
20+
AlwaysBreakTemplateDeclarations: Yes
2121
BinPackArguments: true
2222
BinPackParameters: true
2323
BraceWrapping:
@@ -39,6 +39,7 @@ BraceWrapping:
3939
BreakBeforeBinaryOperators: None
4040
BreakBeforeBraces: Attach
4141
BreakBeforeInheritanceComma: true # false
42+
BreakInheritanceList: BeforeComma # BeforeColon
4243
BreakBeforeTernaryOperators: true
4344
BreakConstructorInitializersBeforeComma: true # false
4445
BreakConstructorInitializers: BeforeComma # BeforeColon
@@ -55,7 +56,9 @@ DerivePointerAlignment: true
5556
DisableFormat: false
5657
ExperimentalAutoDetectBinPacking: false
5758
FixNamespaceComments: true
58-
ForEachMacros: [ Q_FOREACH_THIS_LIST_MUST_BE_NON_EMPTY ]
59+
ForEachMacros:
60+
- Q_FOREACH_THIS_LIST_MUST_BE_NON_EMPTY
61+
IncludeBlocks: Preserve
5962
IndentCaseLabels: true
6063
IndentPPDirectives: None
6164
IndentWidth: 2
@@ -67,14 +70,16 @@ MacroBlockBegin: ''
6770
MacroBlockEnd: ''
6871
MaxEmptyLinesToKeep: 1
6972
NamespaceIndentation: None
73+
# ObjCBinPackProtocolList: Never
7074
# ObjCBlockIndentWidth: 2
7175
# ObjCSpaceAfterProperty: false
72-
# ObjCSpaceBeforeProtocolList: false
76+
# ObjCSpaceBeforeProtocolList: true
7377
PenaltyBreakAssignment: 2
7478
PenaltyBreakBeforeFirstCallParameter: 1
7579
PenaltyBreakComment: 300
7680
PenaltyBreakFirstLessLess: 120
7781
PenaltyBreakString: 1000
82+
PenaltyBreakTemplateDeclaration: 10
7883
PenaltyExcessCharacter: 1000000
7984
PenaltyReturnTypeOnItsOwnLine: 200
8085
PointerAlignment: Left
@@ -84,7 +89,11 @@ SortUsingDeclarations: false # true
8489
SpaceAfterCStyleCast: false
8590
SpaceAfterTemplateKeyword: true
8691
SpaceBeforeAssignmentOperators: true
92+
SpaceBeforeCpp11BracedList: false
93+
SpaceBeforeCtorInitializerColon: true
94+
SpaceBeforeInheritanceColon: true
8795
SpaceBeforeParens: ControlStatements
96+
SpaceBeforeRangeBasedForLoopColon: true
8897
SpaceInEmptyParentheses: false
8998
SpacesBeforeTrailingComments: 2
9099
SpacesInAngles: false

‎tddb/td/db/binlog/BinlogHelper.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515

1616
namespace td {
1717
template <class BinlogT, class StorerT>
18-
uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer,
19-
Promise<> promise = Promise<>()) {
18+
uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, Promise<> promise = Promise<>()) {
2019
auto logevent_id = binlog_ptr->next_id();
2120
binlog_ptr->add_raw_event(logevent_id, BinlogEvent::create_raw(logevent_id, type, 0, storer), std::move(promise));
2221
return logevent_id;
2322
}
2423

2524
template <class BinlogT, class StorerT>
2625
uint64 binlog_rewrite(const BinlogT &binlog_ptr, uint64 logevent_id, int32 type, const StorerT &storer,
27-
Promise<> promise = Promise<>()) {
26+
Promise<> promise = Promise<>()) {
2827
auto seq_no = binlog_ptr->next_id();
2928
binlog_ptr->add_raw_event(seq_no, BinlogEvent::create_raw(logevent_id, type, BinlogEvent::Flags::Rewrite, storer),
3029
std::move(promise));
@@ -35,7 +34,7 @@ uint64 binlog_rewrite(const BinlogT &binlog_ptr, uint64 logevent_id, int32 type,
3534

3635
template <class BinlogT>
3736
uint64 binlog_erase_impl(BinlogDebugInfo info, const BinlogT &binlog_ptr, uint64 logevent_id,
38-
Promise<> promise = Promise<>()) {
37+
Promise<> promise = Promise<>()) {
3938
auto seq_no = binlog_ptr->next_id();
4039
binlog_ptr->add_raw_event(info, seq_no,
4140
BinlogEvent::create_raw(logevent_id, BinlogEvent::ServiceTypes::Empty,

‎tdutils/td/utils/Slice.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ Slice::Slice(T s, std::enable_if_t<std::is_same<char *, std::remove_const_t<T>>:
165165
}
166166

167167
template <class T>
168-
Slice::Slice(T s, std::enable_if_t<std::is_same<const char *, std::remove_const_t<T>>::value, private_tag>)
169-
: s_(s) {
168+
Slice::Slice(T s, std::enable_if_t<std::is_same<const char *, std::remove_const_t<T>>::value, private_tag>) : s_(s) {
170169
CHECK(s_ != nullptr);
171170
len_ = std::strlen(s_);
172171
}

0 commit comments

Comments
 (0)