Changeset 560
- Timestamp:
- 02/10/08 04:39:23 (7 months ago)
- Files:
-
- candidate/phobos/internal/gc/gc.d (modified) (4 diffs)
- candidate/phobos/internal/object.d (modified) (7 diffs)
- candidate/phobos/object.d (modified) (2 diffs)
- candidate/phobos/std.ddoc (modified) (6 diffs)
- candidate/phobos/std/algorithm.d (modified) (3 diffs, 1 prop)
- candidate/phobos/std/bitmanip.d (modified) (2 diffs, 1 prop)
- candidate/phobos/std/c/stdio.d (modified) (1 diff)
- candidate/phobos/std/c/string.d (modified) (1 diff)
- candidate/phobos/std/c/windows/windows.d (modified) (3 diffs)
- candidate/phobos/std/contracts.d (modified) (1 prop)
- candidate/phobos/std/conv.d (modified) (2 diffs)
- candidate/phobos/std/file.d (modified) (10 diffs)
- candidate/phobos/std/format.d (modified) (4 diffs)
- candidate/phobos/std/functional.d (modified) (1 prop)
- candidate/phobos/std/getopt.d (modified) (2 diffs, 2 props)
- candidate/phobos/std/loader.d (modified) (1 diff)
- candidate/phobos/std/math.d (modified) (6 diffs)
- candidate/phobos/std/numeric.d (modified) (1 prop)
- candidate/phobos/std/path.d (modified) (1 diff)
- candidate/phobos/std/process.d (modified) (1 diff)
- candidate/phobos/std/random.d (modified) (1 diff)
- candidate/phobos/std/socket.d (modified) (1 diff)
- candidate/phobos/std/stdio.d (modified) (1 diff)
- candidate/phobos/std/stream.d (modified) (1 diff)
- candidate/phobos/std/string.d (modified) (2 diffs)
- candidate/phobos/std/traits.d (modified) (2 diffs)
- candidate/phobos/std/typecons.d (modified) (1 diff, 1 prop)
- candidate/phobos/std/variant.d (modified) (2 diffs, 1 prop)
- candidate/phobos/std/windows/charset.d (modified) (1 diff)
- candidate/phobos/std/xml.d (modified) (2 props)
- candidate/phobos/std/zip.d (modified) (3 diffs)
- candidate/phobos/style.css (copied) (copied from trunk/phobos/style.css)
- candidate/phobos/win32.mak (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
candidate/phobos/internal/gc/gc.d
r516 r560 4 4 5 5 /* 6 * Copyright (C) 2004-200 7by Digital Mars, www.digitalmars.com6 * Copyright (C) 2004-2008 by Digital Mars, www.digitalmars.com 7 7 * Written by Walter Bright 8 8 * … … 452 452 } 453 453 454 // Perhaps we should get a a size argument like _d_new(), so we 455 // can zero out the array? 456 454 /* This function is obsoleted; replaced by _d_delarray_t() 455 */ 457 456 void _d_delarray(Array *p) 458 457 { … … 467 466 } 468 467 468 /* Delete an array; ti is the element type. 469 * Should we zero out the array when done? 470 */ 471 472 void _d_delarray_t(Array *p, TypeInfo ti) 473 { 474 if (p) 475 { 476 assert(!p.length || p.data); 477 if (p.data) 478 { if (ti) 479 { // Call destructors on all the sub-objects 480 auto sz = ti.tsize(); 481 auto pe = p.data; 482 auto pend = pe + p.length * sz; 483 while (pe != pend) 484 { pend -= sz; 485 ti.destroy(pend); 486 } 487 } 488 _gc.free(p.data); 489 } 490 p.data = null; 491 p.length = 0; 492 } 493 } 494 469 495 470 496 void _d_delmemory(void* *p) … … 484 510 //printf("new_finalizer(p = %p)\n", p); 485 511 _d_callfinalizer(p); 512 } 513 514 extern (C) 515 void _d_callinterfacefinalizer(void *p) 516 { 517 //printf("_d_callinterfacefinalizer(p = %p)\n", p); 518 if (p) 519 { 520 Interface *pi = **cast(Interface ***)p; 521 Object o = cast(Object)(p - pi.offset); 522 _d_callfinalizer(cast(void*)o); 523 } 486 524 } 487 525 candidate/phobos/internal/object.d
r554 r560 425 425 /// Get type information on the contents of the type; null if not available 426 426 OffsetTypeInfo[] offTi() { return null; } 427 428 /// Run the destructor on the object and all its sub-objects 429 void destroy(void *p) { } 430 431 /// Run the postblit on the object and all its sub-objects 432 void postblit(void *p) { } 427 433 } 428 434 … … 450 456 override uint flags() { return base.flags(); } 451 457 override void[] init() { return m_init.length ? m_init : base.init(); } 458 459 override void destroy(void *p) { base.destroy(p); } 460 override void postblit(void *p) { base.postblit(p); } 452 461 453 462 TypeInfo base; … … 668 677 override uint flags() { return value.flags(); } 669 678 679 override void destroy(void *p) 680 { 681 auto sz = value.tsize(); 682 p += sz * len; 683 foreach (i; 0 .. len) 684 { 685 p -= sz; 686 value.destroy(p); 687 } 688 } 689 690 override void postblit(void *p) 691 { 692 auto sz = value.tsize(); 693 foreach (i; 0 .. len) 694 { 695 value.postblit(p); 696 p += sz; 697 } 698 } 699 670 700 TypeInfo value; 671 701 size_t len; … … 907 937 // Should use the one for strings. 908 938 // BUG: relies on the GC not moving objects 909 auto q = cast( ubyte*)p;939 auto q = cast(const(ubyte)*)p; 910 940 for (size_t i = 0; i < init.length; i++) 911 941 { h = h * 9 + *q; … … 962 992 override uint flags() { return m_flags; } 963 993 994 void destroy(void *p) 995 { 996 if (xdtor) 997 (*xdtor)(p); 998 } 999 1000 void postblit(void *p) 1001 { 1002 if (xpostblit) 1003 (*xpostblit)(p); 1004 } 1005 964 1006 string name; 965 1007 void[] m_init; // initializer; init.ptr == null if 0 initialize … … 973 1015 974 1016 const(MemberInfo[]) function(string) xgetMembers; 1017 void function(void*) xdtor; 1018 void function(void*) xpostblit; 975 1019 } 976 1020 … … 1035 1079 assert(0); 1036 1080 } 1081 1082 override void destroy(void *p) 1083 { 1084 assert(0); 1085 } 1086 1087 override void postblit(void *p) 1088 { 1089 assert(0); 1090 } 1037 1091 } 1038 1092 candidate/phobos/object.d
r360 r560 83 83 // 1: // has possible pointers into GC memory 84 84 OffsetTypeInfo[] offTi(); 85 void destroy(void *p); 86 void postblit(void *p); 85 87 } 86 88 … … 151 153 152 154 const(MemberInfo[]) function(string) xgetMembers; 155 void function(void*) xdtor; 156 void function(void*) xpostblit; 153 157 } 154 158 candidate/phobos/std.ddoc
r489 r560 4 4 5 5 <!-- 6 Copyright (c) 1999-200 7by Digital Mars6 Copyright (c) 1999-2008 by Digital Mars 7 7 All Rights Reserved 8 8 Written by Walter Bright … … 13 13 <meta http-equiv="content-type" content="text/html; charset=utf-8" > 14 14 <title>$(TITLE) - D Programming Language - Digital Mars</title> 15 <link rel="stylesheet" type="text/css" href=" http://www.digitalmars.com/d/style.css">15 <link rel="stylesheet" type="text/css" href="../style.css"> 16 16 </head> 17 17 … … 63 63 <div id="copyright"> 64 64 $(COPYRIGHT) | 65 Page generated by $(LINK2 http://www.digitalmars.com/d/ ddoc.html, Ddoc).65 Page generated by $(LINK2 http://www.digitalmars.com/d/2.0/ddoc.html, Ddoc). 66 66 </div> 67 67 … … 90 90 <input id="q" name="q" size="10" value="RTL Search" onFocus='if(this.value == "RTL Search"){this.value="";}'> 91 91 <input type="hidden" id="domains" name="domains" value="www.digitalmars.com"> 92 <input type="hidden" id="sitesearch" name="sitesearch" value="www.digitalmars.com/d/ phobos">92 <input type="hidden" id="sitesearch" name="sitesearch" value="www.digitalmars.com/d/2.0/phobos"> 93 93 <input type="hidden" id="sourceid" name="sourceid" value="google-search"> 94 94 <input type="submit" id="submit" name="submit" value="Go"> … … 128 128 $(LI <a href="std_file.html" title="Basic file operations">std.file</a>) 129 129 $(LI <a href="std_format.html" title="Formatted conversions of values to strings">std.format</a>) 130 $(LI <a href="std_functional.html" title="functional">std.functional</a>) 130 131 $(LI <a href="std_gc.html" title="Control the garbage collector">std.gc</a>) 131 132 $(LI <a href="std_getopt.html" title="Command line options">std.getopt</a>) … … 144 145 $(LI <a href="std_regexp.html" title="regular expressions">std.regexp</a>) 145 146 $(LI <a href="std_signals.html" title="Signals">std.signals</a>) 147 $(LI <a href="std_slist.html" title="Singly linked list">std.slist</a>) 146 148 $(LI <a href="std_socket.html" title="Sockets">std.socket</a>) 147 149 $(LI <a href="std_socketstream.html" title="Stream for a blocking, connected Socket">std.socketstream</a>) candidate/phobos/std/algorithm.d
- Property svn:eol-style set to native
r510 r560 119 119 void swap(T)(ref T lhs, ref T rhs) 120 120 { 121 finalt = lhs;121 auto t = lhs; 122 122 lhs = rhs; 123 123 rhs = t; … … 270 270 { 271 271 auto len = range.length; 272 finallimit = len / 2;272 const limit = len / 2; 273 273 --len; 274 274 for (uint i = 0; i != limit; ++i) 275 275 { 276 finalt = range[i];276 auto t = range[i]; 277 277 range[i] = range[len - i]; 278 278 range[len - i] = t; … … 391 391 Iter getPivot(Iter)(Iter b, Iter e) 392 392 { 393 finalr = b + (e - b) / 2;393 auto r = b + (e - b) / 2; 394 394 return r; 395 395 } candidate/phobos/std/bitmanip.d
- Property svn:eol-style set to native
r510 r560 42 42 else 43 43 alias ulong MasksType; 44 static constMasksType44 enum MasksType 45 45 maskAllElse = ((1uL << len) - 1u) << offset, 46 46 maskMyself = ~maskAllElse, … … 165 165 template bitfields(T...) 166 166 { 167 static conststring bitfields = createFields!(createStoreName!(T)(), 0, T)();167 enum string bitfields = createFields!(createStoreName!(T)(), 0, T)(); 168 168 } 169 169 candidate/phobos/std/c/stdio.d
r554 r560 19 19 version (Win32) 20 20 { 21 const int _NFILE = 60; /// 22 const int BUFSIZ = 0x4000; /// 23 const int EOF = -1; /// 24 const int FOPEN_MAX = 20; /// 25 const int FILENAME_MAX = 256; /// 255 plus NULL 26 const int TMP_MAX = 32767; /// 27 const int _SYS_OPEN = 20; /// 28 const int SYS_OPEN = _SYS_OPEN; /// 29 const wchar WEOF = 0xFFFF; /// 21 enum 22 { 23 int _NFILE = 60, /// 24 int BUFSIZ = 0x4000, /// 25 int EOF = -1, /// 26 int FOPEN_MAX = 20, /// 27 int FILENAME_MAX = 256, /// 255 plus NULL 28 int TMP_MAX = 32767, /// 29 int _SYS_OPEN = 20, /// 30 int SYS_OPEN = _SYS_OPEN, /// 31 wchar WEOF = 0xFFFF, /// 32 } 30 33 } 31 34 32 35 version (linux) 33 36 { 34 const int EOF = -1; 35 const int FOPEN_MAX = 16; 36 const int FILENAME_MAX = 4095; 37 const int TMP_MAX = 238328; 38 const int L_tmpnam = 20; 37 enum 38 { 39 int EOF = -1, 40 int FOPEN_MAX = 16, 41 int FILENAME_MAX = 4095, 42 int TMP_MAX = 238328, 43 int L_tmpnam = 20, 44 } 39 45 } 40 46 candidate/phobos/std/c/string.d
r294 r560 39 39 int memicmp(in char* s1, in char* s2, size_t n); /// 40 40 } 41 42 version (linux) 43 { 44 const(char)* strerror_r(int errnum, char* buf, size_t buflen); /// 45 } candidate/phobos/std/c/windows/windows.d
r554 r560 37 37 38 38 alias WCHAR* LPWSTR; 39 alias const(WCHAR *)LPCWSTR, PCWSTR;39 alias const(WCHAR)* LPCWSTR, PCWSTR; 40 40 41 41 alias uint DWORD; … … 252 252 } 253 253 254 const DWORD MAILSLOT_NO_MESSAGE = cast(DWORD)-1; 255 const DWORD MAILSLOT_WAIT_FOREVER = cast(DWORD)-1; 254 enum 255 { 256 DWORD MAILSLOT_NO_MESSAGE = cast(DWORD)-1, 257 DWORD MAILSLOT_WAIT_FOREVER = cast(DWORD)-1, 258 } 256 259 257 260 enum : uint … … 276 279 } 277 280 278 HANDLE INVALID_HANDLE_VALUE = cast(HANDLE)-1; 279 const DWORD INVALID_SET_FILE_POINTER = cast(DWORD)-1; 280 const DWORD INVALID_FILE_SIZE = cast(DWORD)0xFFFFFFFF; 281 enum 282 { 283 HANDLE INVALID_HANDLE_VALUE = cast(HANDLE)-1, 284 DWORD INVALID_SET_FILE_POINTER = cast(DWORD)-1, 285 DWORD INVALID_FILE_SIZE = cast(DWORD)0xFFFFFFFF, 286 } 281 287 282 288 struct OVERLAPPED { candidate/phobos/std/contracts.d
- Property svn:eol-stype set to native
candidate/phobos/std/conv.d
r516 r560 1356 1356 version (Windows) 1357 1357 { 1358 if (icmp(s, "nan") == 0) return F.nan; 1358 if (icmp(s, "nan") == 0) 1359 { 1360 s = s[3 .. $]; 1361 return F.nan; 1362 } 1359 1363 } 1360 1364 … … 1973 1977 throw new ConvError("getComplexStrings() \"" ~ s ~ "\"" ~ " s1=\"" 1974 1978 ~ s1 ~ "\"" ~ " s2=\"" ~ s2 ~ "\""); 1975 return 0;1976 1979 } 1977 1980 candidate/phobos/std/file.d
r554 r560 635 635 */ 636 636 637 string[] listdir( in string pathname, instring pattern)637 string[] listdir(string pathname, string pattern) 638 638 { string[] result; 639 639 … … 655 655 /** Ditto */ 656 656 657 string[] listdir( instring pathname, RegExp r)657 string[] listdir(string pathname, RegExp r) 658 658 { string[] result; 659 659 … … 713 713 */ 714 714 715 void listdir(in string pathname, bool delegate( instring filename) callback)715 void listdir(in string pathname, bool delegate(string filename) callback) 716 716 { 717 717 bool listing(DirEntry* de) … … 863 863 private import std.c.linux.linux; 864 864 865 extern (C) char* strerror(int);866 867 865 /*********************************** 868 866 */ … … 884 882 885 883 this(string name, uint errno) 886 { const(char*) s = strerror(errno); 884 { char[80] buf = void; 885 auto s = strerror_r(errno, buf.ptr, buf.length); 887 886 this(name, std.string.toString(s).idup); 888 887 this.errno = errno; … … 955 954 int fd; 956 955 int numwritten; 957 const(char*) namez; 958 959 namez = toStringz(name); 956 957 auto namez = toStringz(name); 960 958 fd = std.c.linux.linux.open(namez, O_CREAT | O_WRONLY | O_TRUNC, 0660); 961 959 if (fd == -1) … … 1043 1041 int fd; 1044 1042 struct_stat statbuf; 1045 const(char*) namez; 1046 1047 namez = toStringz(name); 1043 1044 auto namez = toStringz(name); 1048 1045 //printf("file.getSize('%s')\n",namez); 1049 1046 fd = std.c.linux.linux.open(namez, O_RDONLY); … … 1085 1082 { 1086 1083 struct_stat statbuf; 1087 const(char*) namez; 1088 1089 namez = toStringz(name); 1084 1085 auto namez = toStringz(name); 1090 1086 if (std.c.linux.linux.stat(namez, &statbuf)) 1091 1087 { … … 1281 1277 int fd; 1282 1278 struct_stat statbuf; 1283 const(char*) namez; 1284 1285 namez = toStringz(name); 1279 1280 auto namez = toStringz(name); 1286 1281 if (std.c.linux.linux.stat(namez, &statbuf)) 1287 1282 { … … 1620 1615 break; 1621 1616 } 1622 return result == 0; 1617 return result == 0; 1623 1618 } 1624 1619 candidate/phobos/std/format.d
r554 r560 1772 1772 * 'w'. 1773 1773 */ 1774 private void formatIntegral(Writer, D)(ref Writer w, D arg , FormatInfo f)1774 private void formatIntegral(Writer, D)(ref Writer w, D argx, FormatInfo f) 1775 1775 { 1776 Mutable!(D) arg = argx; 1776 1777 if (f.spec == 'r') 1777 1778 { … … 1838 1839 char buffer[64]; // 64 bits in base 2 at most 1839 1840 uint i = buffer.length; 1840 auto n = cast(unsigned!( D)) arg;1841 auto n = cast(unsigned!(Mutable!(D))) arg; 1841 1842 do 1842 1843 { … … 1942 1943 //writeln(sprintfSpec); 1943 1944 char[512] buf; 1944 finaln = snprintf(buf.ptr, buf.length,1945 auto n = snprintf(buf.ptr, buf.length, 1945 1946 sprintfSpec.ptr, 1946 1947 f.width, … … 2108 2109 { 2109 2110 const len = args.length; 2110 void function(ref Writer, const void*, FormatInfo) funs[len] = void;2111 void function(ref Writer, const(void)*, FormatInfo) funs[len] = void; 2111 2112 const(void)* argsAddresses[len] = void; 2112 2113 foreach (i, arg; args) candidate/phobos/std/functional.d
- Property svn:eol-stype set to native
candidate/phobos/std/getopt.d
- Property svn:eol-stype set to native
- Property svn:executable deleted
r554 r560 440 440 if (!arg.length || arg[0] != optChar) return false; 441 441 arg = arg[1 .. $]; 442 autoisLong = arg.length > 1 && arg[0] == optChar;442 const isLong = arg.length > 1 && arg[0] == optChar; 443 443 if (isLong) arg = arg[1 .. $]; 444 autoeqPos = find(arg, assignChar);444 const eqPos = find(arg, assignChar); 445 445 if (eqPos >= 0) { 446 446 value = arg[eqPos + 1 .. $]; … … 451 451 //writeln("Arg: ", arg, " pattern: ", optPattern, " value: ", value); 452 452 // Split the option 453 autovariants = split(optPattern, "|");453 const variants = split(optPattern, "|"); 454 454 foreach (v ; variants) { 455 455 if (arg == v || !cfg.caseSensitive && toupper(arg) == toupper(v)) candidate/phobos/std/loader.d
r418 r560 469 469 this(uint errcode) 470 470 { 471 version (linux) 472 { 473 char[80] buf = void; 474 super(std.string.toString(strerror_r(errcode, buf.ptr, buf.length)).idup); 475 } 476 else 477 { 471 478 super(std.string.toString(strerror(errcode)).idup); 479 } 472 480 } 473 481 } candidate/phobos/std/math.d
r544 r560 89 89 this(string msg) 90 90 { 91 super(msg ~ " not implemented");91 super(msg ~ " not implemented"); 92 92 } 93 93 } … … 947 947 * $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) ) 948 948 * ) 949 * 950 * Note: Not supported on windows 949 951 */ 950 952 real scalbn(real x, int n) … … 1252 1254 * If the fractional part of x is exactly 0.5, the return value is rounded 1253 1255 * away from zero. 1256 * 1257 * Note: Not supported on windows 1254 1258 */ 1255 1259 long lround(real x) … … 1287 1291 * $(TR $(TD != $(PLUSMN)$(INFIN)) $(TD $(PLUSMN)$(INFIN)) $(TD x) $(TD ?) $(TD no)) 1288 1292 * ) 1293 * 1294 * Note: remquo not supported on windows 1289 1295 */ 1290 1296 real remainder(real x, real y) { return std.c.math.remainderl(x, y); } … … 1593 1599 * exceptions will be raised if the function value is subnormal, and x is 1594 1600 * not equal to y. 1601 * 1602 * Note: real nextafter(real, real) not supported on windows 1595 1603 */ 1596 1604 real nextafter(real x, real y) 1597 1605 { 1598 return std.c.math.nextafterl(x, y); 1606 version (Windows) 1607 throw new NotImplemented("nextafter"); 1608 else 1609 return std.c.math.nextafterl(x, y); 1599 1610 } 1600 1611 … … 1614 1625 { 1615 1626 float a = 1; 1627 assert(is(typeof(nextafter(a, a)) == float)); 1628 assert(nextafter(a, a.infinity) > a); 1629 1616 1630 double b = 2; 1631 assert(is(typeof(nextafter(b, b)) == double)); 1632 assert(nextafter(b, b.infinity) > b); 1633 1634 // BUG 1772: temporarily disable real tests for nextafter 1635 // with reals on windows until dmc's runtime supports them. 1617 1636 real c = 3; 1618 assert(is(typeof(nextafter(a, a)) == float));1619 assert(is(typeof(nextafter(b, b)) == double));1620 1637 assert(is(typeof(nextafter(c, c)) == real)); 1621 assert(nextafter(a, a.infinity) > a); 1622 assert(nextafter(b, b.infinity) > b); 1623 assert(nextafter(c, c.infinity) > c); 1638 version(Windows) { 1639 bool threw = false; 1640 try { 1641 nextafter(c, c.infinity); 1642 assert(false, "shouldn't be reachable"); 1643 } catch (NotImplemented e) { 1644 threw = true; 1645 } 1646 if (!threw) assert(false, "failed to throw"); 1647 } else { 1648 assert(nextafter(c, c.infinity) > c); 1649 } 1624 1650 } 1625 1651 candidate/phobos/std/numeric.d
- Property svn:eol-stype set to native
candidate/phobos/std/path.d
r510 r560 251 251 /************************** 252 252 * Extracts the base name of a path and optionally chops off a 253 * specifi tsuffix.253 * specific suffix. 254 254 * 255 255 * This function will search $(D_PARAM fullname) from the end until candidate/phobos/std/process.d
r510 r560 146 146 Lerror: 147 147 retval = getErrno; 148 char[80] buf = void; 148 149 throw new Exception( 149 150 "Cannot spawn " ~ toString(pathname) ~ "; " 150 ~ toString(strerror (retval))151 ~ toString(strerror_r(retval, buf.ptr, buf.length)) 151 152 ~ " [errno " ~ toString(retval) ~ "]"); 152 153 } // _spawnvp candidate/phobos/std/random.d
r510 r560 655 655 { 656 656 // generate a random number i .. n 657 finalwhich = i + uniform!(size_t)(r, 0u, array.length - i);657 auto which = i + uniform!(size_t)(r, 0u, array.length - i); 658 658 swap(array[i], array[which]); 659 659 } candidate/phobos/std/socket.d
r418 r560 95 95 if(errorCode > 0) 96 96 { 97 const(char)* cs; 98 size_t len; 99 100 cs = strerror(errorCode); 101 len = strlen(cs); 97 char[80] buf; 98 auto cs = strerror_r(errorCode, buf.ptr, buf.length); 99 auto len = strlen(cs); 102 100 103 101 if(cs[len - 1] == '\n') candidate/phobos/std/stdio.d
r510 r560 121 121 122 122 this(uint errno) 123 { const(char*) s = std.string.strerror(errno); 123 { 124 version (linux) 125 { char[80] buf = void; 126 auto s = std.string.strerror_r(errno, buf.ptr, buf.length); 127 } 128 else 129 { 130 auto s = std.string.strerror(errno); 131 } 124 132 super(std.string.toString(s).idup); 125 133 } candidate/phobos/std/stream.d
r554 r560 2119 2119 2120 2120 /// creates file in requested mode 2121 void create(string filename, FileMode mode = FileMode.Out ) {2121 void create(string filename, FileMode mode = FileMode.OutNew) { 2122 2122 File sf = cast(File)s; 2123 2123 sf.create(filename,mode); candidate/phobos/std/string.d
r510 r560 68 68 invariant char[6] whitespace = " \t\v\r\n\f"; /// ASCII whitespace 69 69 70 constdchar LS = '\u2028'; /// UTF line separator71 constdchar PS = '\u2029'; /// UTF paragraph separator70 enum dchar LS = '\u2028'; /// UTF line separator 71 enum dchar PS = '\u2029'; /// UTF paragraph separator 72 72 73 73 /// Newline sequence for this system … … 1125 1125 */ 1126 1126 1127 string join( in string[] words, instring sep)1127 string join(string[] words, string sep) 1128 1128 { 1129 1129 char[] result; candidate/phobos/std/traits.d
r517 r560 535 535 else static if (is(T == uint)) alias uint unsigned; 536 536 else static if (is(T == ulong)) alias ulong unsigned; 537 else static if (is(T == char)) alias char unsigned; 538 else static if (is(T == wchar)) alias wchar unsigned; 539 else static if (is(T == dchar)) alias dchar unsigned; 537 540 else static if(is(T == enum)) 538 541 static if (T.sizeof == 1) alias ubyte unsigned; … … 550 553 } 551 554 555 /****** 556 * Returns the mutable version of the type T. 557 */ 558 559 template Mutable(T) 560 { 561 static if (is(T U == const(U))) 562 alias U Mutable; 563 else static if (is(T U == invariant(U))) 564 alias U Mutable; 565 else 566 alias T Mutable; 567 } candidate/phobos/std/typecons.d
- Property svn:eol-style set to native
r510 r560 217 217 ~enumPrinterImpl!(name, false, T[1 .. $]); 218 218 else 219 return " ";219 return "return null;"; 220 220 } 221 221 } candidate/phobos/std/variant.d
- Property svn:eol-stype set to native
r511 r560 240 240 case OpID.get: 241 241 return !tryPutting(cast(A*) pStore, *cast(TypeInfo*) parm, parm); 242 break; // for conformity243 242 case OpID.testConversion: 244 243 return !tryPutting(null, *cast(TypeInfo*) parm, null); 245 break;246 244 case OpID.compare: 247 245 auto me = cast(A*) pStore; … … 298 296 } 299 297 return int.min; // dunno 300 break;301 298 case OpID.toString: 302 299 auto target = cast(string*) parm; candidate/phobos/std/windows/charset.d
r418 r560 13 13 private import std.utf; 14 14 private import std.string; 15 16 /**17 * If non-zero, the application should use the W versions of Windows API18 * functions and std.utf.toUTF16z and toUTF8, rather than toMBSz and19 * fromMBSz.20 */21 int useWfuncs = 1;22 23 static this()24 {25 // Win 95, 98, ME do not implement the W functions26 // TODO: detect MSLU?27 useWfuncs = (GetVersion() < 0x80000000);28 }29 15 30 16 candidate/phobos/std/xml.d
- Property svn:eol-stype set to native
- Property svn:executable deleted
candidate/phobos/std/zip.d
r391 r560 22 22 private import std.date; 23 23 private import std.intrinsic; 24 import std.conv;25 24 26 25 //debug=print; … … 319 318 if (i + 22 + endcommentlength > data.length) 320 319 continue; 321 comment = to!(string)(data[i + 22 .. i + 22 + endcommentlength]);320 comment = cast(string)(data[i + 22 .. i + 22 + endcommentlength]); 322 321 endrecOffset = i; 323 322 break; … … 380 379 throw new ZipException("invalid directory entry 2"); 381 380 382 de.name = to!(string)(data[i .. i + namelen]);381 de.name = cast(string)(data[i .. i + namelen]); 383 382 i += namelen; 384 383 de.extra = data[i .. i + extralen]; 385 384 i += extralen; 386 de.comment = to!(string)(data[i .. i + commentlen]);385 de.comment = cast(string)(data[i .. i + commentlen]); 387 386 i += commentlen; 388 387 candidate/phobos/win32.mak
r516 r560 79 79 signals.obj cpuid.obj typetuple.obj traits.obj bind.obj \ 80 80 c_stdio.obj hiddenfunc.obj contracts.obj getopt.obj variant.obj \ 81 numeric.obj bitmanip.obj functional.obj algorithm.obj typecons.obj \ 81 82 ti_Ag.obj ti_C.obj ti_int.obj ti_char.obj \ 82 83 ti_wchar.obj ti_uint.obj ti_short.obj ti_ushort.obj \ … … 99 100 $(DOC)\std_random.html $(DOC)\std_file.html $(DOC)\std_date.html \ 100 101 $(DOC)\std_md5.html $(DOC)\std_zip.html $(DOC)\std_zlib.html \ 102 $(DOC)\std_algorithm.html \ 101 103 $(DOC)\std_bind.html \ 102 104 $(DOC)\std_bitarray.html \ 105 $(DOC)\std_bitmanip.html \ 103 106 $(DOC)\std_boxer.html \ 104 107 $(DOC)\std_contracts.html \ … … 109 112 $(DOC)\std_ctype.html \ 110 113 $(DOC)\std_demangle.html \ 114 $(DOC)\std_functional.html \ 111 115 $(DOC)\std_gc.html \ 112 116 $(DOC)\std_getopt.html \ … … 114 118 $(DOC)\std_metastrings.html \ 115 119 $(DOC)\std_mmfile.html \ 120 $(DOC)\std_numeric.html \ 116 121 $(DOC)\std_openrj.html \ 117 122 $(DOC)\std_outofmemory.html \ … … 126 131 $(DOC)\std_thread.html \ 127 132 $(DOC)\std_traits.html \ 133 $(DOC)\std_typecons.html \ 128 134 $(DOC)\std_typetuple.html \ 129 135 $(DOC)\std_uni.html \ … … 159 165 std\signals.d std\cpuid.d std\typetuple.d std\traits.d std\bind.d \ 160 166 std\metastrings.d std\hiddenfunc.d std\contracts.d std\getopt.d \ 161 std\variant.d 167 std\variant.d std\numeric.d std\bitmanip.d \ 168 std\functional.d std\algorithm.d std\typecons.d 162 169 163 170 SRC_STD_C= std\c\process.d std\c\stdlib.d std\c\time.d std\c\stdio.d \ … … 338 345 ### std 339 346 347 algorithm.obj : std\algorithm.d 348 $(DMD) -c $(DFLAGS) std\algorithm.d 349 340 350 array.obj : std\array.d 341 351 $(DMD) -c $(DFLAGS) std\array.d … … 353 363 $(DMD) -c $(DFLAGS) -inline std\bitarray.d 354 364 365 bitmanip.obj : std\bitmanip.d 366 $(DMD) -c $(DFLAGS) std\bitmanip.d 367 355 368 boxer.obj : std\boxer.d 356 369 $(DMD) -c $(DFLAGS) std\boxer.d … … 392 405 $(DMD) -c $(DFLAGS) std\format.d 393 406 407 functional.obj : std\functional.d 408 $(DMD) -c $(DFLAGS) std\functional.d 409 394 410 gc.obj : std\gc.d 395 411 $(DMD) -c $(DFLAGS) std\gc.d … … 422 438 $(DMD) -c $(DFLAGS) std\moduleinit.d 423 439 <
