Mercurial > projects > ldc
view runtime/internal/typeinfo/ti_uint.d @ 571:cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 02 Sep 2008 23:10:12 +0200 |
parents | 44f08170f4ef |
children |
line wrap: on
line source
// uint module typeinfo.ti_uint; class TypeInfo_k : TypeInfo { char[] toString() { return "uint"; } hash_t getHash(void *p) { return *cast(uint *)p; } int equals(void *p1, void *p2) { return *cast(uint *)p1 == *cast(uint *)p2; } int compare(void *p1, void *p2) { if (*cast(uint*) p1 < *cast(uint*) p2) return -1; else if (*cast(uint*) p1 > *cast(uint*) p2) return 1; return 0; } size_t tsize() { return uint.sizeof; } void swap(void *p1, void *p2) { int t; t = *cast(uint *)p1; *cast(uint *)p1 = *cast(uint *)p2; *cast(uint *)p2 = t; } }