Skip to content

Commit

Permalink
Run clang-format --style=llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka committed Sep 9, 2020
1 parent 6758873 commit c7b2c93
Show file tree
Hide file tree
Showing 25 changed files with 470 additions and 322 deletions.
137 changes: 137 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
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: None
BreakBeforeBraces: Attach
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: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
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:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
...

24 changes: 12 additions & 12 deletions asmnemon.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* Этот файл сгенерирован программой 'FASTLIST.EXE' */

unsigned short ofsmnem[26] = {0x0000, 0x0082, // A B
0x00AF, 0x0451, // C D
0x048F, 0x049E, // E F
0xFFFF, 0x078A, // G H
0x07B7, 0x0806, // I J
0xFFFF, 0x08AA, // K L
0x096C, 0x0B00, // M N
0x0B11, 0x0B45, // O P
0xFFFF, 0x0DE9, // Q R
0x0E63, 0x102C, // S T
0x1034, 0x1075, // U V
0x1083, 0x109A, // W X
0xFFFF, 0xFFFF}; // Y Z
0x00AF, 0x0451, // C D
0x048F, 0x049E, // E F
0xFFFF, 0x078A, // G H
0x07B7, 0x0806, // I J
0xFFFF, 0x08AA, // K L
0x096C, 0x0B00, // M N
0x0B11, 0x0B45, // O P
0xFFFF, 0x0DE9, // Q R
0x0E63, 0x102C, // S T
0x1034, 0x1075, // U V
0x1083, 0x109A, // W X
0xFFFF, 0xFFFF}; // Y Z

unsigned char asmMnem[] = {
0x22, 0x00, 0x41, 0x41, 0, // AAA
Expand Down
10 changes: 5 additions & 5 deletions debug.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "tok.h"
#include "misc.h"
#include "tok.h"

#define _DEBUG_

Expand Down Expand Up @@ -228,7 +228,7 @@ void AddLine(int SkipLineInfo) {
lstflag[pdbg] = (unsigned char)(am32 | lsttypedata);
AddEndLine();
// printf("%s(%d)
//outptr=%d\n",(startfileinfo+currentfileinfo)->filename,linenumber,outptr);
// outptr=%d\n",(startfileinfo+currentfileinfo)->filename,linenumber,outptr);
}
pdbg++;
(startfileinfo + currentfileinfo)->numdline++;
Expand All @@ -237,14 +237,14 @@ void AddLine(int SkipLineInfo) {

void KillLastLine() {
// printf("dbgact=%d pdbg=%d outptr=%08X
//ooutptr=%08X\n",dbgact,pdbg,outptr,ooutptr);
// ooutptr=%08X\n",dbgact,pdbg,outptr,ooutptr);
if (outptr == 0 && ooutptr == 0x100) {
ooutptr = 0;
return;
}
if (dbgact == 0 && pdbg != 0) {
// printf("pdbg=%d dbgmod=%d
//currentfileinfo=%d\n",pdbg,dbgmod[0],currentfileinfo);
// currentfileinfo=%d\n",pdbg,dbgmod[0],currentfileinfo);
if (pdbg == 1 && dbgmod[0] != (unsigned short)currentfileinfo)
return;
pdbg--;
Expand All @@ -257,7 +257,7 @@ void KillLastLine() {
ooutptr = dbgloc[pdbg];
}
// printf("%s(%d) pdbg=%d oline=%d
//ooutptr=%d\n",(startfileinfo+currentfileinfo)->filename,linenumber,pdbg,oline,ooutptr);
// ooutptr=%d\n",(startfileinfo+currentfileinfo)->filename,linenumber,pdbg,oline,ooutptr);
(startfileinfo + dbgmod[pdbg])->numdline--;
}
}
Expand Down
26 changes: 13 additions & 13 deletions dirlist.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* Этот файл сгенерирован программой 'FASTLIST.EXE' */

unsigned short ofsdir[27] = {0x0000, 0x000F, // D a
0xFFFF, 0x0045, // b c
0x0072, 0x0090, // d e
0x00A5, 0xFFFF, // f g
0xFFFF, 0x00C0, // h i
0x010A, 0xFFFF, // j k
0xFFFF, 0x0118, // l m
0xFFFF, 0xFFFF, // n o
0x0132, 0xFFFF, // p q
0x015F, 0x0184, // r s
0xFFFF, 0x01F6, // t u
0xFFFF, 0x0263, // v w
0xFFFF, 0xFFFF, // x y
0xFFFF}; // z
0xFFFF, 0x0045, // b c
0x0072, 0x0090, // d e
0x00A5, 0xFFFF, // f g
0xFFFF, 0x00C0, // h i
0x010A, 0xFFFF, // j k
0xFFFF, 0x0118, // l m
0xFFFF, 0xFFFF, // n o
0x0132, 0xFFFF, // p q
0x015F, 0x0184, // r s
0xFFFF, 0x01F6, // t u
0xFFFF, 0x0263, // v w
0xFFFF, 0xFFFF, // x y
0xFFFF}; // z

unsigned char dirlist[] = {
0x19, 0x00, 0x4F, 0x53, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
Expand Down
4 changes: 2 additions & 2 deletions disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ void undata(unsigned int ofs, unsigned long len, unsigned int type) {
d += data[j++] << 8;
printword((unsigned short)d);
// uprintf("%05Xh",(unsigned
//int)d);
// int)d);
if (j != i)
uputchar(',');
}
Expand Down Expand Up @@ -1497,7 +1497,7 @@ void undata(unsigned int ofs, unsigned long len, unsigned int type) {
d += data[j++] << 24;
printdword((unsigned int)d);
// uprintf("%09lXh",(unsigned
//int)d);
// int)d);
if (j != i)
uputchar(',');
}
Expand Down
24 changes: 11 additions & 13 deletions errors.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#define _ERRORS_
#include "tok.h"
#include "misc.h"
#include "tok.h"

void warningprint(const char *str, int line, int file);
WARNACT wact[WARNCOUNT] = {{warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1}};
WARNACT wact[WARNCOUNT] = {
{warningprint, 1}, {warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1}, {warningprint, 1},
{warningprint, 1}, {warningprint, 1}, {warningprint, 1}};

int maxerrors = 16; // number of errors to stop at

Expand Down Expand Up @@ -45,12 +45,10 @@ void FindEndLex() {
}

/* error on currentline with line number and file name */
void preerror(const char *str)
{
preerror3(str, linenumber);
}
void preerror(const char *str) { preerror3(str, linenumber); }

void preerror3(const char *str, unsigned int line,
void preerror3(
const char *str, unsigned int line,
unsigned int file) // error message at a different than current line
{
if (error < maxerrors) {
Expand Down Expand Up @@ -904,8 +902,8 @@ void mapfun(int line) {
startfileinfo == NULL
? ""
: (startfileinfo + currentfileinfo)->filename);
fprintf(hmap, "\noffset=0x%lX(%ld)\tsize=0x%X(%d)", itok.number, itok.number,
itok.size, itok.size);
fprintf(hmap, "\noffset=0x%lX(%ld)\tsize=0x%X(%d)", itok.number,
itok.number, itok.size, itok.size);
}
fheader = 0;
for (ftlr = btlr; ftlr != NULL; ftlr = ftlr->next) {
Expand Down
52 changes: 26 additions & 26 deletions id.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/* Этот файл сгенерирован программой 'FASTLIST.EXE' */

unsigned short idofs[53] = {0xFFFF, 0x0000, // A B
0x0009, 0xFFFF, // C D
0x0026, 0x0037, // E F
0x0044, 0xFFFF, // G H
0x004C, 0xFFFF, // I J
0xFFFF, 0x0052, // K L
0x005C, 0x0069, // M N
0x0093, 0x009F, // O P
0xFFFF, 0x00AB, // Q R
0x00B5, 0xFFFF, // S T
0xFFFF, 0xFFFF, // U V
0x00BF, 0xFFFF, // W X
0xFFFF, 0x00C8, // Y Z
0x00D4, 0x011A, //_ a
0x0121, 0x0130, // b c
0x014F, 0x0175, // d e
0x018B, 0x01A8, // f g
0xFFFF, 0x01B0, // h i
0xFFFF, 0xFFFF, // j k
0x01CE, 0xFFFF, // l m
0x01E4, 0xFFFF, // n o
0x01EB, 0x01F5, // p q
0x01FE, 0x0208, // r s
0xFFFF, 0x0242, // t u
0x0255, 0x025D, // v w
0xFFFF, 0xFFFF, // x y
0xFFFF}; // z
0x0009, 0xFFFF, // C D
0x0026, 0x0037, // E F
0x0044, 0xFFFF, // G H
0x004C, 0xFFFF, // I J
0xFFFF, 0x0052, // K L
0x005C, 0x0069, // M N
0x0093, 0x009F, // O P
0xFFFF, 0x00AB, // Q R
0x00B5, 0xFFFF, // S T
0xFFFF, 0xFFFF, // U V
0x00BF, 0xFFFF, // W X
0xFFFF, 0x00C8, // Y Z
0x00D4, 0x011A, //_ a
0x0121, 0x0130, // b c
0x014F, 0x0175, // d e
0x018B, 0x01A8, // f g
0xFFFF, 0x01B0, // h i
0xFFFF, 0xFFFF, // j k
0x01CE, 0xFFFF, // l m
0x01E4, 0xFFFF, // n o
0x01EB, 0x01F5, // p q
0x01FE, 0x0208, // r s
0xFFFF, 0x0242, // t u
0x0255, 0x025D, // v w
0xFFFF, 0xFFFF, // x y
0xFFFF}; // z

unsigned char id[] = {
0x7A, 0x00, 0x52, 0x45, 0x41, 0x4B, 0, // BREAK
Expand Down
Loading

0 comments on commit c7b2c93

Please sign in to comment.