Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3890

Show
Ignore:
Timestamp:
08/18/08 17:57:17 (3 months ago)
Author:
keinfarbton
Message:

Fixed many compile error, but DMD 2.018 on linux segfaulted on 30 file:
tango/io/File.d
tango/io/FileSystem.d
tango/io/MappedBuffer.d
tango/io/TempFile.d
tango/io/UnicodeFile.d
tango/io/compress/Zip.d
tango/io/device/FileConduit.d
tango/io/stream/DataFileStream.d
tango/io/stream/FileStream.d
tango/io/stream/TextFileStream.d
tango/io/vfs/FileFolder.d
tango/io/vfs/VirtualFolder.d
tango/io/vfs/ZipFolder.d
tango/net/C/OpenSSL.d
tango/net/PKI.d
tango/net/SSLServerSocket.d
tango/net/SSLSocketConduit.d
tango/net/cluster/tina/ClusterQueue.d
tango/net/cluster/tina/QueueFile.d
tango/net/cluster/tina/QueueServer.d
tango/net/cluster/tina/QueueThread.d
tango/net/ftp/FtpClient.d
tango/net/http/HttpTokens.d
tango/sys/Environment.d
tango/text/Properties.d
tango/text/Regex.d
tango/text/stream/RegexIterator.d
tango/util/log/AppendFile.d
tango/util/log/AppendFiles.d
tango/util/log/ConfigProps.d

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/D2.0/lib/build-tango.sh

    r3724 r3890  
    106106    then 
    107107        if [ $VERBOSE == 1 ]; then echo "[$DC] $FILENAME"; fi 
    108         $DC $WARN -c $INLINE $DEBUG $RELEASE -version=Posix -version=Tango -of$OBJNAME $FILENAME 
     108        echo $DC $WARN -c $INLINE $DEBUG $RELEASE -version=Posix -version=Tango -Ilib/common -of$OBJNAME $FILENAME 
     109        $DC $WARN -c $INLINE $DEBUG $RELEASE -version=Posix -version=Tango -Ilib/common -of$OBJNAME $FILENAME 
    109110        if [ "$?" != 0 ] 
    110111        then 
  • branches/experimental/D2.0/lib/common/tango/core/Exception.d

    r3725 r3890  
    248248private class ClusterException : IOException 
    249249{ 
    250     this( char[] msg ) 
     250    this( Cutf8 msg ) 
    251251    { 
    252252        super( msg ); 
     
    357357class RegistryException : Exception 
    358358{ 
    359     this( char[] msg ) 
     359    this( Cutf8 msg ) 
    360360    { 
    361361        super( msg ); 
  • branches/experimental/D2.0/lib/common/tango/posix.mak

    r3724 r3890  
    2424#CFLAGS=-g $(ADD_CFLAGS) 
    2525 
    26 DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS) 
     26DFLAGS=-release -O -inline -w -nofloat -I.. -version=Posix $(ADD_DFLAGS) 
    2727#DFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS) 
    2828 
  • branches/experimental/D2.0/lib/compiler/dmd/genobj.d

    r3889 r3890  
    191191    /** 
    192192     * Create instance of Object represented by 'this'. 
     193     * Returns: 
     194     *  the object created, or null if the Object does 
     195     *  does not have a default constructor 
    193196     */ 
    194197    Object create() 
     
    302305    /// Get type information on the contents of the type; null if not available 
    303306    OffsetTypeInfo[] offTi() { return null; } 
     307 
     308    /// Run the destructor on the object and all its sub-objects 
     309    void destroy(void *p) { } 
     310 
     311    /// Run the postblit on the object and all its sub-objects 
     312    void postblit(void *p) { } 
    304313} 
    305314 
     
    327336    override uint flags() { return base.flags(); } 
    328337    override void[] init() { return m_init.length ? m_init : base.init(); } 
     338 
     339    override void destroy(void *p) { base.destroy(p); } 
     340    override void postblit(void *p) { base.postblit(p); } 
    329341 
    330342    TypeInfo base; 
     
    544556    override TypeInfo next() { return value; } 
    545557    override uint flags() { return value.flags(); } 
     558 
     559    override void destroy(void *p) 
     560    { 
     561    auto sz = value.tsize(); 
     562    p += sz * len; 
     563    foreach (i; 0 .. len) 
     564    { 
     565        p -= sz; 
     566        value.destroy(p); 
     567    } 
     568    } 
     569 
     570    override void postblit(void *p) 
     571    { 
     572    auto sz = value.tsize(); 
     573    foreach (i; 0 .. len) 
     574    { 
     575        value.postblit(p); 
     576        p += sz; 
     577    } 
     578    } 
    546579 
    547580    TypeInfo value; 
     
    783816            // Should use the one for strings. 
    784817            // BUG: relies on the GC not moving objects 
    785             auto q = p; 
     818       auto q = cast(const(ubyte)*)p; 
    786819            for (size_t i = 0; i < init.length; i++) 
    787             {   h = h * 9 + *cast(ubyte*)q; 
     820       {   h = h * 9 + *q; 
    788821                q++; 
    789822            } 
     
    838871    override uint flags() { return m_flags; } 
    839872 
     873    override void destroy(void *p) 
     874    { 
     875    if (xdtor) 
     876        (*xdtor)(p); 
     877    } 
     878 
     879    override void postblit(void *p) 
     880    { 
     881    if (xpostblit) 
     882        (*xpostblit)(p); 
     883    } 
     884 
    840885    Cutf8 name; 
    841886    void[] m_init;      // initializer; init.ptr == null if 0 initialize 
     
    849894 
    850895    const(MemberInfo[]) function(Cutf8) xgetMembers; 
     896    void function(void*) xdtor; 
     897    void function(void*) xpostblit; 
    851898} 
    852899 
     
    911958        assert(0); 
    912959    } 
     960 
     961    override void destroy(void *p) 
     962    { 
     963    assert(0); 
     964    } 
     965 
     966    override void postblit(void *p) 
     967    { 
     968    assert(0); 
     969    } 
    913970} 
    914971 
    915972class TypeInfo_Const : TypeInfo 
    916973{ 
    917     override Cutf8 toUtf8() { return cast(Cutf8) 
    918             ("const " ~ base.toUtf8()); } 
     974    override Cutf8 toString() { return cast(Cutf8) 
     975            ("const " ~ base.toString()); } 
    919976 
    920977    override int opEquals(Object o) { return base.opEquals(o); } 
     
    934991class TypeInfo_Invariant : TypeInfo_Const 
    935992{ 
    936     override Cutf8 toUtf8() { return cast(Cutf8) 
    937             ("invariant " ~ base.toUtf8()); } 
     993    override Cutf8 toString() { return cast(Cutf8) 
     994            ("invariant(" ~ base.toString() ~ ")"); } 
    938995} 
    939996 
     
    10041061    Exception   next; 
    10051062 
    1006     this( char[] msg, Exception next = null ) 
     1063    this( Cutf8 msg, Exception next = null ) 
    10071064    { 
    10081065        this.msg = msg; 
  • branches/experimental/D2.0/lib/compiler/dmd/posix.mak

    r3889 r3890  
    2121#CFLAGS=-g $(ADD_CFLAGS) 
    2222 
    23 DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS) 
     23DFLAGS=-release -O -inline -w -nofloat -I../../common -version=Posix $(ADD_DFLAGS) 
    2424#DFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS) 
    2525 
     
    6868    adi.o \ 
    6969    alloca.o \ 
     70    arrayassign.o \ 
    7071    arraybyte.o \ 
    7172    arraycast.o \ 
  • branches/experimental/D2.0/lib/compiler/dmd/util/cpuid.d

    r3886 r3890  
     1// Written in the D programming language 
     2 
    13/** 
    24 * Identify the characteristics of the host CPU. 
     
    4244 
    4345private import tango.stdc.string : strlen; 
     46alias invariant(char)[] string; 
    4447 
    4548version(D_InlineAsm_X86) 
    4649{ 
     50    /+ 
     51    /// Returns everything as a printable string 
     52    string toString() 
     53    { 
     54        string feats; 
     55        if (mmx)                        feats ~= "MMX "; 
     56        if (fxsr)                       feats ~= "FXSR "; 
     57        if (sse)                        feats ~= "SSE "; 
     58        if (sse2)                       feats ~= "SSE2 "; 
     59        if (sse3)                       feats ~= "SSE3 "; 
     60        if (ssse3)                      feats ~= "SSSE3 "; 
     61        if (amd3dnow)                   feats ~= "3DNow! "; 
     62        if (amd3dnowExt)                feats ~= "3DNow!+ "; 
     63        if (amdMmx)                     feats ~= "MMX+ "; 
     64        if (ia64)                       feats ~= "IA-64 "; 
     65        if (amd64)                      feats ~= "AMD64 "; 
     66        if (hyperThreading)             feats ~= "HTT"; 
     67 
     68        return format( 
     69            "Vendor string:    %s\n", vendor, 
     70            "Processor string: %s\n", processor, 
     71            "Signature:        Family=%d Model=%d Stepping=%d\n", family, model, stepping, 
     72            "Features:         %s\n", feats, 
     73            "Multithreading:   %d threads / %d cores\n", threadsPerCPU, coresPerCPU); 
     74 
     75    } 
     76    +/ 
     77 
    4778    /// Returns vendor string 
    48     char[] vendor()             {return vendorStr;} 
     79    string vendor()             {return vendorStr.idup;} // todo: optimize 
    4980    /// Returns processor string 
    50     char[] processor()          {return processorStr;} 
     81    string processor()          {return processorStr;} 
    5182 
    5283    /// Is MMX supported? 
     
    187218    uint _stepping, _model, _family; 
    188219 
    189     char[12] vendorStr = ""
    190     char[] processorStr = ""; 
     220    char[12] vendorStr = 0
     221    string processorStr = ""; 
    191222 
    192223    uint maxThreads=1; 
     
    251282 
    252283        // seems many intel processors prepend whitespace 
    253         processorStr = strip(toString(dst)).dup; 
     284        processorStr = strip(toString(dst)).idup; 
    254285    } 
    255286 
     
    343374        } 
    344375    } 
    345  
    346376    /*************************************************************************** 
    347377     * Support code for above, from std.string and std.ctype 
     
    427457        } 
    428458    } 
     459 
    429460} 
    430461else 
    431462{ 
     463    char[] toString() { return "unknown CPU\n"; } 
     464 
    432465    char[] vendor()             {return "unknown vendor"; } 
    433466    char[] processor()          {return "unknown processor"; } 
  • branches/experimental/D2.0/lib/compiler/dmd/win32.mak

    r3889 r3890  
    6464    aApplyR.obj \ 
    6565    adi.obj \ 
     66    arrayassign.obj \ 
    6667    arraybyte.obj \ 
    6768    arraycast.obj \ 
  • branches/experimental/D2.0/lib/dmd-posix.mak

    r3724 r3890  
    2424CC=gcc 
    2525LC=$(AR) -qsv 
    26 DC=dmd 
     26DC=~/dmd-2.015/dmd/bin/dmd 
    2727 
    2828ADD_CFLAGS=-m32 
  • branches/experimental/D2.0/lib/dmdinclude

    r3886 r3890  
    5252    else 
    5353        echo ">> D 2.0 not supported in this code base" 
    54         exit 1 
     54        #exit 1 
    5555    fi 
    5656} 
  • branches/experimental/D2.0/lib/gc/basic/posix.mak

    r3724 r3890  
    2424#CFLAGS=-g $(ADD_CFLAGS) 
    2525 
    26 DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS) 
     26DFLAGS=-release -O -inline -w -nofloat -I../../common -version=Posix $(ADD_DFLAGS) 
    2727#DFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS) 
    2828 
  • branches/experimental/D2.0/tango/core/Atomic.d

    r3724 r3890  
    376376                static if( needsLoadBarrier!(ms) ) 
    377377                { 
    378                     volatile asm 
     378                    //TODO: check removed volatile 
     379                    /+volatile+/ asm 
    379380                    { 
    380381                        mov DL, 42; 
     
    387388                else 
    388389                { 
    389                     volatile 
     390                    //TODO: check removed volatile 
     391//                     volatile 
    390392                    { 
    391393                        return val; 
     
    401403                static if( needsLoadBarrier!(ms) ) 
    402404                { 
    403                     volatile asm 
     405                    //TODO: check removed volatile 
     406                    /+volatile+/ asm 
    404407                    { 
    405408                        mov DX, 42; 
     
    412415                else 
    413416                { 
    414                     volatile 
     417                    //TODO: check removed volatile 
     418//                     volatile 
    415419                    { 
    416420                        return val; 
     
    427431                static if( needsLoadBarrier!(ms) ) 
    428432                { 
    429                     volatile asm 
     433                    //TODO: check removed volatile 
     434                    /+volatile+/ asm 
    430435                    { 
    431436                        mov EDX, 42; 
     
    438443                else 
    439444                { 
    440                     volatile 
     445                    //TODO: check removed volatile 
     446//                     volatile 
    441447                    { 
    442448                        return val; 
     
    460466                    static if( needsLoadBarrier!(ms) ) 
    461467                    { 
    462                         volatile asm 
     468                    //TODO: check removed volatile 
     469                        /+volatile+/ asm 
    463470                        { 
    464471                            mov RAX, val; 
     
    469476                    else 
    470477                    { 
    471                         volatile 
     478                    //TODO: check removed volatile 
     479//                         volatile 
    472480                        { 
    473481                            return val; 
     
    523531                static if( needsStoreBarrier!(ms) ) 
    524532                { 
    525                     volatile asm 
     533                    //TODO: check removed volatile 
     534                    /+volatile+/ asm 
    526535                    { 
    527536                        mov EAX, val; 
     
    533542                else 
    534543                { 
    535                     volatile asm 
     544                    //TODO: check removed volatile 
     545                    /+volatile+/ asm 
    536546                    { 
    537547                        mov EAX, val; 
     
    550560                static if( needsStoreBarrier!(ms) ) 
    551561                { 
    552                     volatile asm 
     562                    //TODO: check removed volatile 
     563                    /+volatile+/ asm 
    553564                    { 
    554565                        mov EAX, val; 
     
    560571                else 
    561572                { 
    562                     volatile asm 
     573                    //TODO: check removed volatile 
     574                    /+volatile+/ asm 
    563575                    { 
    564576                        mov EAX, val; 
     
    577589                static if( needsStoreBarrier!(ms) ) 
    578590                { 
    579                     volatile asm 
     591                    //TODO: check removed volatile 
     592                    /+volatile+/ asm 
    580593                    { 
    581594                        mov EAX, val; 
     
    587600                else 
    588601                { 
    589                     volatile asm 
     602                    //TODO: check removed volatile 
     603                    /+volatile+/ asm 
    590604                    { 
    591605                        mov EAX, val; 
     
    611625                    static if( needsStoreBarrier!(ms) ) 
    612626                    { 
    613                         volatile asm 
     627                    //TODO: check removed volatile 
     628                        /+volatile+/ asm 
    614629                        { 
    615630                            mov RAX, val; 
     
    621636                    else 
    622637                    { 
    623                         volatile asm 
     638                    //TODO: check removed volatile 
     639                        /+volatile+/ asm 
    624640                        { 
    625641                            mov RAX, val; 
     
    680696 
    681697 
    682                 volatile asm 
     698                    //TODO: check removed volatile 
     699                /+volatile+/ asm 
    683700                { 
    684701                    mov DL, newval; 
     
    697714 
    698715 
    699                 volatile asm 
     716                    //TODO: check removed volatile 
     717                /+volatile+/ asm 
    700718                { 
    701719                    mov DX, newval; 
     
    714732 
    715733 
    716                 volatile asm 
     734                    //TODO: check removed volatile 
     735                /+volatile+/ asm 
    717736                { 
    718737                    mov EDX, newval; 
     
    738757 
    739758 
    740                     volatile asm 
     759                    //TODO: check removed volatile 
     760                    /+volatile+/ asm 
    741761                    { 
    742762                        mov RDX, newval; 
     
    755775 
    756776 
    757                     volatile asm 
     777                    //TODO: check removed volatile 
     778                    /+volatile+/ asm 
    758779                    { 
    759780                        push EDI; 
     
    815836 
    816837 
    817                 volatile asm 
     838                    //TODO: check removed volatile 
     839                /+volatile+/ asm 
    818840                { 
    819841                    mov EAX, val; 
     
    830852 
    831853 
    832                 volatile asm 
     854                    //TODO: check removed volatile 
     855                /+volatile+/ asm 
    833856                { 
    834857                    mov EAX, val; 
     
    845868 
    846869 
    847                 volatile asm 
     870                    //TODO: check removed volatile 
     871                /+volatile+/ asm 
    848872                { 
    849873                    mov EAX, val; 
     
    867891 
    868892 
    869                     volatile asm 
     893                    //TODO: check removed volatile 
     894                    /+volatile+/ asm 
    870895                    { 
    871896                        mov RAX, val; 
     
    927952 
    928953 
    929                 volatile asm 
     954                    //TODO: check removed volatile 
     955                /+volatile+/ asm 
    930956                { 
    931957                    mov EAX, val; 
     
    942968 
    943969 
    944                 volatile asm 
     970                    //TODO: check removed volatile 
     971                /+volatile+/ asm 
    945972                { 
    946973                    mov EAX, val; 
     
    957984 
    958985 
    959                 volatile asm 
     986                    //TODO: check removed volatile 
     987                /+volatile+/ asm 
    960988                { 
    961989                    mov EAX, val; 
     
    9791007 
    9801008 
    981                     volatile asm 
     1009                    //TODO: check removed volatile 
     1010                    /+volatile+/ asm 
    9821011                    { 
    9831012                        mov RAX, val; 
     
    10821111                else 
    10831112                { 
    1084                     volatile 
     1113                    //TODO: check removed volatile 
     1114//                     volatile 
    10851115                    { 
    10861116                        return val; 
     
    11321162                else 
    11331163                { 
    1134                     volatile 
     1164                    //TODO: check removed volatile 
     1165//                     volatile 
    11351166                    { 
    11361167                        val = newval; 
  • branches/experimental/D2.0/tango/core/BitArray.d

    r3724 r3890  
    155155            (*this)[i] = b; 
    156156        } 
     157    } 
     158 
     159    // TODO: check if this implementation is correct. 
     160    // a compiler error was issued for this opAssign missing in e.g. reverse() "return *this;" 
     161    void opAssign( BitArray other ) 
     162    { 
     163        auto copy = other.dup; 
     164        this.length = copy.length; 
     165        this.ptr = copy.ptr; 
    157166    } 
    158167 
  • branches/experimental/D2.0/tango/io/FilePath.d

    r3887 r3890  
    1414        author:         Kris 
    1515 
    16         FilePath provides a means to efficiently edit path components and  
     16        FilePath provides a means to efficiently edit path components and 
    1717        of accessing the underlying file system. 
    1818 
     
    4949 
    5050        FilePath is designed to be transformed, thus each mutating method 
    51         modifies the internal content.  
     51        modifies the internal content. 
    5252 
    5353        Note that patterns of adjacent '.' separators are treated specially 
    5454        in that they will be assigned to the name where there is no distinct 
    55         suffix. In addition, a '.' at the start of a name signifies it does  
     55        suffix. In addition, a '.' at the start of a name signifies it does 
    5656        not belong to the suffix i.e. ".file" is a name rather than a suffix. 
    5757        Patterns of intermediate '.' characters will otherwise be assigned 
     
    151151        ***********************************************************************/ 
    152152 
    153         final char[] cString () 
     153        final Cutf8 cString () 
    154154        { 
    155155                return p.fp [0 .. p.end_+1]; 
     
    834834        ***********************************************************************/ 
    835835 
    836         final FilePath copy (char[] source) 
     836        final FilePath copy (Cutf8 source) 
    837837        { 
    838838                FS.copy (source~'\0', cString); 
     
    997997        ***********************************************************************/ 
    998998 
    999         abstract char[] cString (); 
     999        abstract Cutf8 cString (); 
    10001000 
    10011001        /*********************************************************************** 
  • branches/experimental/D2.0/tango/io/Path.d

    r3889 r3890  
    99        author:         Kris 
    1010 
    11         A more direct route to the file-system than FilePath, but with  
     11        A more direct route to the file-system than FilePath, but with 
    1212        the potential overhead of heap activity. Use this if you don't 
    13         need path editing features. For example, if all you want is to  
    14         see if some path exists, using this module would likely be more  
     13        need path editing features. For example, if all you want is to 
     14        see if some path exists, using this module would likely be more 
    1515        convenient than FilePath. For example: 
    1616        --- 
    17         if (exists ("some/file/path"))  
     17        if (exists ("some/file/path")) 
    1818            ... 
    1919        --- 
    2020 
    21         These functions may be less efficient than FilePath because they  
     21        These functions may be less efficient than FilePath because they 
    2222        may have to attach a null to the filename for each underlying O/S 
    23         call. Use Path when you need pedestrian access to the file-system,  
     23        call. Use Path when you need pedestrian access to the file-system, 
    2424        and are not manipulating the path components. Use FilePath where 
    2525        path editing or mutation is desired. 
     
    2929        import Path = tango.io.Path; 
    3030 
    31         if (Path.exists ("some/file/path"))  
     31        if (Path.exists ("some/file/path")) 
    3232            ... 
    3333        --- 
     
    9292 
    9393        Wraps the O/S specific calls with a D API. Note that these accept 
    94         null-terminated strings only, which is why it's not public. We need  
     94        null-terminated strings only, which is why it's not public. We need 
    9595        this declared first to avoid forward-reference issues 
    9696 
     
    120120        struct FileInfo 
    121121        { 
    122                 char[]  path, 
     122                Cutf8  path, 
    123123                        name; 
    124124                ulong   bytes; 
     
    134134        struct Listing 
    135135        { 
    136                 char[] folder; 
     136                Cutf8 folder; 
    137137 
    138138                int opApply (int delegate(ref FileInfo) dg) 
     
    158158        ***********************************************************************/ 
    159159 
    160         static void exception (char[] filename) 
     160        static void exception (Cutf8 filename) 
    161161        { 
    162162                exception (filename[0..$-1] ~ ": ", SysError.lastMsg); 
     
    165165        /*********************************************************************** 
    166166 
    167                 Throw an IO exception  
    168  
    169         ***********************************************************************/ 
    170  
    171         static void exception (char[] prefix, char[] error) 
     167                Throw an IO exception 
     168 
     169        ***********************************************************************/ 
     170 
     171        static void exception (Cutf8 prefix, Cutf8 error) 
    172172        { 
    173173                throw new IOException (prefix ~ error); 
     
    181181        ***********************************************************************/ 
    182182 
    183         static char[] padded (char[] path, char c = '/') 
     183        static Cutf8 padded (Cutf8 path, char c = '/') 
    184184        { 
    185185                if (path.length && path[$-1] != c) 
     
    195195        ***********************************************************************/ 
    196196 
    197         static char[] stripped (char[] path, char c = '/') 
     197        static Cutf8 stripped (Cutf8 path, char c = '/') 
    198198        { 
    199199                if (path.length && path[$-1] is c) 
     
    209209        ***********************************************************************/ 
    210210 
    211         static char[] join (char[][] paths...) 
     211        static Cutf8 join (Cutf8[] paths...) 
    212212        { 
    213213                char[] result; 
     
    221221        /*********************************************************************** 
    222222 
    223                 Append a terminating null onto a string, cheaply where  
     223                Append a terminating null onto a string, cheaply where 
    224224                feasible 
    225225 
    226226        ***********************************************************************/ 
    227227 
    228         static char[] strz (char[] src, char[] dst) 
     228        static Cutf8 strz (Cutf8 src, char[] dst) 
    229229        { 
    230230                auto i = src.length + 1; 
     
    250250                ***************************************************************/ 
    251251 
    252                 private static wchar[] toString16 (wchar[] tmp, char[] path) 
     252                private static Cutf16 toString16 (wchar[] tmp, Cutf8 path) 
    253253                { 
    254254                        auto i = MultiByteToWideChar (CP_UTF8, 0, 
     
    264264                ***************************************************************/ 
    265265 
    266                 private static char[] toStr