Mercurial > projects > ldc
annotate tests/mini/staticarrays.d @ 1607:207a8a438dea
Merge DMD r253: refactor: Argument => Parameter
---
dmd/arrayop.c | 30 ++++----
dmd/arraytypes.h | 2 +-
dmd/class.c | 8 +-
dmd/declaration.c | 10 ++--
dmd/declaration.h | 16 ++--
dmd/doc.c | 12 ++--
dmd/dsymbol.c | 4 +-
dmd/expression.c | 48 +++++++-------
dmd/expression.h | 32 +++++-----
dmd/func.c | 78 +++++++++++-----------
dmd/init.c | 2 +-
dmd/interpret.c | 8 +-
dmd/mtype.c | 190 ++++++++++++++++++++++++++--------------------------
dmd/mtype.h | 32 +++++-----
dmd/opover.c | 34 +++++-----
dmd/parse.c | 40 ++++++------
dmd/parse.h | 2 +-
dmd/statement.c | 90 +++++++++++++-------------
dmd/statement.h | 14 ++--
dmd/struct.c | 8 +-
dmd/template.c | 30 ++++----
gen/functions.cpp | 10 ++--
gen/functions.h | 2 +-
gen/tocall.cpp | 10 ++--
gen/typinf.cpp | 6 +-
25 files changed, 359 insertions(+), 359 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:20 -0300 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
270
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
1
diff
changeset
|
1 extern(C) int printf(char*, ...); |
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
1
diff
changeset
|
2 |
1 | 3 void numbers() |
4 { | |
5 bool[8] bools; | |
6 char[8] chars; | |
7 byte[8] bytes; | |
8 short[8] shorts; | |
9 int[8] ints; | |
10 long[8] longs; | |
11 float[8] floats; | |
12 double[8] doubles; | |
13 real[8] reals; | |
14 { | |
15 bools[7] = true; | |
16 floats[7] = 3.14159265; | |
17 { | |
18 printf("bools[0] = %d, bools[7] = %d\n", bools[0], bools[7]); | |
19 printf("floats[0] = %f, floats[7] = %f\n", floats[0], floats[7]); | |
20 } | |
21 } | |
22 } | |
23 | |
24 struct S | |
25 { | |
26 int i = 42; | |
27 void print() | |
28 { | |
29 printf("S.i = %d\n", i); | |
30 } | |
31 } | |
32 | |
33 class C | |
34 { | |
35 int i; | |
36 this() | |
37 { | |
38 i = 3; | |
39 } | |
40 void print() | |
41 { | |
42 printf("C.i = %d\n", i); | |
43 } | |
44 } | |
45 | |
46 void refs() | |
47 { | |
48 void*[5] voids; | |
49 S*[5] structs; | |
50 C[5] classes; | |
51 | |
52 { | |
53 voids[0] = cast(void*)0xA; | |
54 printf("void* = %p\n", voids[0]); | |
55 } | |
56 { | |
57 structs[0] = new S; | |
58 structs[0].print(); | |
59 delete structs[0]; | |
60 } | |
61 { | |
62 classes[0] = new C; | |
63 classes[0].print(); | |
64 delete classes[0]; | |
65 } | |
66 } | |
67 | |
339
385a18242485
[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too!
lindquist
parents:
270
diff
changeset
|
68 void vals() |
385a18242485
[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too!
lindquist
parents:
270
diff
changeset
|
69 { |
385a18242485
[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too!
lindquist
parents:
270
diff
changeset
|
70 S[5] structs; |
385a18242485
[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too!
lindquist
parents:
270
diff
changeset
|
71 } |
385a18242485
[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too!
lindquist
parents:
270
diff
changeset
|
72 |
1 | 73 void main() |
74 { | |
75 numbers(); | |
76 refs(); | |
339
385a18242485
[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too!
lindquist
parents:
270
diff
changeset
|
77 vals(); |
1 | 78 } |