Changeset 327

Show
Ignore:
Timestamp:
07/13/08 21:12:56 (2 months ago)
Author:
JarrettBillingsley
Message:

--

Files:

Legend:

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

    r326 r327  
    5050The default memory-allocation function, which uses the C allocator. 
    5151*/ 
    52 public void* DefaultMemFunc(void* ctx, void* p, size_t oldSize, size_t newSize) 
     52public void* DefaultMemFunc(void* ctx, void* p, uword oldSize, uword newSize) 
    5353{ 
    5454    if(newSize == 0) 
     
    185185import tango.stdc.stdlib; 
    186186import tango.stdc.stringz; 
    187 public nint loadFunc(MDThread* t, char[] filename) 
     187public word loadFunc(MDThread* t, char[] filename) 
    188188{ 
    189189    if(system(toStringz("minidc " ~ filename)) != 0) 
  • branches/v2new/minid/array.d

    r319 r327  
    3939     
    4040    // Create a new array object of the given length. 
    41     package MDArray* create(ref Allocator alloc, size_t size) 
     41    package MDArray* create(ref Allocator alloc, uword size) 
    4242    { 
    4343        auto a = alloc.allocate!(MDArray); 
     
    6060     
    6161    // Resize an array object. 
    62     package void resize(ref Allocator alloc, MDArray* a, size_t newSize) 
     62    package void resize(ref Allocator alloc, MDArray* a, uword newSize) 
    6363    { 
    6464        if(newSize == a.slice.length) 
     
    8686     
    8787    // Slice an array object to create a new array object that references the source's data. 
    88     package MDArray* slice(ref Allocator alloc, MDArray* a, size_t lo, size_t hi) 
     88    package MDArray* slice(ref Allocator alloc, MDArray* a, uword lo, uword hi) 
    8989    { 
    9090        auto n = alloc.allocate!(MDArray); 
     
    9696 
    9797    // Assign an entire other array into a slice of the destination array.  Handles overlapping copies as well. 
    98     package void sliceAssign(MDArray* a, size_t lo, size_t hi, MDArray* other) 
     98    package void sliceAssign(MDArray* a, uword lo, uword hi, MDArray* other) 
    9999    { 
    100100        auto dest = a.slice[lo .. hi]; 
     
    112112 
    113113    // Sets a block of values (only called by the SetArray instruction in the interpreter). 
    114     package void setBlock(ref Allocator alloc, MDArray* a, size_t block, MDValue[] data) 
     114    package void setBlock(ref Allocator alloc, MDArray* a, uword block, MDValue[] data) 
    115115    { 
    116116        auto start = block * Instruction.arraySetFields; 
     
    177177    // overallocate only controls whether over-allocation will be done for large (> 1 page) 
    178178    // arrays. 
    179     private MDArrayData* allocData(bool overallocate)(ref Allocator alloc, size_t size) 
     179    private MDArrayData* allocData(bool overallocate)(ref Allocator alloc, uword size) 
    180180    { 
    181181        const BigArraySize = overallocate ? "size + (size / 10)" : "size"; 
    182         size_t realSize = void; 
     182        uword realSize = void; 
    183183 
    184184        if(size <= ElemsInPage) 
     
    199199 
    200200    // Figure out the size of an MDArrayData object given that it has 'length' items. 
    201     private size_t DataSize(size_t length) 
     201    private uword DataSize(uword length) 
    202202    { 
    203203        return MDArrayData.sizeof + (MDValue.sizeof * length); 
     
    207207    // be true if you want to evaluate at compile time; at runtime it uses a faster 
    208208    // bitwise intrinsic function. 
    209     private size_t largerPow2(bool ct = false)(size_t n) 
     209    private uword largerPow2(bool ct = false)(uword n) 
    210210    { 
    211211        static if(ct) 
     
    216216                return n; 
    217217         
    218             size_t ret = 1; 
     218            uword ret = 1; 
    219219 
    220220            while(n) 
     
    237237    // The size of a memory page.  I'm just guessing that most OSes use 4k pages. 
    238238    // Please change this as necessary. 
    239     private const size_t PageSize = 4096; 
     239    private const uword PageSize = 4096; 
    240240     
    241241    // How many elements can fit within an array data object that's only one page. 
    242     private const size_t ElemsInPage = (PageSize - MDArrayData.sizeof) / MDValue.sizeof; 
     242    private const uword ElemsInPage = (PageSize - MDArrayData.sizeof) / MDValue.sizeof; 
    243243     
    244244    // The largest power of 2 that's < ElemsInPage. 
    245     private const size_t LargestPow2 = largerPow2!(true)(ElemsInPage) >> 1; 
     245    private const uword LargestPow2 = largerPow2!(true)(ElemsInPage) >> 1; 
    246246} 
  • branches/v2new/minid/baselib.d

    r323 r327  
    4242import minid.vm; 
    4343 
    44 private void register(MDThread* t, dchar[] name, NativeFunc func, size_t numUpvals = 0) 
     44private void register(MDThread* t, dchar[] name, NativeFunc func, uword numUpvals = 0) 
    4545{ 
    4646    newFunction(t, func, name, numUpvals); 
     
    165165    // Object 
    166166 
    167     nuint objectClone(MDThread* t, nuint numParams) 
     167    uword objectClone(MDThread* t, uword numParams) 
    168168    { 
    169169        newObject(t, 0); 
     
    175175    // Basic functions 
    176176 
    177     nuint getTraceback(MDThread* t, nuint numParams) 
     177    uword getTraceback(MDThread* t, uword numParams) 
    178178    { 
    179179        s.push(new MDString(s.context.getTracebackString())); 
     
    181181    } 
    182182 
    183     nuint haltThread(MDThread* t, nuint numParams) 
     183    uword haltThread(MDThread* t, uword numParams) 
    184184    { 
    185185        if(numParams == 0) 
     
    196196*/ 
    197197 
    198     nuint currentThread(MDThread* t, nuint numParams) 
     198    uword currentThread(MDThread* t, uword numParams) 
    199199    { 
    200200        if(t is mainThread(getVM(t))) 
     
    206206    } 
    207207/* 
    208     nuint setModuleLoader(MDThread* t, nuint numParams) 
     208    uword setModuleLoader(MDThread* t, uword numParams) 
    209209    { 
    210210        s.context.setModuleLoader(s.getParam!(dchar[])(0), s.getParam!(MDClosure)(1)); 
     
    212212    } 
    213213 
    214     nuint reloadModule(MDThread* t, nuint numParams) 
     214    uword reloadModule(MDThread* t, uword numParams) 
    215215    { 
    216216        s.push(s.context.reloadModule(s.getParam!(MDString)(0).mData, s)); 
     
    218218    } 
    219219*/ 
    220     nuint removeKey(MDThread* t, nuint numParams) 
     220    uword removeKey(MDThread* t, uword numParams) 
    221221    { 
    222222        checkAnyParam(t, 1); 
     
    248248    } 
    249249 
    250     nuint rawSet(MDThread* t, nuint numParams) 
     250    uword rawSet(MDThread* t, uword numParams) 
    251251    { 
    252252        if(numParams < 3) 
     
    266266    } 
    267267 
    268     nuint rawGet(MDThread* t, nuint numParams) 
     268    uword rawGet(MDThread* t, uword numParams) 
    269269    { 
    270270        if(numParams < 2) 
     
    284284    } 
    285285 
    286     nuint runMain(MDThread* t, nuint numParams) 
     286    uword runMain(MDThread* t, uword numParams) 
    287287    { 
    288288        checkParam(t, 1, MDValue.Type.Namespace); 
     
    302302    // Functional stuff 
    303303 
    304     nuint curry(MDThread* t, nuint numParams) 
    305     { 
    306         static nuint call(MDThread* t, nuint numParams) 
     304    uword curry(MDThread* t, uword numParams) 
     305    { 
     306        static uword call(MDThread* t, uword numParams) 
    307307        { 
    308308            auto funcReg = getUpval(t, 0); 
     
    310310            getUpval(t, 1); 
    311311 
    312             for(size_t i = 1; i <= numParams; i++) 
     312            for(uword i = 1; i <= numParams; i++) 
    313313                dup(t, i); 
    314314 
     
    323323    } 
    324324 
    325     nuint bindContext(MDThread* t, nuint numParams) 
    326     { 
    327         static nuint call(MDThread* t, nuint numParams) 
     325    uword bindContext(MDThread* t, uword numParams) 
     326    { 
     327        static uword call(MDThread* t, uword numParams) 
    328328        { 
    329329            auto funcReg = getUpval(t, 0); 
    330330            getUpval(t, 1); 
    331331 
    332             for(size_t i = 1; i <= numParams; i++) 
     332            for(uword i = 1; i <= numParams; i++) 
    333333                dup(t, i); 
    334334 
     
    346346    // Reflection-esque stuff 
    347347 
    348     nuint findGlobal(MDThread* t, nuint numParams) 
     348    uword findGlobal(MDThread* t, uword numParams) 
    349349    { 
    350350        if(!.findGlobal(t, checkStringParam(t, 1))) 
     
    354354    } 
    355355 
    356     nuint isSet(MDThread* t, nuint numParams) 
     356    uword isSet(MDThread* t, uword numParams) 
    357357    { 
    358358        if(!.findGlobal(t, checkStringParam(t, 1))) 
     
    367367    } 
    368368 
    369     nuint mdtypeof(MDThread* t, nuint numParams) 
     369    uword mdtypeof(MDThread* t, uword numParams) 
    370370    { 
    371371        checkAnyParam(t, 1); 
     
    374374    } 
    375375 
    376     nuint fieldsOf(MDThread* t, nuint numParams) 
     376    uword fieldsOf(MDThread* t, uword numParams) 
    377377    { 
    378378        checkObjParam(t, 1); 
     
    381381    } 
    382382 
    383     nuint allFieldsOf(MDThread* t, nuint numParams) 
     383    uword allFieldsOf(MDThread* t, uword numParams) 
    384384    { 
    385385        // Upvalue 0 is the current object 
    386386        // Upvalue 1 is the current index into the namespace 
    387         static nuint iter(MDThread* t, nuint numParams) 
     387        static uword iter(MDThread* t, uword numParams) 
    388388        { 
    389389            getUpval(t, 0); 
     
    430430    } 
    431431 
    432     nuint hasField(MDThread* t, nuint numParams) 
     432    uword hasField(MDThread* t, uword numParams) 
    433433    { 
    434434        checkAnyParam(t, 1); 
     
    438438    } 
    439439 
    440     nuint hasMethod(MDThread* t, nuint numParams) 
     440    uword hasMethod(MDThread* t, uword numParams) 
    441441    { 
    442442        checkAnyParam(t, 1); 
     
    447447 
    448448/* 
    449     nuint hasAttributes(MDThread* t, nuint numParams) 
     449    uword hasAttributes(MDThread* t, uword numParams) 
    450450    { 
    451451        MDTable ret; 
     
    462462    } 
    463463 
    464     nuint attributesOf(MDThread* t, nuint numParams) 
     464    uword attributesOf(MDThread* t, uword numParams) 
    465465    { 
    466466        MDTable ret; 
     
    483483    } 
    484484*/ 
    485     nuint isParam(MDValue.Type Type)(MDThread* t, nuint numParams) 
     485    uword isParam(MDValue.Type Type)(MDThread* t, uword numParams) 
    486486    { 
    487487        checkAnyParam(t, 1); 
     
    493493    // Conversions 
    494494 
    495     nuint toString(MDThread* t, nuint numParams) 
     495    uword toString(MDThread* t, uword numParams) 
    496496    { 
    497497        checkAnyParam(t, 1); 
     
    513513    } 
    514514 
    515     nuint rawToString(MDThread* t, nuint numParams) 
     515    uword rawToString(MDThread* t, uword numParams) 
    516516    { 
    517517        checkAnyParam(t, 1); 
     
    520520    } 
    521521 
    522     nuint toBool(MDThread* t, nuint numParams) 
     522    uword toBool(MDThread* t, uword numParams) 
    523523    { 
    524524        checkAnyParam(t, 1); 
     
    527527    } 
    528528 
    529     nuint toInt(MDThread* t, nuint numParams) 
     529    uword toInt(MDThread* t, uword numParams) 
    530530    { 
    531531        checkAnyParam(t, 1); 
     
    547547    } 
    548548 
    549     nuint toFloat(MDThread* t, nuint numParams) 
     549    uword toFloat(MDThread* t, uword numParams) 
    550550    { 
    551551        checkAnyParam(t, 1); 
     
    567567    } 
    568568 
    569     nuint toChar(MDThread* t, nuint numParams) 
     569    uword toChar(MDThread* t, uword numParams) 
    570570    { 
    571571        pushChar(t, cast(dchar)checkIntParam(t, 1)); 
     
    573573    } 
    574574 
    575     nuint format(MDThread* t, nuint numParams) 
     575    uword format(MDThread* t, uword numParams) 
    576576    { 
    577577        auto buf = StrBuffer(t); 
     
    584584    // Console IO 
    585585 
    586     nuint write(MDThread* t, nuint numParams) 
    587     { 
    588         for(size_t i = 1; i <= numParams; i++) 
     586    uword write(MDThread* t, uword numParams) 
     587    { 
     588        for(uword i = 1; i <= numParams; i++) 
    589589        { 
    590590            pushToString(t, i); 
     
    596596    } 
    597597 
    598     nuint writeln(MDThread* t, nuint numParams) 
    599     { 
    600         for(size_t i = 1; i <= numParams; i++) 
     598    uword writeln(MDThread* t, uword numParams) 
     599    { 
     600        for(uword i = 1; i <= numParams; i++) 
    601601        { 
    602602            pushToString(t, i); 
     
    608608    } 
    609609 
    610     nuint writef(MDThread* t, nuint numParams) 
     610    uword writef(MDThread* t, uword numParams) 
    611611    { 
    612612        uint sink(dchar[] data) 
     
    621621    } 
    622622 
    623     nuint writefln(MDThread* t, nuint numParams) 
     623    uword writefln(MDThread* t, uword numParams) 
    624624    { 
    625625        uint sink(dchar[] data) 
     
    634634    } 
    635635 
    636     nuint dumpVal(MDThread* t, nuint numParams) 
     636    uword dumpVal(MDThread* t, uword numParams) 
    637637    { 
    638638        checkAnyParam(t, 1); 
     
    641641        auto shown = getUpval(t, 0); 
    642642 
    643         void outputRepr(nint v) 
     643        void outputRepr(word v) 
    644644        { 
    645645            v = absIndex(t, v); 
     
    675675            } 
    676676 
    677             void outputArray(nint arr) 
     677            void outputArray(word arr) 
    678678            { 
    679679                if(opin(t, arr, shown)) 
     
    705705                    pop(t); 
    706706 
    707                     for(size_t i = 1; i < length; i++) 
     707                    for(uword i = 1; i < length; i++) 
    708708                    { 
    709709                        // TODO: this 
     
    722722            } 
    723723 
    724             void outputTable(nint tab) 
     724            void outputTable(word tab) 
    725725            { 
    726726                if(opin(t, tab, shown)) 
     
    823823 
    824824/* 
    825     nuint readln(MDThread* t, nuint numParams) 
     825    uword readln(MDThread* t, uword numParams) 
    826826    { 
    827827        pushString(t, Cin.copyln()); 
     
    833833    // Dynamic Compilation 
    834834 
    835     nuint loadString(MDThread* t, nuint numParams) 
     835    uword loadString(MDThread* t, uword numParams) 
    836836    { 
    837837        char[] name; 
     
    863863    } 
    864864     
    865     nuint eval(MDThread* t, nuint numParams) 
     865    uword eval(MDThread* t, uword numParams) 
    866866    { 
    867867        MDFuncDef def = Compiler().compileExpression(s.getParam!(dchar[])(0), "<loaded by eval>"); 
     
    876876    } 
    877877     
    878     nuint loadJSON(MDThread* t, nuint numParams) 
     878    uword loadJSON(MDThread* t, uword numParams) 
    879879    { 
    880880        s.push(Compiler().loadJSON(s.getParam!(dchar[])(0))); 
     
    882882    } 
    883883 
    884     nuint toJSON(MDThread* t, nuint numParams) 
     884    uword toJSON(MDThread* t, uword numParams) 
    885885    { 
    886886        MDValue root = s.getParam(0u); 
     
    902902    // Namespace metatable 
    903903*/ 
    904     nuint namespaceApply(MDThread* t, nuint numParams) 
    905     { 
    906         static nuint iter(MDThread* t, nuint numParams) 
     904    uword namespaceApply(MDThread* t, uword numParams) 
     905    { 
     906        static uword iter(MDThread* t, uword numParams) 
    907907        { 
    908908            getUpval(t, 0); 
     
    939939    // Thread metatable 
    940940 
    941     nuint threadReset(MDThread* t, nuint numParams) 
     941    uword threadReset(MDThread* t, uword numParams) 
    942942    { 
    943943        checkParam(t, 0, MDValue.Type.Thread); 
     
    954954    } 
    955955 
    956     nuint threadState(MDThread* t, nuint numParams) 
     956    uword threadState(MDThread* t, uword numParams) 
    957957    { 
    958958        checkParam(t, 0, MDValue.Type.Thread); 
     
    961961    } 
    962962 
    963     nuint isInitial(MDThread* t, nuint numParams) 
     963    uword isInitial(MDThread* t, uword numParams) 
    964964    { 
    965965        checkParam(t, 0, MDValue.Type.Thread); 
     
    968968    } 
    969969 
    970     nuint isRunning(MDThread* t, nuint numParams) 
     970    uword isRunning(MDThread* t, uword numParams) 
    971971    { 
    972972        checkParam(t, 0, MDValue.Type.Thread); 
     
    975975    } 
    976976 
    977     nuint isWaiting(MDThread* t, nuint numParams) 
     977    uword isWaiting(MDThread* t, uword numParams) 
    978978    { 
    979979        checkParam(t, 0, MDValue.Type.Thread); 
     
    982982    } 
    983983 
    984     nuint isSuspended(MDThread* t, nuint numParams) 
     984    uword isSuspended(MDThread* t, uword numParams) 
    985985    { 
    986986        checkParam(t, 0, MDValue.Type.Thread); 
     
    989989    } 
    990990 
    991     nuint isDead(MDThread* t, nuint numParams) 
     991    uword isDead(MDThread* t, uword numParams) 
    992992    { 
    993993        checkParam(t, 0, MDValue.Type.Thread); 
     
    996996    } 
    997997     
    998     nuint threadIterator(MDThread* t, nuint numParams) 
     998    uword threadIterator(MDThread* t, uword numParams) 
    999999    { 
    10001000        checkParam(t, 0, MDValue.Type.Thread); 
     
    10131013    } 
    10141014 
    1015     nuint threadApply(MDThread* t, nuint numParams) 
     1015    uword threadApply(MDThread* t, uword numParams) 
    10161016    { 
    10171017        checkParam(t, 0, MDValue.Type.Thread); 
     
    10411041    // Function metatable 
    10421042 
    1043     nuint functionEnvironment(MDThread* t, nuint numParams) 
     1043    uword functionEnvironment(MDThread* t, uword numParams) 
    10441044    { 
    10451045        checkParam(t, 0, MDValue.Type.Function); 
     
    10561056    } 
    10571057 
    1058     nuint functionIsNative(MDThread* t, nuint numParams) 
     1058    uword functionIsNative(MDThread* t, uword numParams) 
    10591059    { 
    10601060        checkParam(t, 0, MDValue.Type.Function); 
     
    10631063    } 
    10641064 
    1065     nuint functionNumParams(MDThread* t, nuint numParams) 
     1065    uword functionNumParams(MDThread* t, uword numParams) 
    10661066    { 
    10671067        checkParam(t, 0, MDValue.Type.Function); 
     
    10701070    } 
    10711071 
    1072     nuint functionIsVararg(MDThread* t, nuint numParams) 
     1072    uword functionIsVararg(MDThread* t, uword numParams) 
    10731073    { 
    10741074        checkParam(t, 0, MDValue.Type.Function); 
     
    11141114        } 
    11151115 
    1116         public nuint clone(MDThread* t, nuint numParams) 
     1116        public uword clone(MDThread* t, uword numParams) 
    11171117        { 
    11181118            MDStringBuffer ret; 
     
    11341134        } 
    11351135 
    1136         public nuint opCatAssign(MDThread* t, nuint numParams) 
     1136        public uword opCatAssign(MDThread* t, uword numParams) 
    11371137        { 
    11381138            MDStringBuffer i = s.getContext!(MDStringBuffer); 
     
    11641164        } 
    11651165 
    1166         public nuint insert(MDThread* t, nuint numParams) 
     1166        public uword insert(MDThread* t, uword numParams) 
    11671167        { 
    11681168            MDStringBuffer i = s.getContext!(MDStringBuffer); 
     
    11901190        } 
    11911191 
    1192         public nuint remove(MDThread* t, nuint numParams) 
     1192        public uword remove(MDThread* t, uword numParams) 
    11931193        { 
    11941194            MDStringBuffer i = s.getContext!(MDStringBuffer); 
     
    12031203        } 
    12041204         
    1205         public nuint toString(MDThread* t, nuint numParams) 
     1205        public uword toString(MDThread* t, uword numParams) 
    12061206        { 
    12071207            s.push(s.getContext!(MDStringBuffer).toMDString()); 
     
    12091209        } 
    12101210         
    1211         public nuint opLengthAssign(MDThread* t, nuint numParams) 
     1211        public uword opLengthAssign(MDThread* t, uword numParams) 
    12121212        { 
    12131213            int newLen = s.getParam!(int)(0); 
     
    12201220        } 
    12211221 
    1222         public nuint opLength(MDThread* t, nuint numParams) 
     1222        public uword opLength(MDThread* t, uword numParams) 
    12231223        { 
    12241224            s.push(s.getContext!(MDStringBuffer).length); 
     
    12261226        } 
    12271227         
    1228         public nuint opIndex(MDThread* t, nuint numParams) 
     1228        public uword opIndex(MDThread* t, uword numParams) 
    12291229        { 
    12301230            s.push(s.getContext!(MDStringBuffer)()[s.getParam!(int)(0)]); 
     
    12321232        } 
    12331233 
    1234         public nuint opIndexAssign(MDThread* t, nuint numParams) 
     1234        public uword opIndexAssign(MDThread* t, uword numParams) 
    12351235        { 
    12361236            s.getContext!(MDStringBuffer)()[s.getParam!(int)(0)] = s.getParam!(dchar)(1); 
     
    12381238        } 
    12391239 
    1240         public nuint iterator(MDThread* t, nuint numParams) 
     1240        public uword iterator(MDThread* t, uword numParams) 
    12411241        { 
    12421242            MDStringBuffer i = s.getContext!(MDStringBuffer); 
     
    12541254        } 
    12551255         
    1256         public nuint iteratorReverse(MDThread* t, nuint numParams) 
     1256        public uword iteratorReverse(MDThread* t, uword numParams) 
    12571257        { 
    12581258            MDStringBuffer i = s.getContext!(MDStringBuffer); 
     
    12701270        } 
    12711271         
    1272         public nuint opApply(MDThread* t, nuint numParams) 
     1272        public uword opApply(MDThread* t, uword numParams) 
    12731273        { 
    12741274            MDStringBuffer i = s.getContext!(MDStringBuffer); 
     
    12901290        } 
    12911291 
    1292         public nuint opSlice(MDThread* t, nuint numParams) 
     1292        public uword opSlice(MDThread* t, uword numParams) 
    12931293        { 
    12941294            s.push(s.getContext!(MDStringBuffer)()[s.getParam!(int)(0) .. s.getParam!(int)(1)]); 
     
    12961296        } 
    12971297         
    1298         public nuint opSliceAssign(MDThread* t, nuint numParams) 
     1298        public uword opSliceAssign(MDThread* t, uword numParams) 
    12991299        { 
    13001300            s.getContext!(MDStringBuffer)()[s.getParam!(int)(0) .. s.getParam!(int)(1)] = s.getParam!(dchar[])(2); 
     
    13021302        } 
    13031303 
    1304         public nuint reserve(MDThread* t, nuint numParams) 
     1304        public uword reserve(MDThread* t, uword numParams) 
    13051305        { 
    13061306            s.getContext!(MDStringBuffer).reserve(s.getParam!(uint)(0)); 
     
    13081308        } 
    13091309         
    1310         public nuint format(MDThread* t, nuint numParams) 
     1310        public uword format(MDThread* t, uword numParams) 
    13111311        { 
    13121312            auto self = s.getContext!(MDStringBuffer); 
     
    13221322        } 
    13231323 
    1324         public nuint formatln(MDThread* t, nuint numParams) 
     1324        public uword formatln(MDThread* t, uword numParams) 
    13251325        { 
    13261326            auto self = s.getContext!(MDStringBuffer); 
     
    13411341    { 
    13421342        protected dchar[] mBuffer; 
    1343         protected size_t mLength = 0; 
     1343        protected uword mLength = 0; 
    13441344 
    13451345        public this(MDStringBufferClass owner) 
     
    13491349        } 
    13501350 
    1351         public this(MDStringBufferClass owner, size_t size) 
     1351        public this(MDStringBufferClass owner, uword size) 
    13521352        { 
    13531353            super("StringBuffer", owner); 
  • branches/v2new/minid/commandline.d

    r308 r327  
    258258                    return false; 
    259259 
    260                 size_t i = 0; 
     260                uword i = 0; 
    261261 
    262262                for( ; i < buffer.length && Uni.isWhitespace(buffer[i]); i++) 
  • branches/v2new/minid/compiler.d

    r326 r327  
    606606    protected dchar[] mSource; 
    607607    protected OldLocation mLoc; 
    608     protected size_t mPosition; 
     608    protected uword mPosition; 
    609609    protected dchar mCharacter; 
    610610    protected dchar mLookaheadCharacter; 
  • branches/v2new/minid/compilertypes.d

    r326 r327  
    8484    private Allocator* mAlloc; 
    8585    private T[] mData; 
    86     private size_t mIndex = 0; 
     86    private uword mIndex = 0; 
    8787 
    8888    package this(Allocator* alloc) 
     
    112112    alias add opCatAssign; 
    113113 
    114     public T opIndex(size_t index) 
     114    public T opIndex(uword index) 
    115115    { 
    116116        return mData[index]; 
    117117    } 
    118118 
    119     public void length(size_t l) 
     119    public void length(uword l) 
    120120    { 
    121121        mIndex = l; 
     
    125125    } 
    126126 
    127     public size_t length() 
     127    public uword length() 
    128128    { 
    129129        return mIndex; 
     
    151151    } 
    152152     
    153     public int opApply(int delegate(size_t, ref T) dg) 
     153    public int opApply(int delegate(uword, ref T) dg) 
    154154    { 
    155155        int result = 0; 
  • branches/v2new/minid/ex.d

    r325 r327  
    3939    private MDThread* t; 
    4040    private dchar[] name; 
    41     private nint idx; 
     41    private word idx; 
    4242 
    4343    public static void opCall(MDThread* t, dchar[] name, void delegate(CreateObject*) dg) 
     
    8888{ 
    8989    private MDThread* t; 
    90     private size_t numPieces; 
    91     private size_t pos; 
     90    private uword numPieces; 
     91    private uword pos; 
    9292    private dchar[512] data; 
    9393 
     
    178178    on top of the stack.  The StrBuffer will also be in a state to build a new string if you so desire. 
    179179    */ 
    180     public nint finish() 
     180    public word finish() 
    181181    { 
    182182        flush(); 
     
    210210} 
    211211 
    212 public void checkAnyParam(MDThread* t, nint index) 
     212public void checkAnyParam(MDThread* t, word index) 
    213213{ 
    214214    if(!isValidIndex(t, index)) 
     
    216216} 
    217217 
    218 public bool checkBoolParam(MDThread* t, nint index) 
     218public bool checkBoolParam(MDThread* t, word index) 
    219219{ 
    220220    checkAnyParam(t, index); 
     
    226226} 
    227227 
    228 public mdint checkIntParam(MDThread* t, nint index) 
     228public mdint checkIntParam(MDThread* t, word index) 
    229229{ 
    230230    checkAnyParam(t, index); 
     
    236236} 
    237237 
    238 public mdfloat checkFloatParam(MDThread* t, nint index) 
     238public mdfloat checkFloatParam(MDThread* t, word index) 
    239239{ 
    240240    checkAnyParam(t, index); 
     
    246246} 
    247247 
    248 public dchar checkCharParam(MDThread* t, nint index) 
     248public dchar checkCharParam(MDThread* t, word index) 
    249249{ 
    250250    checkAnyParam(t, index); 
     
    256256} 
    257257 
    258 public dchar[] checkStringParam(MDThread* t, nint index) 
     258public dchar[] checkStringParam(MDThread* t, word index) 
    259259{ 
    260260    checkAnyParam(t, index); 
     
    266266} 
    267267 
    268 public void checkObjParam()(MDThread* t, nint index) 
     268public void checkObjParam()(MDThread* t, word index) 
    269269{ 
    270270    checkAnyParam(t, index); 
     
    274274} 
    275275 
    276 public void checkObjParam(bool strict = true)(MDThread* t, nint index, dchar[] name) 
     276public void checkObjParam(bool strict = true)(MDThread* t, word index, dchar[] name) 
    277277{ 
    278278    index = absIndex(t, index); 
     
    294294} 
    295295 
    296 public T* checkObjParam(T, bool strict = true)(MDThread* t, nint index, dchar[] name) 
     296public T* checkObjParam(T, bool strict = true)(MDThread* t, word index, dchar[] name) 
    297297{ 
    298298    checkObjParam!(strict)(t, index, name); 
     
    300300} 
    301301 
    302 public void checkParam(MDThread* t, nint index, MDValue.Type type) 
     302public void checkParam(MDThread* t, word index, MDValue.Type type) 
    303303{ 
    304304    assert(type >= MDValue.Type.Null && type <= MDValue.Type.NativeObj, "invalid type"); 
     
    310310} 
    311311 
    312 public void paramTypeError(MDThread* t, nint index, dchar[] expected) 
     312public void paramTypeError(MDThread* t, word index, dchar[] expected) 
    313313{ 
    314314    pushTypeString(t, index); 
     
    320320} 
    321321 
    322 public bool optBoolParam(MDThread* t, nint index, bool def) 
     322public bool optBoolParam(MDThread* t, word index, bool def) 
    323323{ 
    324324    if(!isValidIndex(t, index) || isNull(t, index)) 
     
    331331} 
    332332 
    333 public mdint optIntParam(MDThread* t, nint index, mdint def) 
     333public mdint optIntParam(MDThread* t, word index, mdint def) 
    334334{ 
    335335    if(!isValidIndex(t, index) || isNull(t, index)) 
     
    342342} 
    343343 
    344 public mdfloat optFloatParam(MDThread* t, nint index, mdfloat def) 
     344public mdfloat optFloatParam(MDThread* t, word index, mdfloat def) 
    345345{ 
    346346    if(!isValidIndex(t, index) || isNull(t, index)) 
     
    353353} 
    354354 
    355 public dchar optCharParam(MDThread* t, nint index, dchar def) 
     355public dchar optCharParam(MDThread* t, word index, dchar def) 
    356356{ 
    357357    if(!isValidIndex(t, index) || isNull(t, index)) 
     
    364364} 
    365365 
    366 public dchar[] optStringParam(MDThread* t, nint index, dchar[] def) 
     366public dchar[] optStringParam(MDThread* t, word index, dchar[] def) 
    367367{ 
    368368    if(!isValidIndex(t, index) || isNull(t, index)) 
     
    375375} 
    376376 
    377 public bool optParam(MDThread* t, nint index, MDValue.Type type) 
     377public bool optParam(MDThread* t, word index, MDValue.Type type) 
    378378{ 
    379379    if(!isValidIndex(t, index) || isNull(t, index)) 
     
    386386} 
    387387 
    388 public T* getMembers(T)(MDThread* t, nint index) 
     388public T* getMembers(T)(MDThread* t, word index) 
    389389{ 
    390390    auto ret = getExtraBytes(t, index); 
     
    423423    The stack index of the looked-up value. 
    424424*/ 
    425 public nint lookup(MDThread* t, dchar[] name) 
     425public word lookup(MDThread* t, dchar[] name) 
    426426{ 
    427427    validateName(t, name); 
    428428 
    429429    bool isFirst = true; 
    430     nint idx = void; 
     430    word idx = void; 
    431431 
    432432    foreach(n; name.delimiters("."d)) 
     
    458458    The stack index of the looked-up value. 
    459459*/ 
    460 public nint lookupCT(char[] name)(MDThread* t) 
     460public word lookupCT(char[] name)(MDThread* t) 
    461461{ 
    462462    mixin(NameToAPICalls!(name)); 
     
    481481        throwException(t, "Cannot use an empty string for a name"); 
    482482 
    483     size_t idx = 0; 
     483    uword idx = 0; 
    484484 
    485485    void ident() 
     
    518518} 
    519519 
    520 private template ValidateNameCTImpl(char[] name, size_t start = 0) 
    521 { 
    522     private template IdentLoop(size_t idx) 
     520private template ValidateNameCTImpl(char[] name, uword start = 0) 
     521{ 
     522    private template IdentLoop(uword idx) 
    523523    { 
    524524        static if(idx < name.length && IsIdentChar!(name[idx])) 
  • branches/v2new/minid/func.d

    r323 r327  
    5050 
    5151    // Create a native function. 
    52     package MDFunction* create(ref Allocator alloc, MDNamespace* env, MDString* name, NativeFunc func, size_t numUpvals) 
     52    package MDFunction* create(ref Allocator alloc, MDNamespace* env, MDString* name, NativeFunc func, uword numUpvals) 
    5353    { 
    5454        auto f = alloc.allocate!(MDFunction)(NativeClosureSize(numUpvals)); 
     
    7878    } 
    7979     
    80     package nint numParams(MDFunction* f) 
     80    pa