Skip to content

Commit

Permalink
Unify formatting using clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
imciner2 committed Jan 2, 2025
1 parent 542b402 commit 302364d
Show file tree
Hide file tree
Showing 15 changed files with 840 additions and 799 deletions.
67 changes: 67 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# minimum clang-format 10
BasedOnStyle: LLVM

Language: Cpp
Standard: c++17

TabWidth: 4
UseTab: Never

AccessModifierOffset: -4

AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignOperands: true
AlignTrailingComments: true

AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false

AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes

BinPackArguments: true
BinPackParameters: true

BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true

ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner
PointerAlignment: Left
ReflowComments: false
SortIncludes: false

SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

13 changes: 7 additions & 6 deletions configure/qdldl_types.h.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#ifndef QDLDL_TYPES_H
# define QDLDL_TYPES_H
#define QDLDL_TYPES_H

# ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
# endif /* ifdef __cplusplus */
#endif /* ifdef __cplusplus */

#include <limits.h> //for the QDLDL_INT_TYPE_MAX
// For the QDLDL_INT_TYPE_MAX
#include <limits.h>

// QDLDL integer and float types

Expand All @@ -26,8 +27,8 @@ typedef @QDLDL_BOOL_TYPE@ QDLDL_bool; /* for boolean values */
/* When defined, QDLDL is using long long instead of int types */
#cmakedefine QDLDL_LONG

# ifdef __cplusplus
#ifdef __cplusplus
}
# endif /* ifdef __cplusplus */
#endif /* ifdef __cplusplus */

#endif /* ifndef QDLDL_TYPES_H */
Loading

0 comments on commit 302364d

Please sign in to comment.