comparison druntime/src/compiler/ldc/typeinfo/ti_ubyte.d @ 759:d3eb054172f9

Added copy of druntime from DMD 2.020 modified for LDC.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 11 Nov 2008 01:52:37 +0100
parents
children
comparison
equal deleted inserted replaced
758:f04dde6e882c 759:d3eb054172f9
1
2 // ubyte
3
4 module rt.typeinfo.ti_ubyte;
5
6 class TypeInfo_h : TypeInfo
7 {
8 override string toString() { return "ubyte"; }
9
10 override hash_t getHash(in void* p)
11 {
12 return *cast(ubyte *)p;
13 }
14
15 override equals_t equals(in void* p1, in void* p2)
16 {
17 return *cast(ubyte *)p1 == *cast(ubyte *)p2;
18 }
19
20 override int compare(in void* p1, in void* p2)
21 {
22 return *cast(ubyte *)p1 - *cast(ubyte *)p2;
23 }
24
25 override size_t tsize()
26 {
27 return ubyte.sizeof;
28 }
29
30 override void swap(void *p1, void *p2)
31 {
32 ubyte t;
33
34 t = *cast(ubyte *)p1;
35 *cast(ubyte *)p1 = *cast(ubyte *)p2;
36 *cast(ubyte *)p2 = t;
37 }
38 }
39
40 class TypeInfo_b : TypeInfo_h
41 {
42 override string toString() { return "bool"; }
43 }