Skip to content

Commit 5cc9374

Browse files
committed
reformat
1 parent 5d74e2e commit 5cc9374

11 files changed

Lines changed: 314 additions & 255 deletions

File tree

.clang-format

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: true
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: true
9+
AlignOperands: true
10+
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: Empty
15+
AllowShortIfStatementsOnASingleLine: true
16+
AllowShortLoopsOnASingleLine: true
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakBeforeMultilineStrings: true
19+
AlwaysBreakTemplateDeclarations: true
20+
BinPackArguments: false
21+
BinPackParameters: false
22+
BreakBeforeBinaryOperators: None
23+
BreakBeforeBraces: Attach
24+
BreakBeforeTernaryOperators: true
25+
BreakConstructorInitializersBeforeComma: false
26+
ColumnLimit: 80
27+
CommentPragmas: '^ IWYU pragma:'
28+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
29+
ConstructorInitializerIndentWidth: 8
30+
ContinuationIndentWidth: 8
31+
Cpp11BracedListStyle: true
32+
DerivePointerAlignment: false
33+
PointerAlignment: Left
34+
DisableFormat: false
35+
ExperimentalAutoDetectBinPacking: false
36+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
37+
IndentCaseLabels: false
38+
IndentWidth: 4
39+
IndentWrappedFunctionNames: false
40+
KeepEmptyLinesAtTheStartOfBlocks: false
41+
MacroBlockBegin: ''
42+
MacroBlockEnd: ''
43+
MaxEmptyLinesToKeep: 1
44+
NamespaceIndentation: None
45+
ObjCBlockIndentWidth: 2
46+
ObjCSpaceAfterProperty: false
47+
ObjCSpaceBeforeProtocolList: false
48+
PenaltyBreakBeforeFirstCallParameter: 1
49+
PenaltyBreakComment: 300
50+
PenaltyBreakFirstLessLess: 120
51+
PenaltyBreakString: 1000
52+
PenaltyExcessCharacter: 1000000
53+
PenaltyReturnTypeOnItsOwnLine: 200
54+
PointerAlignment: Left
55+
SpaceAfterCStyleCast: true
56+
SpaceBeforeAssignmentOperators: true
57+
SpaceBeforeParens: ControlStatements
58+
SpaceInEmptyParentheses: false
59+
SpacesBeforeTrailingComments: 2
60+
SpacesInAngles: false
61+
SpacesInContainerLiterals: true
62+
SpacesInCStyleCastParentheses: false
63+
SpacesInParentheses: false
64+
SpacesInSquareBrackets: false
65+
Standard: Auto
66+
TabWidth: 8
67+
UseTab: Never
68+
...
69+
5.19 MB
Binary file not shown.
8 Bytes
Binary file not shown.
8 Bytes
Binary file not shown.
49.2 MB
Binary file not shown.
5.19 MB
Binary file not shown.
8 Bytes
Binary file not shown.

example.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
#include "memorypool.h"
21
#include <stdio.h>
2+
#include "memorypool.h"
33

4-
struct TAT
5-
{
4+
struct TAT {
65
int T_T;
76
};
87

9-
mem_size_t max_mem = 2*GB + 1000*MB + 1000*KB;
10-
mem_size_t mem_pool_size = 1*GB + 500*MB + 500*KB;
8+
mem_size_t max_mem = 2 * GB + 1000 * MB + 1000 * KB;
9+
mem_size_t mem_pool_size = 1 * GB + 500 * MB + 500 * KB;
1110

12-
int main()
13-
{
14-
MemoryPool *mp = MemoryPool_Init(max_mem, mem_pool_size, 0);
15-
struct TAT *tat = (struct TAT *)MemoryPool_Alloc(mp, sizeof(struct TAT));
11+
int main() {
12+
MemoryPool* mp = MemoryPool_Init(max_mem, mem_pool_size, 0);
13+
struct TAT* tat = (struct TAT*) MemoryPool_Alloc(mp, sizeof(struct TAT));
1614
tat->T_T = 2333;
1715
printf("%d\n", tat->T_T);
18-
int *a = (int *)MemoryPool_Calloc(mp, sizeof(int));
16+
int* a = (int*) MemoryPool_Calloc(mp, sizeof(int));
1917
printf("%d\n", *a);
2018
MemoryPool_Free(mp, tat);
2119
MemoryPool_Clear(mp);

0 commit comments

Comments
 (0)