Skip to content

Commit 0cf3364

Browse files
committed
更好的格式与更快的匹配的一部分
1 parent 133c64a commit 0cf3364

File tree

8 files changed

+68412
-345
lines changed

8 files changed

+68412
-345
lines changed

.clang-format

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
---
2-
Language: Cpp
3-
BasedOnStyle: LLVM
2+
Language: Cpp
3+
BasedOnStyle: LLVM
44
AccessModifierOffset: -2
55
AlignAfterOpenBracket: Align
66
AlignArrayOfStructures: None
77
AlignConsecutiveAssignments:
8-
Enabled: false
8+
Enabled: false
99
AcrossEmptyLines: false
10-
AcrossComments: false
11-
AlignCompound: false
10+
AcrossComments: false
11+
AlignCompound: false
1212
AlignFunctionPointers: false
13-
PadOperators: true
13+
PadOperators: true
1414
AlignConsecutiveBitFields:
15-
Enabled: false
15+
Enabled: false
1616
AcrossEmptyLines: false
17-
AcrossComments: false
18-
AlignCompound: false
17+
AcrossComments: false
18+
AlignCompound: false
1919
AlignFunctionPointers: false
20-
PadOperators: false
20+
PadOperators: false
2121
AlignConsecutiveDeclarations:
22-
Enabled: false
22+
Enabled: false
2323
AcrossEmptyLines: false
24-
AcrossComments: false
25-
AlignCompound: false
24+
AcrossComments: false
25+
AlignCompound: false
2626
AlignFunctionPointers: false
27-
PadOperators: false
27+
PadOperators: false
2828
AlignConsecutiveMacros:
29-
Enabled: false
29+
Enabled: false
3030
AcrossEmptyLines: false
31-
AcrossComments: false
32-
AlignCompound: false
31+
AcrossComments: false
32+
AlignCompound: false
3333
AlignFunctionPointers: false
34-
PadOperators: false
34+
PadOperators: false
3535
AlignConsecutiveShortCaseStatements:
36-
Enabled: false
36+
Enabled: false
3737
AcrossEmptyLines: false
38-
AcrossComments: false
38+
AcrossComments: false
3939
AlignCaseColons: false
4040
AlignEscapedNewlines: Right
41-
AlignOperands: Align
41+
AlignOperands: Align
4242
AlignTrailingComments:
43-
Kind: Always
44-
OverEmptyLines: 0
43+
Kind: Always
44+
OverEmptyLines: 0
4545
AllowAllArgumentsOnNextLine: true
4646
AllowAllParametersOfDeclarationOnNextLine: true
4747
AllowBreakBeforeNoexceptSpecifier: Never
@@ -63,28 +63,28 @@ BinPackArguments: true
6363
BinPackParameters: true
6464
BitFieldColonSpacing: Both
6565
BraceWrapping:
66-
AfterCaseLabel: false
67-
AfterClass: false
66+
AfterCaseLabel: false
67+
AfterClass: false
6868
AfterControlStatement: Never
69-
AfterEnum: false
69+
AfterEnum: false
7070
AfterExternBlock: false
71-
AfterFunction: false
72-
AfterNamespace: false
71+
AfterFunction: false
72+
AfterNamespace: false
7373
AfterObjCDeclaration: false
74-
AfterStruct: false
75-
AfterUnion: false
76-
BeforeCatch: false
77-
BeforeElse: false
74+
AfterStruct: false
75+
AfterUnion: false
76+
BeforeCatch: false
77+
BeforeElse: false
7878
BeforeLambdaBody: false
79-
BeforeWhile: false
80-
IndentBraces: false
79+
BeforeWhile: false
80+
IndentBraces: false
8181
SplitEmptyFunction: true
8282
SplitEmptyRecord: true
8383
SplitEmptyNamespace: true
8484
BreakAdjacentStringLiterals: true
8585
BreakAfterAttributes: Leave
8686
BreakAfterJavaFieldAnnotations: false
87-
BreakArrays: true
87+
BreakArrays: true
8888
BreakBeforeBinaryOperators: None
8989
BreakBeforeConceptDeclarations: Always
9090
BreakBeforeBraces: Attach
@@ -93,14 +93,14 @@ BreakBeforeTernaryOperators: true
9393
BreakConstructorInitializers: BeforeColon
9494
BreakInheritanceList: BeforeColon
9595
BreakStringLiterals: true
96-
ColumnLimit: 80
97-
CommentPragmas: '^ IWYU pragma:'
96+
ColumnLimit: 0
97+
CommentPragmas: "^ IWYU pragma:"
9898
CompactNamespaces: false
9999
ConstructorInitializerIndentWidth: 4
100100
ContinuationIndentWidth: 4
101101
Cpp11BracedListStyle: true
102102
DerivePointerAlignment: false
103-
DisableFormat: false
103+
DisableFormat: false
104104
EmptyLineAfterAccessModifier: Never
105105
EmptyLineBeforeAccessModifier: LogicalBlock
106106
ExperimentalAutoDetectBinPacking: false
@@ -111,49 +111,49 @@ ForEachMacros:
111111
- BOOST_FOREACH
112112
IfMacros:
113113
- KJ_IF_MAYBE
114-
IncludeBlocks: Preserve
114+
IncludeBlocks: Preserve
115115
IncludeCategories:
116-
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
117-
Priority: 2
118-
SortPriority: 0
119-
CaseSensitive: false
120-
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
121-
Priority: 3
122-
SortPriority: 0
123-
CaseSensitive: false
124-
- Regex: '.*'
125-
Priority: 1
126-
SortPriority: 0
127-
CaseSensitive: false
128-
IncludeIsMainRegex: '(Test)?$'
129-
IncludeIsMainSourceRegex: ''
116+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
117+
Priority: 2
118+
SortPriority: 0
119+
CaseSensitive: false
120+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
121+
Priority: 3
122+
SortPriority: 0
123+
CaseSensitive: false
124+
- Regex: ".*"
125+
Priority: 1
126+
SortPriority: 0
127+
CaseSensitive: false
128+
IncludeIsMainRegex: "(Test)?$"
129+
IncludeIsMainSourceRegex: ""
130130
IndentAccessModifiers: false
131131
IndentCaseBlocks: false
132132
IndentCaseLabels: false
133133
IndentExternBlock: AfterExternBlock
134134
IndentGotoLabels: true
135135
IndentPPDirectives: None
136136
IndentRequiresClause: true
137-
IndentWidth: 2
137+
IndentWidth: 4
138138
IndentWrappedFunctionNames: false
139-
InsertBraces: false
139+
InsertBraces: false
140140
InsertNewlineAtEOF: false
141141
InsertTrailingCommas: None
142142
IntegerLiteralSeparator:
143-
Binary: 0
143+
Binary: 0
144144
BinaryMinDigits: 0
145-
Decimal: 0
145+
Decimal: 0
146146
DecimalMinDigits: 0
147-
Hex: 0
148-
HexMinDigits: 0
147+
Hex: 0
148+
HexMinDigits: 0
149149
JavaScriptQuotes: Leave
150150
JavaScriptWrapImports: true
151151
KeepEmptyLinesAtTheStartOfBlocks: true
152152
KeepEmptyLinesAtEOF: false
153153
LambdaBodyIndentation: Signature
154-
LineEnding: DeriveLF
155-
MacroBlockBegin: ''
156-
MacroBlockEnd: ''
154+
LineEnding: DeriveLF
155+
MacroBlockBegin: ""
156+
MacroBlockEnd: ""
157157
MaxEmptyLinesToKeep: 1
158158
NamespaceIndentation: None
159159
ObjCBinPackProtocolList: Auto
@@ -174,10 +174,10 @@ PenaltyExcessCharacter: 1000000
174174
PenaltyIndentedWhitespace: 0
175175
PenaltyReturnTypeOnItsOwnLine: 60
176176
PointerAlignment: Right
177-
PPIndentWidth: -1
177+
PPIndentWidth: -1
178178
QualifierAlignment: Leave
179179
ReferenceAlignment: Pointer
180-
ReflowComments: true
180+
ReflowComments: true
181181
RemoveBracesLLVM: false
182182
RemoveParentheses: Leave
183183
RemoveSemicolon: false
@@ -186,7 +186,7 @@ RequiresExpressionIndentation: OuterScope
186186
SeparateDefinitionBlocks: Leave
187187
ShortNamespaceLines: 1
188188
SkipMacroDefinitionBody: false
189-
SortIncludes: CaseSensitive
189+
SortIncludes: CaseSensitive
190190
SortJavaStaticImport: Before
191191
SortUsingDeclarations: LexicographicNumeric
192192
SpaceAfterCStyleCast: false
@@ -205,7 +205,7 @@ SpaceBeforeParensOptions:
205205
AfterForeachMacros: true
206206
AfterFunctionDefinitionName: false
207207
AfterFunctionDeclarationName: false
208-
AfterIfMacros: true
208+
AfterIfMacros: true
209209
AfterOverloadedOperator: false
210210
AfterPlacementOperator: true
211211
AfterRequiresInClause: false
@@ -215,32 +215,32 @@ SpaceBeforeRangeBasedForLoopColon: true
215215
SpaceBeforeSquareBrackets: false
216216
SpaceInEmptyBlock: false
217217
SpacesBeforeTrailingComments: 1
218-
SpacesInAngles: Never
218+
SpacesInAngles: Never
219219
SpacesInContainerLiterals: true
220220
SpacesInLineCommentPrefix:
221-
Minimum: 1
222-
Maximum: -1
223-
SpacesInParens: Never
221+
Minimum: 1
222+
Maximum: -1
223+
SpacesInParens: Never
224224
SpacesInParensOptions:
225-
InCStyleCasts: false
225+
InCStyleCasts: false
226226
InConditionalStatements: false
227227
InEmptyParentheses: false
228-
Other: false
228+
Other: false
229229
SpacesInSquareBrackets: false
230-
Standard: Latest
230+
Standard: Latest
231231
StatementAttributeLikeMacros:
232232
- Q_EMIT
233233
StatementMacros:
234234
- Q_UNUSED
235235
- QT_REQUIRE_VERSION
236-
TabWidth: 8
237-
UseTab: Never
236+
TabWidth: 4
237+
UseTab: Never
238238
VerilogBreakBetweenInstancePorts: true
239239
WhitespaceSensitiveMacros:
240240
- BOOST_PP_STRINGIZE
241241
- CF_SWIFT_NAME
242242
- NS_SWIFT_NAME
243243
- PP_STRINGIZE
244244
- STRINGIZE
245-
...
245+
---
246246

include/ErrorCode.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
namespace D5R {
44

55
enum ErrorCode {
6-
OK = 0,
7-
SystemError = 100,
8-
CreateInstanceError = 101,
9-
DestroyInstanceError_nullptr,
10-
SerialError = 200,
11-
SerialInitError = 201,
12-
SerialCloseError = 202,
13-
SerialSendError = 203,
14-
SerialReceiveError,
15-
SerialReceiveError_LessThanExpected,
16-
NatorError = 300,
17-
NatorInitError = 301,
18-
RMDError = 400,
19-
RMDInitError = 401,
20-
RMDGetPIError = 402,
21-
RMDFormatError,
22-
RMDChecksumError,
23-
D5RError = 500,
24-
D5RMoveError,
25-
CameraError = 600,
26-
CameraInitError,
27-
CameraReadError
6+
OK = 0,
7+
SystemError = 100,
8+
CreateInstanceError = 101,
9+
DestroyInstanceError_nullptr,
10+
SerialError = 200,
11+
SerialInitError = 201,
12+
SerialCloseError = 202,
13+
SerialSendError = 203,
14+
SerialReceiveError,
15+
SerialReceiveError_LessThanExpected,
16+
NatorError = 300,
17+
NatorInitError = 301,
18+
RMDError = 400,
19+
RMDInitError = 401,
20+
RMDGetPIError = 402,
21+
RMDFormatError,
22+
RMDChecksumError,
23+
D5RError = 500,
24+
D5RMoveError,
25+
CameraError = 600,
26+
CameraInitError,
27+
CameraReadError
2828
};
2929
}

0 commit comments

Comments
 (0)