Mercurial > projects > ldc
annotate lphobos/typeinfo1/ti_uint.d @ 1602:a413ae7329bf
Merge DMD r243: some harmonization with D2 dmd
---
dmd/aggregate.h | 24 ++++-
dmd/attrib.c | 63 ++++++----
dmd/attrib.h | 10 +-
dmd/declaration.h | 5 +-
dmd/func.c | 337 ++++++++++++++++++++++-------------------------------
dmd/mars.c | 2 +-
dmd/mars.h | 7 +
dmd/mtype.h | 13 ++-
dmd/parse.c | 32 ++++-
dmd/parse.h | 14 ++-
dmd/scope.h | 2 +-
11 files changed, 263 insertions(+), 246 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:19 -0300 |
parents | 2c3cd3596187 |
children |
rev | line source |
---|---|
1 | 1 |
2 // uint | |
3 | |
58
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
52
diff
changeset
|
4 module typeinfo1.ti_uint; |
1 | 5 |
6 class TypeInfo_k : TypeInfo | |
7 { | |
8 char[] toString() { return "uint"; } | |
9 | |
10 hash_t getHash(void *p) | |
11 { | |
12 return *cast(uint *)p; | |
13 } | |
14 | |
15 int equals(void *p1, void *p2) | |
16 { | |
17 return *cast(uint *)p1 == *cast(uint *)p2; | |
18 } | |
19 | |
20 int compare(void *p1, void *p2) | |
21 { | |
22 if (*cast(uint*) p1 < *cast(uint*) p2) | |
23 return -1; | |
24 else if (*cast(uint*) p1 > *cast(uint*) p2) | |
25 return 1; | |
26 return 0; | |
27 } | |
28 | |
29 size_t tsize() | |
30 { | |
31 return uint.sizeof; | |
32 } | |
33 | |
34 void swap(void *p1, void *p2) | |
35 { | |
36 int t; | |
37 | |
38 t = *cast(uint *)p1; | |
39 *cast(uint *)p1 = *cast(uint *)p2; | |
40 *cast(uint *)p2 = t; | |
41 } | |
42 } | |
43 |