Commit e0bd79d7 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

added a pass of clang-format

parent 30ec7725
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(margo)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentExternBlock: AfterExternBlock
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- MARGO_REGISTER
- MARGO_REGISTER_PROVIDER
- DEFINE_MARGO_RPC_HANDLER
- DECLARE_MARGO_RPC_HANDLER
- MERCURY_GEN_PROC
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- MERCURY_GEN_PROC
...
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -19,7 +19,8 @@ typedef struct cached_msg* cached_msg_t;
typedef struct cached_msg {
char* buffer;
void* plugin_data;
void* next; // may point to a cached_msg or to a pending_msg depending on context
void* next; // may point to a cached_msg or to a pending_msg depending on
// context
} cached_msg;
typedef struct pending_msg* pending_msg_t;
......@@ -70,9 +71,13 @@ typedef struct mona_request {
mona_request_t next; // for the request cache
} mona_request;
#define MONA_REQUEST_INITIALIZER { ABT_EVENTUAL_NULL, NULL, NULL, NULL, NULL, NULL }
#define MONA_REQUEST_INITIALIZER \
{ \
ABT_EVENTUAL_NULL, NULL, NULL, NULL, NULL, NULL \
}
typedef enum hl_msg_type {
typedef enum hl_msg_type
{
HL_MSG_SMALL,
HL_MSG_LARGE
} hl_msg_type;
......@@ -83,7 +88,7 @@ static inline cached_op_id_t get_op_id_from_cache(mona_instance_t mona)
{
cached_op_id_t id;
ABT_mutex_lock(mona->op_id_cache_mtx);
if(mona->op_id_cache) {
if (mona->op_id_cache) {
id = mona->op_id_cache;
mona->op_id_cache = id->next;
id->next = NULL;
......@@ -96,7 +101,8 @@ static inline cached_op_id_t get_op_id_from_cache(mona_instance_t mona)
return id;
}
static inline void return_op_id_to_cache(mona_instance_t mona, cached_op_id_t id)
static inline void return_op_id_to_cache(mona_instance_t mona,
cached_op_id_t id)
{
ABT_mutex_lock(mona->op_id_cache_mtx);
cached_op_id_t head = mona->op_id_cache;
......@@ -110,7 +116,7 @@ static inline void clear_op_id_cache(mona_instance_t mona)
ABT_mutex_lock(mona->op_id_cache_mtx);
cached_op_id_t cached_op = mona->op_id_cache;
mona->op_id_cache = NULL;
while(cached_op) {
while (cached_op) {
cached_op_id_t tmp = cached_op->next;
NA_Op_destroy(mona->na_class, cached_op->op_id);
free(cached_op);
......@@ -125,7 +131,7 @@ static inline mona_request_t get_req_from_cache(mona_instance_t mona)
{
mona_request_t req;
ABT_mutex_lock(mona->req_cache_mtx);
if(mona->req_cache) {
if (mona->req_cache) {
req = mona->req_cache;
mona->req_cache = req->next;
req->next = NULL;
......@@ -150,7 +156,7 @@ static inline void clear_req_cache(mona_instance_t mona)
ABT_mutex_lock(mona->req_cache_mtx);
mona_request_t cached_req = mona->req_cache;
mona->req_cache = NULL;
while(cached_req) {
while (cached_req) {
mona_request_t tmp = cached_req->next;
free(cached_req);
cached_req = tmp;
......@@ -164,15 +170,14 @@ static inline cached_msg_t get_msg_from_cache(mona_instance_t mona)
{
cached_msg_t msg;
ABT_mutex_lock(mona->msg_cache_mtx);
if(mona->msg_cache) {
if (mona->msg_cache) {
msg = mona->msg_cache;
mona->msg_cache = msg->next;
msg->next = NULL;
} else {
msg = (cached_msg_t)calloc(1, sizeof(*msg));
msg->buffer = (char*)mona_msg_buf_alloc(mona,
mona_msg_get_max_unexpected_size(mona),
&(msg->plugin_data));
msg->buffer = (char*)mona_msg_buf_alloc(
mona, mona_msg_get_max_unexpected_size(mona), &(msg->plugin_data));
}
ABT_mutex_unlock(mona->msg_cache_mtx);
return msg;
......@@ -192,7 +197,7 @@ static inline void clear_msg_cache(mona_instance_t mona)
ABT_mutex_lock(mona->msg_cache_mtx);
cached_msg_t msg = mona->msg_cache;
mona->msg_cache = NULL;
while(msg) {
while (msg) {
cached_msg_t tmp = msg->next;
mona_msg_buf_free(mona, msg->buffer, msg->plugin_data);
free(msg);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment