diff options
Diffstat (limited to 'test.c')
| -rw-r--r-- | test.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -15,6 +15,7 @@ struct foo { int x, y, z; }; + int test0(struct foo *foo) { return foo->x ? foo->y : foo->z; } int test1(int x, int y, int z) { return x && y || z; } int test2(int x, int y, int z) { return x || y && z; } @@ -44,4 +45,22 @@ int test6(int x) return !!!!x; } +float sqr(float x) { return x * x; } + +int mula(int x, int y, int z) { + if (x < 0) + return -x * y + z; + return x * y + z; +} + +void *copy(char *d, char *s, int n) { + while (n--) + *d++ = *s++; + return d; +} + +int hmm(float x, int a, char *p, char *q) { + return x > 1 ? a || p : p < q && a > 0; +} + // |