Changeset 560

Show
Ignore:
Timestamp:
02/10/08 04:39:23 (7 months ago)
Author:
braddr
Message:

Merge -r514:559 trunk -> candidate

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • candidate/phobos/internal/gc/gc.d

    r516 r560  
    44 
    55/* 
    6  *  Copyright (C) 2004-2007 by Digital Mars, www.digitalmars.com 
     6 *  Copyright (C) 2004-2008 by Digital Mars, www.digitalmars.com 
    77 *  Written by Walter Bright 
    88 * 
     
    452452} 
    453453 
    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 */ 
    457456void _d_delarray(Array *p) 
    458457{ 
     
    467466} 
    468467 
     468/* Delete an array; ti is the element type. 
     469 * Should we zero out the array when done? 
     470 */ 
     471 
     472void _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 
    469495 
    470496void _d_delmemory(void* *p) 
     
    484510    //printf("new_finalizer(p = %p)\n", p); 
    485511    _d_callfinalizer(p); 
     512} 
     513 
     514extern (C) 
     515void _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    } 
    486524} 
    487525 
  • candidate/phobos/internal/object.d

    r554 r560  
    425425    /// Get type information on the contents of the type; null if not available 
    426426    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) { } 
    427433} 
    428434 
     
    450456    override uint flags() { return base.flags(); } 
    451457    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); } 
    452461 
    453462    TypeInfo base; 
     
    668677    override uint flags() { return value.flags(); } 
    669678 
     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 
    670700    TypeInfo value; 
    671701    size_t len; 
     
    907937        // Should use the one for strings. 
    908938        // BUG: relies on the GC not moving objects 
    909         auto q = cast(ubyte*)p; 
     939        auto q = cast(const(ubyte)*)p; 
    910940        for (size_t i = 0; i < init.length; i++) 
    911941        {   h = h * 9 + *q; 
     
    962992    override uint flags() { return m_flags; } 
    963993 
     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 
    9641006    string name; 
    9651007    void[] m_init;  // initializer; init.ptr == null if 0 initialize 
     
    9731015 
    9741016    const(MemberInfo[]) function(string) xgetMembers; 
     1017    void function(void*) xdtor; 
     1018    void function(void*) xpostblit; 
    9751019} 
    9761020 
     
    10351079        assert(0); 
    10361080    } 
     1081 
     1082    override void destroy(void *p) 
     1083    { 
     1084    assert(0); 
     1085    } 
     1086 
     1087    override void postblit(void *p) 
     1088    { 
     1089    assert(0); 
     1090    } 
    10371091} 
    10381092 
  • candidate/phobos/object.d

    r360 r560  
    8383    // 1:           // has possible pointers into GC memory 
    8484    OffsetTypeInfo[] offTi(); 
     85    void destroy(void *p); 
     86    void postblit(void *p); 
    8587} 
    8688 
     
    151153 
    152154    const(MemberInfo[]) function(string) xgetMembers; 
     155    void function(void*) xdtor; 
     156    void function(void*) xpostblit; 
    153157} 
    154158 
  • candidate/phobos/std.ddoc

    r489 r560  
    44 
    55<!-- 
    6     Copyright (c) 1999-2007 by Digital Mars 
     6    Copyright (c) 1999-2008 by Digital Mars 
    77    All Rights Reserved 
    88    Written by Walter Bright 
     
    1313<meta http-equiv="content-type" content="text/html; charset=utf-8" > 
    1414<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"> 
    1616</head> 
    1717 
     
    6363<div id="copyright"> 
    6464$(COPYRIGHT) | 
    65 Page generated by $(LINK2 http://www.digitalmars.com/d/ddoc.html, Ddoc). 
     65Page generated by $(LINK2 http://www.digitalmars.com/d/2.0/ddoc.html, Ddoc). 
    6666</div> 
    6767 
     
    9090<input id="q" name="q" size="10" value="RTL Search" onFocus='if(this.value == "RTL Search"){this.value="";}'> 
    9191<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"> 
    9393<input type="hidden" id="sourceid" name="sourceid" value="google-search"> 
    9494<input type="submit" id="submit" name="submit" value="Go"> 
     
    128128    $(LI <a href="std_file.html" title="Basic file operations">std.file</a>) 
    129129    $(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>) 
    130131    $(LI <a href="std_gc.html" title="Control the garbage collector">std.gc</a>) 
    131132    $(LI <a href="std_getopt.html" title="Command line options">std.getopt</a>) 
     
    144145    $(LI <a href="std_regexp.html" title="regular expressions">std.regexp</a>) 
    145146    $(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>) 
    146148    $(LI <a href="std_socket.html" title="Sockets">std.socket</a>) 
    147149    $(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  
    119119void swap(T)(ref T lhs, ref T rhs) 
    120120{ 
    121     final t = lhs; 
     121    auto t = lhs; 
    122122    lhs = rhs; 
    123123    rhs = t; 
     
    270270{ 
    271271    auto len = range.length; 
    272     final limit = len / 2; 
     272    const limit = len / 2; 
    273273    --len; 
    274274    for (uint i = 0; i != limit; ++i) 
    275275    { 
    276         final t = range[i]; 
     276        auto t = range[i]; 
    277277        range[i] = range[len - i]; 
    278278        range[len - i] = t; 
     
    391391    Iter getPivot(Iter)(Iter b, Iter e) 
    392392    { 
    393         final r = b + (e - b) / 2; 
     393        auto r = b + (e - b) / 2; 
    394394        return r; 
    395395    } 
  • candidate/phobos/std/bitmanip.d

    • Property svn:eol-style set to native
    r510 r560  
    4242        else 
    4343            alias ulong MasksType; 
    44         static const MasksType 
     44        enum MasksType 
    4545            maskAllElse = ((1uL << len) - 1u) << offset, 
    4646            maskMyself = ~maskAllElse, 
     
    165165template bitfields(T...) 
    166166{ 
    167     static const string bitfields = createFields!(createStoreName!(T)(), 0, T)(); 
     167    enum string bitfields = createFields!(createStoreName!(T)(), 0, T)(); 
    168168} 
    169169 
  • candidate/phobos/std/c/stdio.d

    r554 r560  
    1919version (Win32) 
    2020{ 
    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    } 
    3033} 
    3134 
    3235version (linux) 
    3336{ 
    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    } 
    3945} 
    4046 
  • candidate/phobos/std/c/string.d

    r294 r560  
    3939    int memicmp(in char* s1, in char* s2, size_t n);    /// 
    4040} 
     41 
     42version (linux) 
     43{ 
     44    const(char)* strerror_r(int errnum, char* buf, size_t buflen);  /// 
     45} 
  • candidate/phobos/std/c/windows/windows.d

    r554 r560  
    3737 
    3838    alias WCHAR* LPWSTR; 
    39     alias const(WCHAR*) LPCWSTR, PCWSTR; 
     39    alias const(WCHAR)* LPCWSTR, PCWSTR; 
    4040 
    4141    alias uint DWORD; 
     
    252252} 
    253253 
    254 const DWORD MAILSLOT_NO_MESSAGE = cast(DWORD)-1; 
    255 const DWORD MAILSLOT_WAIT_FOREVER = cast(DWORD)-1; 
     254enum 
     255
     256    DWORD MAILSLOT_NO_MESSAGE = cast(DWORD)-1, 
     257    DWORD MAILSLOT_WAIT_FOREVER = cast(DWORD)-1,  
     258
    256259 
    257260enum : uint 
     
    276279} 
    277280 
    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; 
     281enum 
     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
    281287 
    282288struct OVERLAPPED { 
  • candidate/phobos/std/contracts.d

    • Property svn:eol-stype set to native
  • candidate/phobos/std/conv.d

    r516 r560  
    13561356    version (Windows) 
    13571357    { 
    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        } 
    13591363    } 
    13601364 
     
    19731977    throw new ConvError("getComplexStrings() \"" ~ s ~ "\"" ~ " s1=\"" 
    19741978                             ~ s1 ~ "\"" ~ " s2=\"" ~ s2 ~ "\""); 
    1975         return 0; 
    19761979} 
    19771980 
  • candidate/phobos/std/file.d

    r554 r560  
    635635 */ 
    636636 
    637 string[] listdir(in string pathname, in string pattern) 
     637string[] listdir(string pathname, string pattern) 
    638638{   string[] result; 
    639639 
     
    655655/** Ditto */ 
    656656 
    657 string[] listdir(in string pathname, RegExp r) 
     657string[] listdir(string pathname, RegExp r) 
    658658{   string[] result; 
    659659 
     
    713713 */ 
    714714 
    715 void listdir(in string pathname, bool delegate(in string filename) callback) 
     715void listdir(in string pathname, bool delegate(string filename) callback) 
    716716{ 
    717717    bool listing(DirEntry* de) 
     
    863863private import std.c.linux.linux; 
    864864 
    865 extern (C) char* strerror(int); 
    866  
    867865/*********************************** 
    868866 */ 
     
    884882 
    885883    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); 
    887886    this(name, std.string.toString(s).idup); 
    888887    this.errno = errno; 
     
    955954    int fd; 
    956955    int numwritten; 
    957     const(char*) namez; 
    958  
    959     namez = toStringz(name); 
     956 
     957    auto namez = toStringz(name); 
    960958    fd = std.c.linux.linux.open(namez, O_CREAT | O_WRONLY | O_TRUNC, 0660); 
    961959    if (fd == -1) 
     
    10431041    int fd; 
    10441042    struct_stat statbuf; 
    1045     const(char*) namez; 
    1046  
    1047     namez = toStringz(name); 
     1043 
     1044    auto namez = toStringz(name); 
    10481045    //printf("file.getSize('%s')\n",namez); 
    10491046    fd = std.c.linux.linux.open(namez, O_RDONLY); 
     
    10851082{ 
    10861083    struct_stat statbuf; 
    1087     const(char*) namez; 
    1088  
    1089     namez = toStringz(name); 
     1084 
     1085    auto namez = toStringz(name); 
    10901086    if (std.c.linux.linux.stat(namez, &statbuf)) 
    10911087    { 
     
    12811277    int fd; 
    12821278    struct_stat statbuf; 
    1283     const(char*) namez; 
    1284  
    1285     namez = toStringz(name); 
     1279 
     1280    auto namez = toStringz(name); 
    12861281    if (std.c.linux.linux.stat(namez, &statbuf)) 
    12871282    { 
     
    16201615                break; 
    16211616            } 
    1622             return result == 0; 
     1617            return result == 0;  
    16231618        } 
    16241619 
  • candidate/phobos/std/format.d

    r554 r560  
    17721772 * 'w'. 
    17731773 */ 
    1774 private void formatIntegral(Writer, D)(ref Writer w, D arg, FormatInfo f) 
     1774private void formatIntegral(Writer, D)(ref Writer w, D argx, FormatInfo f) 
    17751775{ 
     1776    Mutable!(D) arg = argx; 
    17761777    if (f.spec == 'r') 
    17771778    { 
     
    18381839        char buffer[64]; // 64 bits in base 2 at most 
    18391840        uint i = buffer.length; 
    1840         auto n = cast(unsigned!(D)) arg; 
     1841        auto n = cast(unsigned!(Mutable!(D))) arg; 
    18411842        do 
    18421843        { 
     
    19421943    //writeln(sprintfSpec); 
    19431944    char[512] buf; 
    1944     final n = snprintf(buf.ptr, buf.length, 
     1945    auto n = snprintf(buf.ptr, buf.length, 
    19451946                       sprintfSpec.ptr, 
    19461947                       f.width, 
     
    21082109{ 
    21092110    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; 
    21112112    const(void)* argsAddresses[len] = void; 
    21122113    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  
    440440    if (!arg.length || arg[0] != optChar) return false; 
    441441    arg = arg[1 .. $]; 
    442     auto isLong = arg.length > 1 && arg[0] == optChar; 
     442    const isLong = arg.length > 1 && arg[0] == optChar; 
    443443    if (isLong) arg = arg[1 .. $]; 
    444     auto eqPos = find(arg, assignChar); 
     444    const eqPos = find(arg, assignChar); 
    445445    if (eqPos >= 0) { 
    446446        value = arg[eqPos + 1 .. $]; 
     
    451451    //writeln("Arg: ", arg, " pattern: ", optPattern, " value: ", value); 
    452452    // Split the option 
    453     auto variants = split(optPattern, "|"); 
     453    const variants = split(optPattern, "|"); 
    454454    foreach (v ; variants) { 
    455455        if (arg == v || !cfg.caseSensitive && toupper(arg) == toupper(v)) 
  • candidate/phobos/std/loader.d

    r418 r560  
    469469    this(uint errcode) 
    470470    { 
     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      { 
    471478    super(std.string.toString(strerror(errcode)).idup); 
     479      } 
    472480    } 
    473481} 
  • candidate/phobos/std/math.d

    r544 r560  
    8989    this(string msg) 
    9090    { 
    91     super(msg ~ "not implemented"); 
     91    super(msg ~ " not implemented"); 
    9292    } 
    9393} 
     
    947947 *  $(TR $(TD $(PLUSMN)0.0)      $(TD $(PLUSMN)0.0) ) 
    948948 *  ) 
     949 * 
     950 * Note: Not supported on windows 
    949951 */ 
    950952real scalbn(real x, int n) 
     
    12521254 * If the fractional part of x is exactly 0.5, the return value is rounded 
    12531255 * away from zero. 
     1256 * 
     1257 * Note: Not supported on windows 
    12541258 */ 
    12551259long lround(real x) 
     
    12871291 *  $(TR $(TD != $(PLUSMN)$(INFIN)) $(TD $(PLUSMN)$(INFIN)) $(TD x)               $(TD ?)   $(TD no)) 
    12881292 *  ) 
     1293 * 
     1294 * Note: remquo not supported on windows 
    12891295 */ 
    12901296real remainder(real x, real y) { return std.c.math.remainderl(x, y); } 
     
    15931599 * exceptions will be raised if the function value is subnormal, and x is  
    15941600 * not equal to y.  
     1601 * 
     1602 * Note: real nextafter(real, real) not supported on windows 
    15951603 */ 
    15961604real nextafter(real x, real y) 
    15971605{ 
    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); 
    15991610} 
    16001611 
     
    16141625{ 
    16151626    float a = 1; 
     1627    assert(is(typeof(nextafter(a, a)) == float)); 
     1628    assert(nextafter(a, a.infinity) > a); 
     1629 
    16161630    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. 
    16171636    real c = 3; 
    1618     assert(is(typeof(nextafter(a, a)) == float)); 
    1619     assert(is(typeof(nextafter(b, b)) == double)); 
    16201637    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    } 
    16241650} 
    16251651 
  • candidate/phobos/std/numeric.d

    • Property svn:eol-stype set to native
  • candidate/phobos/std/path.d

    r510 r560  
    251251/************************** 
    252252 * Extracts the base name of a path and optionally chops off a 
    253  * specifit suffix. 
     253 * specific suffix. 
    254254 * 
    255255 * This function will search $(D_PARAM fullname) from the end until 
  • candidate/phobos/std/process.d

    r510 r560  
    146146Lerror: 
    147147    retval = getErrno; 
     148    char[80] buf = void; 
    148149    throw new Exception( 
    149150        "Cannot spawn " ~ toString(pathname) ~ "; " 
    150                       ~ toString(strerror(retval)) 
     151                      ~ toString(strerror_r(retval, buf.ptr, buf.length)) 
    151152                      ~ " [errno " ~ toString(retval) ~ "]"); 
    152153}   // _spawnvp 
  • candidate/phobos/std/random.d

    r510 r560  
    655655    { 
    656656        // generate a random number i .. n 
    657         final which = i + uniform!(size_t)(r, 0u, array.length - i); 
     657        auto which = i + uniform!(size_t)(r, 0u, array.length - i); 
    658658        swap(array[i], array[which]); 
    659659    } 
  • candidate/phobos/std/socket.d

    r418 r560  
    9595            if(errorCode > 0) 
    9696            { 
    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); 
    102100                 
    103101                if(cs[len - 1] == '\n') 
  • candidate/phobos/std/stdio.d

    r510 r560  
    121121 
    122122    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    } 
    124132    super(std.string.toString(s).idup); 
    125133    } 
  • candidate/phobos/std/stream.d

    r554 r560  
    21192119 
    21202120  /// creates file in requested mode 
    2121   void create(string filename, FileMode mode = FileMode.Out) { 
     2121  void create(string filename, FileMode mode = FileMode.OutNew) { 
    21222122    File sf = cast(File)s; 
    21232123    sf.create(filename,mode); 
  • candidate/phobos/std/string.d

    r510 r560  
    6868invariant char[6] whitespace = " \t\v\r\n\f";           /// ASCII whitespace 
    6969 
    70 const dchar LS = '\u2028';    /// UTF line separator 
    71 const dchar PS = '\u2029';    /// UTF paragraph separator 
     70enum dchar LS = '\u2028'; /// UTF line separator 
     71enum dchar PS = '\u2029'; /// UTF paragraph separator 
    7272 
    7373/// Newline sequence for this system 
     
    11251125 */ 
    11261126 
    1127 string join(in string[] words, in string sep) 
     1127string join(string[] words, string sep) 
    11281128{ 
    11291129    char[] result; 
  • candidate/phobos/std/traits.d

    r517 r560  
    535535  else static if (is(T == uint)) alias uint unsigned; 
    536536  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; 
    537540  else static if(is(T == enum))  
    538541       static if (T.sizeof == 1) alias ubyte unsigned; 
     
    550553} 
    551554 
     555/****** 
     556 * Returns the mutable version of the type T. 
     557 */ 
     558 
     559template 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  
    217217                ~enumPrinterImpl!(name, false, T[1 .. $]); 
    218218        else 
    219             return ""; 
     219            return "return null;"; 
    220220    } 
    221221} 
  • candidate/phobos/std/variant.d

    • Property svn:eol-stype set to native
    r511 r560  
    240240        case OpID.get: 
    241241            return !tryPutting(cast(A*) pStore, *cast(TypeInfo*) parm, parm); 
    242             break; // for conformity 
    243242        case OpID.testConversion: 
    244243            return !tryPutting(null, *cast(TypeInfo*) parm, null); 
    245             break; 
    246244        case OpID.compare: 
    247245            auto me = cast(A*) pStore; 
     
    298296            } 
    299297            return int.min; // dunno 
    300             break; 
    301298        case OpID.toString: 
    302299            auto target = cast(string*) parm; 
  • candidate/phobos/std/windows/charset.d

    r418 r560  
    1313private import std.utf; 
    1414private import std.string; 
    15  
    16 /** 
    17  * If non-zero, the application should use the W versions of Windows API 
    18  * functions and std.utf.toUTF16z and toUTF8, rather than toMBSz and 
    19  * fromMBSz. 
    20  */ 
    21 int useWfuncs = 1; 
    22  
    23 static this() 
    24 { 
    25     // Win 95, 98, ME do not implement the W functions 
    26     // TODO: detect MSLU? 
    27     useWfuncs = (GetVersion() < 0x80000000); 
    28 } 
    2915 
    3016 
  • candidate/phobos/std/xml.d

    • Property svn:eol-stype set to native
    • Property svn:executable deleted
  • candidate/phobos/std/zip.d

    r391 r560  
    2222private import std.date; 
    2323private import std.intrinsic; 
    24 import std.conv; 
    2524 
    2625//debug=print; 
     
    319318        if (i + 22 + endcommentlength > data.length) 
    320319            continue; 
    321         comment = to!(string)(data[i + 22 .. i + 22 + endcommentlength]); 
     320        comment = cast(string)(data[i + 22 .. i + 22 + endcommentlength]); 
    322321        endrecOffset = i; 
    323322        break; 
     
    380379        throw new ZipException("invalid directory entry 2"); 
    381380 
    382         de.name = to!(string)(data[i .. i + namelen]); 
     381        de.name = cast(string)(data[i .. i + namelen]); 
    383382        i += namelen; 
    384383        de.extra = data[i .. i + extralen]; 
    385384        i += extralen; 
    386         de.comment = to!(string)(data[i .. i + commentlen]); 
     385        de.comment = cast(string)(data[i .. i + commentlen]); 
    387386        i += commentlen; 
    388387 
  • candidate/phobos/win32.mak

    r516 r560  
    7979    signals.obj cpuid.obj typetuple.obj traits.obj bind.obj \ 
    8080    c_stdio.obj hiddenfunc.obj contracts.obj getopt.obj variant.obj \ 
     81    numeric.obj bitmanip.obj functional.obj algorithm.obj typecons.obj \ 
    8182    ti_Ag.obj ti_C.obj ti_int.obj ti_char.obj \ 
    8283    ti_wchar.obj ti_uint.obj ti_short.obj ti_ushort.obj \ 
     
    99100    $(DOC)\std_random.html $(DOC)\std_file.html $(DOC)\std_date.html \ 
    100101    $(DOC)\std_md5.html $(DOC)\std_zip.html $(DOC)\std_zlib.html \ 
     102    $(DOC)\std_algorithm.html \ 
    101103    $(DOC)\std_bind.html \ 
    102104    $(DOC)\std_bitarray.html \ 
     105    $(DOC)\std_bitmanip.html \ 
    103106    $(DOC)\std_boxer.html \ 
    104107    $(DOC)\std_contracts.html \ 
     
    109112    $(DOC)\std_ctype.html \ 
    110113    $(DOC)\std_demangle.html \ 
     114    $(DOC)\std_functional.html \ 
    111115    $(DOC)\std_gc.html \ 
    112116    $(DOC)\std_getopt.html \ 
     
    114118    $(DOC)\std_metastrings.html \ 
    115119    $(DOC)\std_mmfile.html \ 
     120    $(DOC)\std_numeric.html \ 
    116121    $(DOC)\std_openrj.html \ 
    117122    $(DOC)\std_outofmemory.html \ 
     
    126131    $(DOC)\std_thread.html \ 
    127132    $(DOC)\std_traits.html \ 
     133    $(DOC)\std_typecons.html \ 
    128134    $(DOC)\std_typetuple.html \ 
    129135    $(DOC)\std_uni.html \ 
     
    159165    std\signals.d std\cpuid.d std\typetuple.d std\traits.d std\bind.d \ 
    160166    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 
    162169 
    163170SRC_STD_C= std\c\process.d std\c\stdlib.d std\c\time.d std\c\stdio.d \ 
     
    338345### std 
    339346 
     347algorithm.obj : std\algorithm.d 
     348    $(DMD) -c $(DFLAGS) std\algorithm.d 
     349 
    340350array.obj : std\array.d 
    341351    $(DMD) -c $(DFLAGS) std\array.d 
     
    353363    $(DMD) -c $(DFLAGS) -inline std\bitarray.d 
    354364 
     365bitmanip.obj : std\bitmanip.d 
     366    $(DMD) -c $(DFLAGS) std\bitmanip.d 
     367 
    355368boxer.obj : std\boxer.d 
    356369    $(DMD) -c $(DFLAGS) std\boxer.d 
     
    392405    $(DMD) -c $(DFLAGS) std\format.d 
    393406 
     407functional.obj : std\functional.d 
     408    $(DMD) -c $(DFLAGS) std\functional.d 
     409 
    394410gc.obj : std\gc.d 
    395411    $(DMD) -c $(DFLAGS) std\gc.d 
     
    422438    $(DMD) -c $(DFLAGS) std\moduleinit.d 
    423439<