Skip to content

Commit a90986b

Browse files
author
Michael Penick
committed
Manual formatting fixes before clang-format
1 parent 0c8d1eb commit a90986b

4 files changed

Lines changed: 29 additions & 52 deletions

File tree

cpp-driver/src/.clang-format

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,27 @@
11
---
2+
BasedOnStyle: LLVM
23
Language: Cpp
34
AccessModifierOffset: -2
4-
AlignEscapedNewlinesLeft: true
5-
AlignTrailingComments: true
6-
AllowAllParametersOfDeclarationOnNextLine: true
7-
AllowShortBlocksOnASingleLine: false
8-
AllowShortIfStatementsOnASingleLine: true
9-
AllowShortLoopsOnASingleLine: true
10-
AllowShortFunctionsOnASingleLine: Inline
11-
AlwaysBreakTemplateDeclarations: true
12-
AlwaysBreakBeforeMultilineStrings: true
13-
BreakBeforeBinaryOperators: false
14-
BreakBeforeTernaryOperators: true
15-
BreakConstructorInitializersBeforeComma: true
16-
BinPackParameters: true
17-
ColumnLimit: 80
18-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
19-
ConstructorInitializerIndentWidth: 4
20-
DerivePointerBinding: true
21-
ExperimentalAutoDetectBinPacking: false
22-
IndentCaseLabels: true
23-
MaxEmptyLinesToKeep: 1
24-
KeepEmptyLinesAtTheStartOfBlocks: true
25-
NamespaceIndentation: None
26-
ObjCSpaceAfterProperty: false
27-
ObjCSpaceBeforeProtocolList: false
28-
PenaltyBreakBeforeFirstCallParameter: 1
29-
PenaltyBreakComment: 300
30-
PenaltyBreakString: 1000
31-
PenaltyBreakFirstLessLess: 120
32-
PenaltyExcessCharacter: 1000000
33-
PenaltyReturnTypeOnItsOwnLine: 200
34-
PointerBindsToType: true
35-
SpacesBeforeTrailingComments: 1
36-
Cpp11BracedListStyle: true
37-
Standard: Auto
385
IndentWidth: 2
396
TabWidth: 8
7+
ColumnLimit: 100
408
UseTab: Never
41-
BreakBeforeBraces: Attach
42-
IndentFunctionDeclarationAfterType: true
43-
SpacesInParentheses: false
44-
SpacesInAngles: false
45-
SpaceInEmptyParentheses: false
46-
SpacesInCStyleCastParentheses: false
9+
IndentCaseLabels: true
10+
AlignAfterOpenBracket: true
11+
AlignEscapedNewlines: Left
12+
BreakConstructorInitializers: BeforeComma
13+
AllowShortBlocksOnASingleLine: false
14+
DerivePointerAlignment: false
15+
PointerAlignment: Left
16+
BinPackParameters: true
17+
BinPackArguments: true
18+
AllowShortIfStatementsOnASingleLine: true
19+
CompactNamespaces: true
20+
AlignOperands: true
4721
SpacesInContainerLiterals: true
48-
SpaceBeforeAssignmentOperators: true
49-
ContinuationIndentWidth: 4
50-
CommentPragmas: '^ IWYU pragma:'
51-
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
52-
SpaceBeforeParens: ControlStatements
53-
DisableFormat: false
22+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
23+
Cpp11BracedListStyle: false
24+
AlwaysBreakTemplateDeclarations: true
25+
BreakBeforeInheritanceComma: true
5426
...
5527

cpp-driver/src/json.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ class Allocator {
7171
}
7272
};
7373

74-
typedef datastax::rapidjson::GenericDocument<datastax::rapidjson::UTF8<>, datastax::rapidjson::MemoryPoolAllocator<json::Allocator>, json::Allocator> Document;
75-
typedef datastax::rapidjson::GenericValue<datastax::rapidjson::UTF8<>, datastax::rapidjson::MemoryPoolAllocator<json::Allocator> > Value;
76-
typedef datastax::rapidjson::GenericStringBuffer<datastax::rapidjson::UTF8<>, json::Allocator> StringBuffer;
74+
typedef datastax::rapidjson::UTF8<> UTF8;
75+
typedef datastax::rapidjson::MemoryPoolAllocator<json::Allocator> MemoryPoolAllocator;
7776

78-
template<typename OutputStream, typename SourceEncoding = datastax::rapidjson::UTF8<>, typename TargetEncoding = datastax::rapidjson::UTF8<>, typename StackAllocator = json::Allocator, unsigned writeFlags = datastax::rapidjson::kWriteDefaultFlags>
77+
typedef datastax::rapidjson::GenericDocument<UTF8, MemoryPoolAllocator, json::Allocator> Document;
78+
typedef datastax::rapidjson::GenericValue<UTF8, MemoryPoolAllocator > Value;
79+
typedef datastax::rapidjson::GenericStringBuffer<UTF8, json::Allocator> StringBuffer;
80+
81+
template<typename OutputStream, typename SourceEncoding = UTF8, typename TargetEncoding = UTF8, typename StackAllocator = json::Allocator, unsigned writeFlags = datastax::rapidjson::kWriteDefaultFlags>
7982
class Writer : public datastax::rapidjson::JSON_WRITE_TYPE<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
8083
public:
8184
typedef datastax::rapidjson::JSON_WRITE_TYPE<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Type;

cpp-driver/src/utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ void thread_yield() {
197197
#endif
198198
}
199199

200-
// Code was taken from MSDN documentation
201-
// see https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code
200+
// Code was taken from MSDN documentation see:
201+
// https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code
202202
#if defined(_MSC_VER) && defined(_DEBUG)
203203
const DWORD MS_VC_EXCEPTION = 0x406D1388;
204204
#pragma pack(push,8)

cpp-driver/src/uuids.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ CassError cass_uuid_from_string_n(const char* str,
124124
const char* pos = str;
125125
char buf[16];
126126

127+
// clang-format off
127128
static const signed char hex_to_half_byte[256] = {
128129
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
129130
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -142,6 +143,7 @@ CassError cass_uuid_from_string_n(const char* str,
142143
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
143144
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
144145
};
146+
// clang-format on
145147

146148
if (str == NULL || str_length != 36) {
147149
return CASS_ERROR_LIB_BAD_PARAMS;

0 commit comments

Comments
 (0)