mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-20 18:32:01 +00:00
Some style fixes for tests
This commit is contained in:
parent
28cd3a3f8f
commit
045bd4dbda
5 changed files with 54 additions and 54 deletions
|
@ -95,7 +95,7 @@ SPLINTFLAGS = \
|
|||
-abstract \
|
||||
-statictrans \
|
||||
-castfcnptr
|
||||
|
||||
|
||||
#always the right rule
|
||||
default: all
|
||||
|
||||
|
@ -108,7 +108,7 @@ uninstall:
|
|||
rm -f $(DESTDIR)$(MANDIR)/man1/doc/qcvm.1
|
||||
rm -f $(DESTDIR)$(MANDIR)/man1/doc/gmqpak.1
|
||||
|
||||
STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' \)
|
||||
STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \)
|
||||
|
||||
whitespace:
|
||||
find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
|
||||
|
|
|
@ -8,5 +8,5 @@ void(float a, float b, float c) main = {
|
|||
sum(sum(sum(a, b, c), b, sum(a, b, c)), b, sum(a, b, sum(a, b, c))),
|
||||
sum(sum(a, b, c), b, c));
|
||||
print(ftos(f), "\n");
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
void() main = ??<
|
||||
print("??=??'??(??)??!??<??>??-??/??/%>|");
|
||||
print("#^[]|{}~\\%>\n");
|
||||
print("??=??'??(??)??!??<??>??-??/??/%>|");
|
||||
print("#^[]|{}~\\%>\n");
|
||||
%>;
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
.float mem;
|
||||
|
||||
void main() {
|
||||
float a;
|
||||
float a;
|
||||
|
||||
// regular binary+store
|
||||
a = 5;
|
||||
print(ftos(a += 1), " = ");
|
||||
print(ftos(a), "\n");
|
||||
// regular binary+store
|
||||
a = 5;
|
||||
print(ftos(a += 1), " = ");
|
||||
print(ftos(a), "\n");
|
||||
|
||||
entity e = spawn();
|
||||
entity e = spawn();
|
||||
e.mem = 10;
|
||||
print(ftos(e.mem += 1), " = ");
|
||||
print(ftos(e.mem), "\n");
|
||||
print(ftos(e.mem += 1), " = ");
|
||||
print(ftos(e.mem), "\n");
|
||||
|
||||
// prefix
|
||||
print(ftos(++a), " = ");
|
||||
print(ftos(a), "\n");
|
||||
print(ftos(--a), " = ");
|
||||
print(ftos(a), "\n");
|
||||
print(ftos(++e.mem), " = ");
|
||||
print(ftos(e.mem), "\n");
|
||||
print(ftos(++a), " = ");
|
||||
print(ftos(a), "\n");
|
||||
print(ftos(--a), " = ");
|
||||
print(ftos(a), "\n");
|
||||
print(ftos(++e.mem), " = ");
|
||||
print(ftos(e.mem), "\n");
|
||||
|
||||
// suffix
|
||||
print(ftos(a++), " = ");
|
||||
print(ftos(a-1), "\n");
|
||||
// the CLANG way:
|
||||
a = 3;
|
||||
print(ftos((a++ + a) + a), " = 11\n");
|
||||
// suffix
|
||||
print(ftos(a++), " = ");
|
||||
print(ftos(a-1), "\n");
|
||||
// the CLANG way:
|
||||
a = 3;
|
||||
print(ftos((a++ + a) + a), " = 11\n");
|
||||
|
||||
// check if minus translates
|
||||
print(ftos(a--), "\n");
|
||||
print(ftos(--a), "\n");
|
||||
// check if minus translates
|
||||
print(ftos(a--), "\n");
|
||||
print(ftos(--a), "\n");
|
||||
|
||||
// postfix on members
|
||||
print(ftos(e.mem--), " = ");
|
||||
print(ftos(e.mem+1), "\n");
|
||||
// postfix on members
|
||||
print(ftos(e.mem--), " = ");
|
||||
print(ftos(e.mem+1), "\n");
|
||||
|
||||
// compounds in general
|
||||
a = 3;
|
||||
print(ftos(a *= 2), " = 6\n");
|
||||
print(ftos(a /= 2), " = 3\n");
|
||||
// compounds in general
|
||||
a = 3;
|
||||
print(ftos(a *= 2), " = 6\n");
|
||||
print(ftos(a /= 2), " = 3\n");
|
||||
|
||||
// compounds on vectors
|
||||
vector v;
|
||||
v = '3 4 5';
|
||||
print(vtos(v *= 2), " = '6 8 10'\n");
|
||||
print(vtos(v /= 2), " = '3 4 5'\n");
|
||||
vector v;
|
||||
v = '3 4 5';
|
||||
print(vtos(v *= 2), " = '6 8 10'\n");
|
||||
print(vtos(v /= 2), " = '3 4 5'\n");
|
||||
|
||||
// bit compounds
|
||||
a = 1;
|
||||
print(ftos(a |= 2), " = 3\n");
|
||||
print(ftos(a &= 6), " = 2\n");
|
||||
a = 7;
|
||||
// bit compounds
|
||||
a = 1;
|
||||
print(ftos(a |= 2), " = 3\n");
|
||||
print(ftos(a &= 6), " = 2\n");
|
||||
a = 7;
|
||||
|
||||
print(ftos(a &~= 3), " = 4\n");
|
||||
print(ftos(a &~= 3), " = 4\n");
|
||||
}
|
||||
|
|
|
@ -4,16 +4,16 @@ void funcall() {}
|
|||
void bar(string) {}
|
||||
|
||||
void main(string str) {
|
||||
string pl;
|
||||
string pl;
|
||||
|
||||
if (foo)
|
||||
return; // this is a block wher 'str' doesn't live
|
||||
// so the point-life will not overlap with str
|
||||
pl = "Got overwritten!\n"; // pl point-life
|
||||
if (foo)
|
||||
return; // this is a block wher 'str' doesn't live
|
||||
// so the point-life will not overlap with str
|
||||
pl = "Got overwritten!\n"; // pl point-life
|
||||
|
||||
print(str);
|
||||
print(str);
|
||||
|
||||
pl = "Kill the lifrange here"; // pl life stops
|
||||
funcall(); // Now lock pl in case we have -Oglobal-temps
|
||||
bar(pl); // pl life starts here now
|
||||
pl = "Kill the lifrange here"; // pl life stops
|
||||
funcall(); // Now lock pl in case we have -Oglobal-temps
|
||||
bar(pl); // pl life starts here now
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue