Mercurial > projects > ldc
comparison test/dotproduct.d @ 4:e116aa1488e6 trunk
[svn r8] changed backend includes to always use the gen/<foo>.h prefix
fixed passing string literals as array parameters
few other fixes
moved some array routines into gen/arrays
author | lindquist |
---|---|
date | Mon, 03 Sep 2007 17:34:30 +0200 |
parents | c53b6e3fe49a |
children | 0c5f410d973c |
comparison
equal
deleted
inserted
replaced
3:069cf4b0ec67 | 4:e116aa1488e6 |
---|---|
5 float dot(ref vec3 v) | 5 float dot(ref vec3 v) |
6 { | 6 { |
7 return x*v.x + y*v.y + z*v.z; | 7 return x*v.x + y*v.y + z*v.z; |
8 } | 8 } |
9 | 9 |
10 void print(char* n) | 10 void print(char[] n) |
11 { | 11 { |
12 printf("%s = vec3(%.4f, %.4f, %.4f)\n", n, x,y,z); | 12 printf("%.*s = vec3(%.4f, %.4f, %.4f)\n", n.length, n.ptr, x,y,z); |
13 } | 13 } |
14 } | 14 } |
15 | 15 |
16 int main() | 16 int main() |
17 { | 17 { |