Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.
Show
Ignore:
Timestamp:
10/15/07 01:42:59 (17 years ago)
Author:
walter
Message:

fixed numerous compilation errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phobos/std/windows/charset.d

    r295 r402  
    3636 * s = UTF-8 string to convert. 
    3737 * codePage = is the number of the target codepage, or 
    3838 *   0 - ANSI, 
    3939 *   1 - OEM, 
    4040 *   2 - Mac 
    4141 * 
    4242 * Authors: 
    4343 *  yaneurao, Walter Bright, Stewart Gordon 
    4444 */ 
    4545 
    46 const(char*) toMBSz(const char[] s, uint codePage = 0) 
     46const(char)* toMBSz(string s, uint codePage = 0) 
    4747{ 
    4848    // Only need to do this if any chars have the high bit set 
    4949    foreach (char c; s) 
    5050    { 
    5151    if (c >= 0x80) 
    5252    { 
    5353        char[] result; 
    5454        int readLen; 
    5555        auto ws = std.utf.toUTF16z(s); 
    5656        result.length = WideCharToMultiByte(codePage, 0, ws, -1, null, 0, 
     
    8181 * 
    8282 * Params: 
    8383 * s = UTF-8 string to convert. 
    8484 * codePage = is the number of the source codepage, or 
    8585 *   0 - ANSI, 
    8686 *   1 - OEM, 
    8787 *   2 - Mac 
    8888 * Authors: Stewart Gordon, Walter Bright 
    8989 */ 
    9090 
    91 const(char[]) fromMBSz(const char* s, int codePage = 0) 
     91string fromMBSz(invariant(char)* s, int codePage = 0) 
    9292{ 
    93     const(char*) c; 
     93    const(char)* c; 
    9494 
    9595    for (c = s; *c != 0; c++) 
    9696    { 
    9797    if (*c >= 0x80) 
    9898    { 
    9999        wchar[] result; 
    100100        int readLen; 
    101101 
    102102        result.length = MultiByteToWideChar(codePage, 0, s, -1, null, 0); 
    103103