1
0
Fork 0
Browse Source

Tweak C templates

master
Gavin Howard 1 year ago
parent
commit
839622dd5c
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 3
      C/template.h
  2. 84
      C/template/.clang-format
  3. 3
      C/template/include/%%%/%%%.h
  4. 3
      C/template_internal.h

3
C/template.h

@ -39,7 +39,8 @@
// For C++ compatibility.
#ifdef __cplusplus
extern "C" {
extern "C"
{
#endif
// Put all content here.

84
C/template/.clang-format

@ -4,50 +4,65 @@ Language: Cpp
AccessModifierOffset: 1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakAfterReturnType: All
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
#AttributeMacros: []
BinPackArguments: true
BinPackParameters: true
#BitFieldColonSpacing: Both
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: None
#BreakBeforeConceptDeclarations: true
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakStringLiterals: true
ColumnLimit: 120
BreakInheritanceList: AfterColon
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
@ -60,7 +75,7 @@ IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(sys|arpa|net|netinet)/.*\.h>'
Priority: 4
- Regex: '^<wima/.*\.h>'
- Regex: '^<yc/.*\.h>'
Priority: -1
- Regex: '^".*/.*/.*\.h"'
Priority: 2
@ -75,42 +90,69 @@ IncludeCategories:
- Regex: '^<.*>'
Priority: 6
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentExternBlock: NoIndent
IndentGotoLabels: false
IndentPPDirectives: None
#IndentPragmas: false
#IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaImportGroups: []
JavaScriptQuotes: Double
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
NamespaceMacros: []
ObjCBinPackProtocolList: Always
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakBeforeFirstCallParameter: 250
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakString: 4294967295
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
#PenaltyIndentedWhitespace: 180
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
#RawStringFormats:
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
#SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation
Standard: Latest
TabWidth: 4
TypenameMacros: []
UseCRLF: false
UseTab: ForIndentation
WhitespaceSensitiveMacros: []
...

3
C/template/include/%%%/%%%.h

@ -39,7 +39,8 @@
/* For C++ compatibility */
#ifdef __cplusplus
extern "C" {
extern "C"
{
#endif
#ifdef __cplusplus

3
C/template_internal.h

@ -39,7 +39,8 @@
// For C++ compatibility.
#ifdef __cplusplus
extern "C" {
extern "C"
{
#endif
//! @cond INTERNAL

Loading…
Cancel
Save