Mercurial > projects > ldc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/druntime/src/compiler/ldc/typeinfo/ti_ubyte.d Tue Nov 11 01:52:37 2008 +0100 @@ -0,0 +1,43 @@ + +// ubyte + +module rt.typeinfo.ti_ubyte; + +class TypeInfo_h : TypeInfo +{ + override string toString() { return "ubyte"; } + + override hash_t getHash(in void* p) + { + return *cast(ubyte *)p; + } + + override equals_t equals(in void* p1, in void* p2) + { + return *cast(ubyte *)p1 == *cast(ubyte *)p2; + } + + override int compare(in void* p1, in void* p2) + { + return *cast(ubyte *)p1 - *cast(ubyte *)p2; + } + + override size_t tsize() + { + return ubyte.sizeof; + } + + override void swap(void *p1, void *p2) + { + ubyte t; + + t = *cast(ubyte *)p1; + *cast(ubyte *)p1 = *cast(ubyte *)p2; + *cast(ubyte *)p2 = t; + } +} + +class TypeInfo_b : TypeInfo_h +{ + override string toString() { return "bool"; } +}