Changeset 54 for trunk/orca/context.c

Show
Ignore:
Timestamp:
02/17/06 15:30:01 (3 years ago)
Author:
krobillard
Message:

Now using orDecimal() & orInt() where appropriate.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/context.c

    r45 r54  
    158158    while( it != end ) 
    159159    { 
    160         if( it->word.atom == atom ) 
     160        if( orAtom(it) == atom ) 
    161161            return it - wordBlk->values; 
    162162        ++it; 
     
    232232    while( it != end ) 
    233233    { 
    234         if( it->word.atom == atom ) 
     234        if( orAtom(it) == atom ) 
    235235            return it - wblk->values; 
    236236        ++it; 
     
    264264            // Word might be redefined mulitple times so we have to 
    265265            // orLookup() first. 
    266             wrdN = orLookup( ctx, it->word.atom ); 
     266            wrdN = orLookup( ctx, orAtom(it) ); 
    267267            if( wrdN < 0 ) 
    268                 wrdN = orInternA( wordBlk, it->word.atom ); 
     268                wrdN = orInternA( wordBlk, orAtom(it) ); 
    269269        } 
    270270        ++it; 
     
    444444        if( it->type == OT_SETWORD ) 
    445445        { 
    446             if( orLookup( orig, it->word.atom ) < 0 ) 
     446            if( orLookup( orig, orAtom(it) ) < 0 ) 
    447447                ++wcount; 
    448448        } 
     
    506506{ 
    507507    int wrdN; 
    508     wrdN = orLookup( ctx, val->word.atom ); 
     508    wrdN = orLookup( ctx, orAtom(val) ); 
    509509    if( wrdN > -1 ) 
    510510    { 
     
    571571            (it->type == OT_GETWORD) ) 
    572572        { 
    573             if( (it->word.atom == orEnv->atom_func) || 
    574                 (it->word.atom == orEnv->atom_does) ) 
     573            if( (orAtom(it) == orEnv->atom_func) || 
     574                (orAtom(it) == orEnv->atom_does) ) 
    575575                return 1; 
    576576        } 
     
    681681    vblk = orBlockPtr( ctx.wblkN ); 
    682682 
    683     if( a1->type == OT_WORD ) 
    684     { 
    685         wrdN = orLookup( &ctx, a1->word.atom ); 
     683    if( orIs(a1, OT_WORD) ) 
     684    { 
     685        wrdN = orLookup( &ctx, orAtom(a1) ); 
    686686        if( wrdN > -1 ) 
    687687        { 
     
    689689        } 
    690690    } 
    691     else if( a1->type == OT_BLOCK ) 
     691    else if( orIs(a1, OT_BLOCK) ) 
    692692    { 
    693693        OBlock* blk = orBLOCK( a1 ); 
     
    696696        while( it != end ) 
    697697        { 
    698             if( it->type == OT_WORD ) 
    699             { 
    700                 wrdN = orLookup( &ctx, a1->word.atom ); 
     698            if( orIs(it, OT_WORD) ) 
     699            { 
     700                wrdN = orLookup( &ctx, orAtom(a1) ); 
    701701                if( wrdN > -1 ) 
    702702                { 
     
    720720    OIndex wrdN; 
    721721 
    722     wrdN = orLookup( &a1->ctx, a2->word.atom ); 
     722    wrdN = orLookup( &a1->ctx, orAtom(a2) ); 
    723723    if( wrdN < 0 ) 
    724724    { 
     
    730730        // a1->context remains unchanged. 
    731731        a1->word.index = wrdN; 
    732         a1->word.atom  = a2->word.atom; 
     732        orAtom(a1)     = orAtom(a2); 
    733733    } 
    734734} 
     
    754754    { 
    755755        orMakeContext( &ctx, 1 ); 
    756         orInternA( orBlockPtr( ctx.wblkN ), a1->word.atom ); 
     756        orInternA( orBlockPtr( ctx.wblkN ), orAtom(a1) ); 
    757757    } 
    758758    else 
     
    770770        { 
    771771            if( it->type == OT_WORD ) 
    772                 orInternA( blk, it->word.atom ); 
     772                orInternA( blk, orAtom(it) ); 
    773773            ++it; 
    774774        } 
     
    846846            if( it->type == OT_WORD ) 
    847847            { 
    848                 orInternA( blk, it->word.atom ); 
     848                orInternA( blk, orAtom(it) ); 
    849849            } 
    850850            else 
     
    861861    { 
    862862        orMakeContext( &ctx, 1 ); 
    863         orInternA( orBlockPtr( ctx.wblkN ), a1->word.atom ); 
     863        orInternA( orBlockPtr( ctx.wblkN ), orAtom(a1) ); 
    864864    } 
    865865 
     
    942942            { 
    943943                for( rlen = 0; rlen < vlen; ++rlen ) 
    944                     (wval + rlen)->integer = str->charArray[ si++ ]; 
     944                    orInt(wval + rlen) = str->charArray[ si++ ]; 
    945945 
    946946                orEvalBlock( orBlockPtr( body ), bi ); 
     
    956956                while( si < str->used ) 
    957957                { 
    958                     wval->integer = str->charArray[ si++ ]; 
     958                    orInt(wval) = str->charArray[ si++ ]; 
    959959                    ++wval; 
    960960                } 
     
    11271127                        { 
    11281128                            orSetTF( val, OT_CHAR ); 
    1129                             val->integer = str->charArray[ si ]; 
     1129                            orInt(val) = str->charArray[ si ]; 
    11301130                        } 
    11311131                        else