annotate tests/mini/bug34.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents test/bug34.d@2c3cd3596187
children
rev   line source
lindquist@58 1 module bug34;
lindquist@58 2
lindquist@58 3 class MyTypeInfo_Pointer
lindquist@58 4 {
lindquist@58 5 char[] toString() { return m_next.toString() ~ "*"; }
lindquist@58 6
lindquist@58 7 int opEquals(Object o)
lindquist@58 8 { TypeInfo_Pointer c;
lindquist@58 9
lindquist@58 10 return this is o ||
lindquist@58 11 ((c = cast(TypeInfo_Pointer)o) !is null &&
lindquist@58 12 this.m_next == c.m_next);
lindquist@58 13 }
lindquist@58 14
lindquist@58 15 hash_t getHash(void *p)
lindquist@58 16 {
lindquist@58 17 return cast(uint)*cast(void* *)p;
lindquist@58 18 }
lindquist@58 19
lindquist@58 20 int equals(void *p1, void *p2)
lindquist@58 21 {
lindquist@58 22 return cast(int)(*cast(void* *)p1 == *cast(void* *)p2);
lindquist@58 23 }
lindquist@58 24
lindquist@58 25 int compare(void *p1, void *p2)
lindquist@58 26 {
lindquist@58 27 if (*cast(void* *)p1 < *cast(void* *)p2)
lindquist@58 28 return -1;
lindquist@58 29 else if (*cast(void* *)p1 > *cast(void* *)p2)
lindquist@58 30 return 1;
lindquist@58 31 else
lindquist@58 32 return 0;
lindquist@58 33 }
lindquist@58 34
lindquist@58 35 size_t tsize()
lindquist@58 36 {
lindquist@58 37 return (void*).sizeof;
lindquist@58 38 }
lindquist@58 39
lindquist@58 40 void swap(void *p1, void *p2)
lindquist@58 41 { void* tmp;
lindquist@58 42 tmp = *cast(void**)p1;
lindquist@58 43 *cast(void**)p1 = *cast(void**)p2;
lindquist@58 44 *cast(void**)p2 = tmp;
lindquist@58 45 }
lindquist@58 46
lindquist@58 47 TypeInfo next() { return m_next; }
lindquist@58 48 uint flags() { return 1; }
lindquist@58 49
lindquist@58 50 TypeInfo m_next;
lindquist@58 51 }
lindquist@58 52
lindquist@58 53 void main()
lindquist@58 54 {
lindquist@58 55 }