Mercurial > projects > ldc
comparison tests/minicomplex/arrays1.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module tangotests.arrays1; | |
2 | |
3 import tango.stdc.stdio; | |
4 | |
5 void main() | |
6 { | |
7 real[] arr; | |
8 print(arr); | |
9 main2(); | |
10 } | |
11 | |
12 void main2() | |
13 { | |
14 real[] arr = void; | |
15 fill(arr); | |
16 print(arr); | |
17 main3(); | |
18 } | |
19 | |
20 void main3() | |
21 { | |
22 } | |
23 | |
24 void print(real[] arr) | |
25 { | |
26 printf("len=%u ; ptr=%p\n", arr.length, arr.ptr); | |
27 } | |
28 | |
29 void fill(ref real[] arr) | |
30 { | |
31 auto ptr = cast(void**)&arr; | |
32 *ptr++ = cast(void*)0xbeefc0de; | |
33 *ptr = cast(void*)0xbeefc0de; | |
34 } | |
35 | |
36 void dg1(void delegate(int[]) dg) | |
37 { | |
38 dg2(dg); | |
39 } | |
40 | |
41 void dg2(void delegate(int[]) dg) | |
42 { | |
43 dg(null); | |
44 } | |
45 | |
46 void sarr1(int[16] sa) | |
47 { | |
48 sarr1(sa); | |
49 } | |
50 | |
51 struct Str | |
52 { | |
53 size_t length; | |
54 char* ptr; | |
55 } | |
56 | |
57 void str1(Str str) | |
58 { | |
59 str1(str); | |
60 } | |
61 | |
62 void str2(ref Str str) | |
63 { | |
64 str2(str); | |
65 } | |
66 | |
67 void str3(out Str str) | |
68 { | |
69 str3(str); | |
70 } | |
71 | |
72 void str4(Str* str) | |
73 { | |
74 str4(str); | |
75 } | |
76 | |
77 void str5(Str); | |
78 |