aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2018-10-14 04:01:02 +0300
committerlevlam <levlam@telegram.org>2018-10-14 04:01:02 +0300
commitf5ea140bc2ce2c27b0ab7ee851338ff97e766c1b (patch)
treed340ed452635effe2c54c18c43bd4fc0939466f7
parent24a66bf9e7d5169d445668561ebf902742603abd (diff)
Update clang-format to 8.0.
GitOrigin-RevId: 170be47e4b47607a2bca81d2ed6b5b3d547982ca
-rw-r--r--.clang-format15
-rw-r--r--tddb/td/db/binlog/BinlogHelper.h7
-rw-r--r--tdutils/td/utils/Slice.h3
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 <class BinlogT, class StorerT>
-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 <class BinlogT, class StorerT>
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 <class BinlogT>
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<std::is_same<char *, std::remove_const_t<T>>:
}
template <class T>
-Slice::Slice(T s, std::enable_if_t<std::is_same<const char *, std::remove_const_t<T>>::value, private_tag>)
- : s_(s) {
+Slice::Slice(T s, std::enable_if_t<std::is_same<const char *, std::remove_const_t<T>>::value, private_tag>) : s_(s) {
CHECK(s_ != nullptr);
len_ = std::strlen(s_);
}