diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2008-08-09 08:06:33 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2008-08-09 08:06:33 +0000 |
commit | 285f5bec5bb03d4e825e5d866e94008088dd6155 (patch) | |
tree | 9df69ded9ed4f4049e0b3887fdd99fcdf3b1746f /test/raytracer/point.h | |
parent | a83f0c1710cc5143dd885e84c94e14f7d3216f93 (diff) | |
download | compcert-285f5bec5bb03d4e825e5d866e94008088dd6155.tar.gz compcert-285f5bec5bb03d4e825e5d866e94008088dd6155.zip |
Ajout nouveaux tests
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@708 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/raytracer/point.h')
-rw-r--r-- | test/raytracer/point.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/raytracer/point.h b/test/raytracer/point.h new file mode 100644 index 00000000..b8d6ff0f --- /dev/null +++ b/test/raytracer/point.h @@ -0,0 +1,18 @@ +struct point { + flt x, y, z; +}; + +#if 0 +static inline flt dist2(struct point * p1, struct point * p2) +{ + flt dx = p2->x - p1->x; + flt dy = p2->y - p1->y; + flt dz = p2->z - p1->z; + return dx * dx + dy * dy + dz * dz; +} +#else +#define dist2(p1,p2) \ + (((p2)->x - (p1)->x) * ((p2)->x - (p1)->x) + \ + ((p2)->y - (p1)->y) * ((p2)->y - (p1)->y) + \ + ((p2)->z - (p1)->z) * ((p2)->z - (p1)->z)) +#endif |