Apply clang-format via 'make format'. Use 'git diff -b' if comparing. No functional change.

This commit is contained in:
Wilson Snyder 2024-03-20 18:48:12 -04:00
parent 77b4aaefa2
commit ddc130bad4
4 changed files with 1137 additions and 1283 deletions

106
.clang-format Normal file
View File

@ -0,0 +1,106 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 99
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 3
ContinuationIndentWidth: 3
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- Q_FOREACH
- BOOST_FOREACH
# Include grouping/sorting
SortIncludes: false
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 3
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...

View File

@ -4,6 +4,8 @@ CFLAGS= $(ARCHFLGS) $(OPTFLGS) -O2
#CFLAGS= $(ARCHFLGS) -pipe $(OPTFLGS) -g -Wall
#CFLAGS= -pg -g -Wall
#CFLAGS= -g -Wall
CLANGFORMAT = clang-format-14
CLANGFORMAT_FLAGS = -i
CC = gcc
LIBS = -lm
@ -13,7 +15,7 @@ default: README vcddiff
vcddiff: vcddiff.o
$(CC) $(CFLAGS) $(OPTFLGS) vcddiff.o $(LIBS) -o vcddiff
@echo "** Now copy ./vcddiff to your binary directory, e.g. 'cp -p vcddiff /usr/local/bin/vcddiff'"
@echo "** Now copy ./vcddiff to your binary directory, e.g. 'sudo cp -p vcddiff /usr/local/bin/vcddiff'"
vcddiff.o: vcddiff.c vcddiff.h
$(CC) $(CFLAGS) -c vcddiff.c
@ -24,3 +26,6 @@ README: README.pod
clean distclean:
-rm -rf README vcddiff vcddiff.o
format:
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) *.c *.h

2266
vcddiff.c Executable file → Normal file

File diff suppressed because it is too large Load Diff

41
vcddiff.h Executable file → Normal file
View File

@ -20,7 +20,7 @@
#define FALSE 0
#define MAXSIG 256
#define MAXSCOPES 100
#define MAXTOKSIZE (1024*1024 + 1024)
#define MAXTOKSIZE (1024 * 1024 + 1024)
#define EDGE_PER_LINE 11
#define CHAR_PER_EDGE 5
@ -59,38 +59,37 @@
#define UNDEFINED 26
/*dumpfile key words*/
#define V_ATTRBEGIN 1
#define V_COMMENT 2
#define V_DATE 3
#define V_END 4
#define V_ENDDEF 5
#define V_SCOPE 6
#define V_END 4
#define V_ENDDEF 5
#define V_SCOPE 6
#define V_TIMESCALE 7
#define V_UPSCOPE 8
#define V_VAR 9
#define V_VERSION 10
#define V_UPSCOPE 8
#define V_VAR 9
#define V_VERSION 10
# define MAX(a,b) ((a > b ) ? a : b )
#define MAX(a, b) ((a > b) ? a : b)
typedef unsigned long long vtime_t;
typedef char bool_t;
struct variable_types_t {
char *vnam;
int vnum;
char* vnam;
int vnum;
};
struct signal_t {
int size;
int type;
unsigned int sig_code;
char state;
char *vector;
char *signame;
char *ident;
bool_t found;
bool_t in_both;
struct signal_t *next;
int size;
int type;
unsigned int sig_code;
char state;
char* vector;
char* signame;
char* ident;
bool_t found;
bool_t in_both;
struct signal_t* next;
};