Skip to content

Commit da16a44

Browse files
committed
style: Format sources using astyle 3.0.1
This change applies code formatting to the source files using astyle version 3.0.1 according to the project's style guidelines.
1 parent 5c791a4 commit da16a44

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

simplecpp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,18 +761,18 @@ void simplecpp::TokenList::readfile(Stream &stream, const std::string &filename,
761761
while (stream.good() && ch != '\n') {
762762
currentToken += ch;
763763
ch = stream.readChar();
764-
if(ch == '\\') {
764+
if (ch == '\\') {
765765
TokenString tmp;
766766
char tmp_ch = ch;
767-
while((stream.good()) && (tmp_ch == '\\' || tmp_ch == ' ' || tmp_ch == '\t')) {
767+
while ((stream.good()) && (tmp_ch == '\\' || tmp_ch == ' ' || tmp_ch == '\t')) {
768768
tmp += tmp_ch;
769769
tmp_ch = stream.readChar();
770770
}
771-
if(!stream.good()) {
771+
if (!stream.good()) {
772772
break;
773773
}
774774

775-
if(tmp_ch != '\n') {
775+
if (tmp_ch != '\n') {
776776
currentToken += tmp;
777777
} else {
778778
const TokenString check_portability = currentToken + tmp;

test.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,14 @@ static void comment_multiline()
438438
ASSERT_EQUALS("\n\nvoid f ( ) {", preprocess(code));
439439

440440
const char code1[] = "#define ABC {// \\\r\n"
441-
"}\n"
442-
"void f() ABC\n";
441+
"}\n"
442+
"void f() ABC\n";
443443
ASSERT_EQUALS("\n\nvoid f ( ) {", preprocess(code1));
444444

445445
const char code2[] = "#define A 1// \\\r"
446-
"\r"
447-
"2\r"
448-
"A\r";
446+
"\r"
447+
"2\r"
448+
"A\r";
449449
ASSERT_EQUALS("\n\n2\n1", preprocess(code2));
450450

451451
const char code3[] = "void f() {// \\ \n}\n";
@@ -2100,7 +2100,7 @@ static void circularInclude()
21002100
"#define TEST_H\n"
21012101
"#include \"a/a.h\"\n"
21022102
"#endif\n"
2103-
;
2103+
;
21042104
cache.insert({path, makeTokenList(code, files, path)});
21052105
}
21062106

@@ -2111,7 +2111,7 @@ static void circularInclude()
21112111
"#define A_H\n"
21122112
"#include \"../test.h\"\n"
21132113
"#endif\n"
2114-
;
2114+
;
21152115
cache.insert({path, makeTokenList(code, files, path)});
21162116
}
21172117

@@ -3176,7 +3176,8 @@ static void fuzz_crash()
31763176
"n\n";
31773177
(void)preprocess(code, simplecpp::DUI()); // do not crash
31783178
}
3179-
{ // #346
3179+
{
3180+
// #346
31803181
const char code[] = "#define foo(intp)f##oo(intp\n"
31813182
"foo(f##oo(intp))\n";
31823183
(void)preprocess(code, simplecpp::DUI()); // do not crash

0 commit comments

Comments
 (0)