mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-15 09:21:33 +00:00
0f1f477e64
Fixes vector expressions as sub-expresses. I really don't know why I did the temp alias setup that way.
40 lines
425 B
R
40 lines
425 B
R
vector
|
|
foo (float x, float y, float z)
|
|
{
|
|
vector v;
|
|
v.x = x;
|
|
v.y = y;
|
|
v.z = z;
|
|
return v;
|
|
}
|
|
|
|
float w = 2;
|
|
float h = 4;
|
|
|
|
vector
|
|
bar (void)
|
|
{
|
|
vector pos;
|
|
|
|
pos.x = w;
|
|
pos.y = h;
|
|
pos.z = 0;
|
|
return pos;
|
|
}
|
|
|
|
vector
|
|
baz (float w, float h)
|
|
{
|
|
vector p = [w, h, 0] / 2;
|
|
return p;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int ret = 0;
|
|
ret |= foo(1,2,3) != [1, 2, 3];
|
|
ret |= bar() != [2, 4, 0];
|
|
ret |= baz(5, 6) != [2.5, 3, 0];
|
|
return ret;
|
|
}
|