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

Changeset 2840

Show
Ignore:
Timestamp:
11/10/07 00:48:18 (1 year ago)
Author:
schveiguy
Message:

more const updates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/D2.0/tango/io/FilePath.d

    r2810 r2840  
    340340        ***********************************************************************/ 
    341341 
    342         final override int opEquals (char[] s) 
     342        final override int opEquals (const(char)[] s) 
    343343        { 
    344344                return toUtf8() == s; 
  • branches/experimental/D2.0/tango/io/compress/BzipStream.d

    r2810 r2840  
    120120    ***************************************************************************/ 
    121121 
    122     uint write(void[] src) 
     122    override uint write(const(void)[] src) 
    123123    { 
    124124        check_valid(); 
     
    126126 
    127127        bzs.avail_in = src.length; 
    128         bzs.next_in = cast(ubyte*)src.ptr; 
     128        bzs.next_in = cast(const(ubyte)*)src.ptr; 
    129129 
    130130        do 
  • branches/experimental/D2.0/tango/io/compress/ZlibStream.d

    r2810 r2840  
    279279    ***************************************************************************/ 
    280280 
    281     uint write(void[] src) 
     281    override uint write(const(void)[] src) 
    282282    { 
    283283        check_valid(); 
     
    285285 
    286286        zs.avail_in = src.length; 
    287         zs.next_in = cast(ubyte*)src.ptr; 
     287        zs.next_in = cast(const(ubyte)*)src.ptr; 
    288288 
    289289        do 
  • branches/experimental/D2.0/tango/io/compress/c/bzlib.d

    r2810 r2840  
    4545struct bz_stream 
    4646{ 
    47     ubyte *next_in; 
     47    const(ubyte) *next_in; 
    4848    uint avail_in; 
    4949    uint total_in_lo32; 
  • branches/experimental/D2.0/tango/io/compress/c/zlib.d

    r2810 r2840  
    9393    alias uLong     uLongf; 
    9494 
    95     alias void*     voidpc; // TODO: normally const 
     95    alias const(void)*     voidpc; // TODO: normally const 
    9696    alias void*     voidpf; 
    9797    alias void*     voidp; 
     
    105105struct z_stream 
    106106{ 
    107     Bytef*          next_in;   /* next input byte */ 
     107    const(Bytef)*   next_in;   /* next input byte 
     108                                  NOTE: this isn't really const in the real 
     109                                  C zlib, but it should not be written to.*/ 
    108110    uInt            avail_in;  /* number of bytes available at next_in */ 
    109111    uLong           total_in;  /* total nb of input bytes read so far */ 
  • branches/experimental/D2.0/tango/io/protocol/EndianProtocol.d

    r2810 r2840  
    153153 
    154154                char[] mule; 
    155                 char[] test = "testing testing 123"; 
     155                const(char)[] test = "testing testing 123"; 
    156156 
    157157                auto protocol = new EndianProtocol (new Buffer(32)); 
  • branches/experimental/D2.0/tango/io/stream/EndianStream.d

    r2810 r2840  
    169169        unittest 
    170170        { 
    171                 auto inp = new EndianInput!(dchar)(new Buffer("hello world"d)); 
     171                auto inp = new EndianInput!(dchar)(new Buffer("hello world"d.dup)); 
    172172                auto oot = new EndianOutput!(dchar)(new Buffer(64)); 
    173173                oot.copy (inp); 
  • branches/experimental/D2.0/tango/io/stream/MapStream.d

    r2810 r2840  
    9393        ***********************************************************************/ 
    9494 
    95         final MapInput load (ref T[][T[]] properties) 
     95        final MapInput load (ref const(T)[][const(T)[]] properties) 
    9696        { 
    9797                foreach (name, value; this) 
    98                          properties[name] = value;   
     98                         properties[name.dup] = value.dup;   
    9999                return this; 
    100100        } 
     
    116116        private const T[] equals = " = "; 
    117117        version (Win32) 
    118                  private const T[] NL = "\r\n"; 
     118                 private const const(T)[] NL = "\r\n"; 
    119119        version (Posix) 
    120                  private const T[] NL = "\n"; 
     120                 private const const(T)[] NL = "\n"; 
    121121 
    122122        /*********************************************************************** 
     
    126126        ***********************************************************************/ 
    127127 
    128         this (OutputStream stream, T[] newline = NL) 
     128        this (OutputStream stream, const(T)[] newline = NL) 
    129129        { 
    130130                super (output = Buffer.share (stream)); 
     
    148148        ***********************************************************************/ 
    149149 
    150         final MapOutput append (T[] name, T[] value) 
     150        final MapOutput append (const(T)[] name, const(T)[] value) 
    151151        { 
    152152                output (name) (equals) (value) (NL); 
     
    160160        ***********************************************************************/ 
    161161 
    162         final MapOutput append (T[][T[]] properties) 
     162        final MapOutput append (const(T)[][const(T)[]] properties) 
    163163        { 
    164164                foreach (key, value; properties) 
     
    185185                auto output = new MapOutput!(char)(buf); 
    186186 
    187                 char[][char[]] map; 
     187                Cutf8[Cutf8] map; 
    188188                map["foo"] = "bar"; 
    189189                map["foo2"] = "bar2"; 
  • branches/experimental/D2.0/tango/io/stream/TypedStream.d

    r2810 r2840  
    147147        unittest 
    148148        { 
    149                 auto inp = new TypedInput!(char)(new Buffer("hello world")); 
     149                auto inp = new TypedInput!(char)(new Buffer("hello world".dup)); 
    150150                auto oot = new TypedOutput!(char)(new Buffer(20)); 
    151151 
     
    154154                assert (oot.buffer.slice == "hello world"); 
    155155 
    156                 auto xx = new TypedInput!(char)(new UtfInput!(char, dchar)(new Buffer("hello world"d))); 
     156                auto xx = new TypedInput!(char)(new UtfInput!(char, dchar)(new Buffer("hello world"d.dup))); 
    157157                char[] yy; 
    158158                foreach (x; xx)