diff --git a/Makefile b/Makefile index 2a4ee2b..334d545 100644 --- a/Makefile +++ b/Makefile @@ -132,7 +132,8 @@ clean-all: mrproper # Formatting pretty-code: - clang-format -i src/*.c src/*.h libChf/*.c libChf/*.h + clang-format -i src/*.c src/*.h + make -C libChf pretty-code # Dependencies get-roms: diff --git a/libChf/.clang-format b/libChf/.clang-format new file mode 100644 index 0000000..126882a --- /dev/null +++ b/libChf/.clang-format @@ -0,0 +1,59 @@ +--- +Language: Cpp +ColumnLimit: 140 +IndentWidth: 4 +PPIndentWidth: 2 +UseTab: Never + +AlignArrayOfStructures: Left + +IndentCaseBlocks: true +IndentCaseLabels: true +IndentGotoLabels: false +IndentPPDirectives: AfterHash +IndentWrappedFunctionNames: true + +InsertBraces: false +InsertNewlineAtEOF: true + +MaxEmptyLinesToKeep: 1 + +PointerAlignment: Left +ReferenceAlignment: Left +QualifierAlignment: Left + +SortIncludes: false + +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesInAngles: true +SpacesInCStyleCastParentheses: true +SpacesInContainerLiterals: true +SpacesInParentheses: true +SpacesInSquareBrackets: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false + +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterExternBlock: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +... diff --git a/libChf/Makefile b/libChf/Makefile index 888c0b1..d4b5371 100644 --- a/libChf/Makefile +++ b/libChf/Makefile @@ -48,3 +48,7 @@ mrproper: clean $(TARGET): $(OBJS) $(AR) $(ARFLAGS) $@ $? + +# Formatting +pretty-code: + clang-format -i src/*.c src/*.h diff --git a/libChf/src/chf_msgc.c b/libChf/src/chf_msgc.c index 31c3f07..250632d 100644 --- a/libChf/src/chf_msgc.c +++ b/libChf/src/chf_msgc.c @@ -141,7 +141,7 @@ int ChfMsgcatInit( /* Initialization with msgcat free( private_context ); cc = CHF_F_CATOPEN; } else if ( ( cc = ChfInit( app_name, options, ( void* )private_context, GetMessage, ExitMessage, condition_stack_size, - handler_stack_size, exit_code ) ) != CHF_S_OK ) { + handler_stack_size, exit_code ) ) != CHF_S_OK ) { ( void )catclose( private_context->catalog ); free( private_context ); } else