comparison tango/lib/compiler/llvmdc/qsort2.d @ 270:d9d5d59873d8 trunk

[svn r291] Fixed a bunch of the old Phobos tests to work with Tango. Branch statements now emit a new block after it. Fixed the _adSort runtime function had a bad signature. Added a missing dot prefix on compiler generated string tables for string switch. Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author lindquist
date Mon, 16 Jun 2008 16:01:19 +0200
parents 1700239cab2e
children
comparison
equal deleted inserted replaced
269:967178e31a13 270:d9d5d59873d8
28 extern (C) int cmp(void* p1, void* p2) 28 extern (C) int cmp(void* p1, void* p2)
29 { 29 {
30 return tiglobal.compare(p1, p2); 30 return tiglobal.compare(p1, p2);
31 } 31 }
32 32
33 extern (C) long _adSort(Array a, TypeInfo ti) 33 extern (C) Array _adSort(Array a, TypeInfo ti)
34 { 34 {
35 synchronized 35 synchronized
36 { 36 {
37 tiglobal = ti; 37 tiglobal = ti;
38 tango.stdc.stdlib.qsort(a.ptr, a.length, cast(size_t)ti.tsize(), &cmp); 38 tango.stdc.stdlib.qsort(a.ptr, a.length, cast(size_t)ti.tsize(), &cmp);
39 } 39 }
40 return *cast(long*)(&a); 40 return a;
41 } 41 }
42 42
43 43
44 44
45 unittest 45 unittest