2012-12-10 12:09:53 +00:00
|
|
|
vector
|
|
|
|
foo (float x, float y, float z)
|
|
|
|
{
|
|
|
|
vector v;
|
|
|
|
v.x = x;
|
|
|
|
v.y = y;
|
|
|
|
v.z = z;
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
2019-06-18 01:38:19 +00:00
|
|
|
float w = 2;
|
|
|
|
float h = 4;
|
2018-10-12 14:39:05 +00:00
|
|
|
|
|
|
|
vector
|
|
|
|
bar (void)
|
|
|
|
{
|
|
|
|
vector pos;
|
|
|
|
|
|
|
|
pos.x = w;
|
|
|
|
pos.y = h;
|
|
|
|
pos.z = 0;
|
|
|
|
return pos;
|
|
|
|
}
|
|
|
|
|
2019-06-18 01:38:19 +00:00
|
|
|
vector
|
|
|
|
baz (float w, float h)
|
|
|
|
{
|
|
|
|
vector p = [w, h, 0] / 2;
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2012-12-10 12:09:53 +00:00
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
2019-06-18 01:38:19 +00:00
|
|
|
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;
|
2012-12-10 12:09:53 +00:00
|
|
|
}
|