Changeset 354

Show
Ignore:
Timestamp:
08/25/08 23:25:55 (3 months ago)
Author:
JarrettBillingsley
Message:

And a few more.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/v2new/minid/charlib.d

    r352 r354  
    5757    uword toLower(MDThread* t, uword numParams) 
    5858    { 
    59         dchar[1] inbuf = void; 
    6059        dchar[4] outbuf = void; 
    61         inbuf[0] = checkCharParam(t, 0); 
    62         pushChar(t, safeCode(t, Uni.toLower(inbuf, outbuf)[0])); 
     60        dchar c = checkCharParam(t, 0); 
     61        pushChar(t, safeCode(t, Uni.toLower((&c)[0 .. 1], outbuf)[0])); 
    6362        return 1; 
    6463    } 
     
    6665    uword toUpper(MDThread* t, uword numParams) 
    6766    { 
    68         dchar[1] inbuf = void; 
    6967        dchar[4] outbuf = void; 
    70         inbuf[0] = checkCharParam(t, 0); 
    71         pushChar(t, safeCode(t, Uni.toUpper(inbuf, outbuf)[0])); 
     68        dchar c = checkCharParam(t, 0); 
     69        pushChar(t, safeCode(t, Uni.toUpper((&c)[0 .. 1], outbuf)[0])); 
    7270        return 1; 
    7371    } 
  • branches/v2new/minid/compiler.d

    r352 r354  
    173173            delete src; 
    174174 
    175         /*dchar[256] buffer = void; 
    176         uint ate = void; 
    177         auto s = Utf.toString32(filename, buffer, &ate); 
    178  
    179         // Ellipsis! 
    180         if(ate < filename.length && s.length >= 3) 
    181             s[$ - 3 .. $] = "..."; 
    182  
    183         return compileModule(src, s);*/ 
    184  
    185175        return compileModule(src, filename); 
    186176    } 
  • branches/v2new/minid/ex.d

    r352 r354  
    108108    public void addChar(dchar c) 
    109109    { 
    110         dchar[1] inbuf = void; 
    111         inbuf[0] = c; 
    112110        char[4] outbuf = void; 
    113111        uint ate = 0; 
    114         auto s = Utf.toString(inbuf, outbuf, &ate); 
     112        auto s = Utf.toString((&c)[0 .. 1], outbuf, &ate); 
    115113 
    116114        if(pos + s.length - 1 >= data.length) 
  • branches/v2new/minid/interpreter.d

    r352 r354  
    32933293 
    32943294            if(auto o = v.mNativeObj.obj) 
    3295             { 
    32963295                pushString(t, o.classinfo.name); 
    3297                 /*dchar[96] buffer = void; 
    3298  
    3299                 // The 'ate' parameter will prevent toString32 from reallocating the buffer on the heap. 
    3300                 auto n = o.classinfo.name; 
    3301                 uint ate = void; 
    3302                 auto s = Utf.toString32(n, buffer, &ate); 
    3303  
    3304                 // Ellipsis! 
    3305                 if(ate < n.length && s.length >= 3) 
    3306                     s[$ - 3 .. $] = "..."; 
    3307  
    3308                 pushString(t, s);*/ 
    3309             } 
    33103296            else 
    33113297                pushString(t, "(??? null)"); 
  • branches/v2new/minid/stringlib.d

    r352 r354  
    255255        foreach(dchar c; src) 
    256256        { 
    257             dchar[1] inbuf = void; 
    258257            dchar[4] outbuf = void; 
    259258             
    260             inbuf[0] = c; 
    261              
    262             foreach(ch; Uni.toLower(inbuf, outbuf)) 
     259            foreach(ch; Uni.toLower((&c)[0 .. 1], outbuf)) 
    263260                buf.addChar(ch); 
    264261        } 
     
    275272        foreach(dchar c; src) 
    276273        { 
    277             dchar[1] inbuf = void; 
    278274            dchar[4] outbuf = void; 
    279275             
    280             inbuf[0] = c; 
    281              
    282             foreach(ch; Uni.toUpper(inbuf, outbuf)) 
     276            foreach(ch; Uni.toUpper((&c)[0 .. 1], outbuf)) 
    283277                buf.addChar(ch); 
    284278        } 
  • branches/v2new/minid/timelib.d

    r352 r354  
    174174    uword culture(MDThread* t, uword numParams) 
    175175    { 
    176         CultureToStr(t, Culture.current.name); 
     176        pushString(t, Culture.current.name); 
    177177 
    178178        if(numParams > 0) 
     
    196196    } 
    197197 
    198     word CultureToStr(MDThread* t, char[] culture) 
    199     { 
    200         // eh, let's be safe.. 
    201         return pushString(t, culture); 
    202         /*dchar[8] buf; 
    203         uint ate = 0; 
    204         return pushString(t, Utf.toString32(culture, buf, &ate));*/ 
    205     } 
    206      
    207198    char[] GetFormat(MDThread* t, word slot) 
    208199    {