Skip to content

Commit

Permalink
Fix wrong clang formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Sep 1, 2022
1 parent d19242b commit c2fed1a
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 59 deletions.
84 changes: 42 additions & 42 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Language: Cpp
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
Expand All @@ -16,7 +16,8 @@ AlignConsecutiveBitFields:
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
InsertBraces: true # Control statements must have curly brackets
SortIncludes: false
InsertBraces: true # Control statements must have curly brackets
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
Expand All @@ -36,21 +37,21 @@ AttributeMacros:
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
Expand All @@ -64,21 +65,21 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ColumnLimit: 120
CommentPragmas: "^ IWYU pragma:"
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: BinPack
BasedOnStyle: ''
BasedOnStyle: ""
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
Expand All @@ -88,32 +89,32 @@ ForEachMacros:
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<(.*)>'
Priority: 0
- Regex: '^"(.*)"'
Priority: 1
- Regex: '(.*)'
Priority: 2
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
- Regex: "^<(.*)>"
Priority: 0
- Regex: '^"(.*)"'
Priority: 1
- Regex: "(.*)"
Priority: 2
IncludeIsMainRegex: "(Test)?$"
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: true
IndentWidth: 4
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
Expand All @@ -132,13 +133,12 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: false
ReflowComments: false
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
Expand All @@ -152,34 +152,34 @@ SpaceBeforeParensOptions:
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
Expand All @@ -189,5 +189,5 @@ WhitespaceSensitiveMacros:
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
...
---

7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
"lwesp_pbuf.h": "c",
"lwesp_opt.h": "c",
"lwesp_typedefs.h": "c",
"lwesp_opts.h": "c"
"lwesp_opts.h": "c",
"lwesp_buff.h": "c",
"lwesp_debug.h": "c",
"lwesp_utils.h": "c",
"stdlib.h": "c",
"lwesp_unicode.h": "c"
},
"esbonio.sphinx.confDir": ""
}
2 changes: 1 addition & 1 deletion lwesp/src/include/lwesp/lwesp_buff.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extern "C" {
*
* \note Modification of this macro must be done in header and source file aswell
*/
#define BUF_PREF(x) lwesp_##x
#define BUF_PREF(x) lwesp_ ## x
/* --- Buffer unique part ends --- */

uint8_t BUF_PREF(buff_init)(BUF_PREF(buff_t) * buff, size_t size);
Expand Down
6 changes: 3 additions & 3 deletions lwesp/src/include/lwesp/lwesp_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
#ifndef LWESP_HDR_INCLUDES_H
#define LWESP_HDR_INCLUDES_H

#include "lwesp/lwesp_opt.h"
#include "lwesp/lwesp_typedefs.h"
#include "lwesp/lwesp_debug.h"
#include "lwesp/lwesp_buff.h"
#include "lwesp/lwesp_conn.h"
#include "lwesp/lwesp_debug.h"
#include "lwesp/lwesp_evt.h"
#include "lwesp/lwesp_input.h"
#include "lwesp/lwesp_opt.h"
#include "lwesp/lwesp_pbuf.h"
#include "lwesp/lwesp_server.h"
#include "lwesp/lwesp_typedefs.h"
#include "lwesp/lwesp_utils.h"
#include "system/lwesp_sys.h"

Expand Down
1 change: 1 addition & 0 deletions lwesp/src/include/lwesp/lwesp_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern "C" {
#endif /* __cplusplus */

#include "lwesp/lwesp.h"
#include "lwesp/lwesp_private.h"

int32_t lwespi_parse_number(const char** str);
uint8_t lwespi_parse_string(const char** src, char* dst, size_t dst_len, uint8_t trim);
Expand Down
11 changes: 0 additions & 11 deletions lwesp/src/include/lwesp/lwesp_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,6 @@ typedef struct {
It is used for connections */
} lwesp_t;

/**
* \ingroup LWESP_UNICODE
* \brief Unicode support structure
*/
typedef struct {
uint8_t ch[4]; /*!< UTF-8 max characters */
uint8_t t; /*!< Total expected length in UTF-8 sequence */
uint8_t r; /*!< Remaining bytes in UTF-8 sequence */
lwespr_t res; /*!< Current result of processing */
} lwesp_unicode_t;

/**
* \}
*/
Expand Down
11 changes: 11 additions & 0 deletions lwesp/src/include/lwesp/lwesp_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,17 @@ typedef struct {
} ext; /*!< Extended support union */
} lwesp_conn_start_t;

/**
* \ingroup LWESP_UNICODE
* \brief Unicode support structure
*/
typedef struct {
uint8_t ch[4]; /*!< UTF-8 max characters */
uint8_t t; /*!< Total expected length in UTF-8 sequence */
uint8_t r; /*!< Remaining bytes in UTF-8 sequence */
lwespr_t res; /*!< Current result of processing */
} lwesp_unicode_t;

#ifdef __cplusplus
}
#endif /* __cplusplus */
Expand Down
2 changes: 1 addition & 1 deletion lwesp/src/lwesp/lwesp_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v1.1.2-dev
*/
#include "lwesp/lwesp_private.h"
#include "lwesp/lwesp_int.h"
#include "lwesp/lwesp.h"
#include "lwesp/lwesp_mem.h"
#include "lwesp/lwesp_parser.h"
#include "lwesp/lwesp_private.h"
#include "lwesp/lwesp_unicode.h"
#include "system/lwesp_ll.h"

Expand Down

0 comments on commit c2fed1a

Please sign in to comment.