Changeset 144 for trunk/orca/math.c

Show
Ignore:
Timestamp:
05/11/06 14:23:03 (3 years ago)
Author:
krobillard
Message:

Native arguments are now kept on the stack until after the call and the
result is now always put into a1.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/math.c

    r94 r144  
    170170 
    171171 
    172 static void orOpPower( OValue* a ) 
     172static void orOpPower( OValue* a1 ) 
    173173{ 
    174174    double x, y; 
    175     OValue* b = a + 1; 
    176     if( a->type == OT_INTEGER ) 
     175    OValue* b = a1 + 1; 
     176    if( a1->type == OT_INTEGER ) 
    177177    { 
    178178        if( b->type == OT_INTEGER ) 
     
    182182            if( n ) 
    183183            { 
    184                 sum = orInt(a); 
     184                sum = orInt(a1); 
    185185                while( --n ) 
    186                     sum *= orInt(a); 
     186                    sum *= orInt(a1); 
    187187            } 
    188188            else 
     
    195195        else if( b->type == OT_DECIMAL ) 
    196196        { 
    197             x = (double) orInt(a); 
     197            x = (double) orInt(a1); 
    198198            y = orDecimal(b); 
    199199            goto fp; 
    200200        } 
    201         a = b; 
    202     } 
    203     else if( a->type == OT_DECIMAL ) 
    204     { 
    205         x = orDecimal(a); 
     201        a1 = b; 
     202    } 
     203    else if( a1->type == OT_DECIMAL ) 
     204    { 
     205        x = orDecimal(a1); 
    206206        if( b->type == OT_INTEGER ) 
    207207        { 
     
    214214            goto fp; 
    215215        } 
    216         a = b; 
    217     } 
    218     orErrorOp( "**", a ); 
     216        a1 = b; 
     217    } 
     218    orErrorOp( "**", a1 ); 
    219219    return; 
    220220 
     
    224224 
    225225 
    226 static void orOpRemainder( OValue* a ) 
     226static void orOpRemainder( OValue* a1 ) 
    227227{ 
    228228    double x, y; 
    229     OValue* b = a + 1; 
    230     if( a->type == OT_INTEGER ) 
     229    OValue* b = a1 + 1; 
     230    if( a1->type == OT_INTEGER ) 
    231231    { 
    232232        if( b->type == OT_INTEGER ) 
    233233        { 
    234             orResult( OT_INTEGER, orInt(a) % orInt(b) ); 
     234            orResult( OT_INTEGER, orInt(a1) % orInt(b) ); 
    235235            return; 
    236236        } 
    237237        else if( b->type == OT_DECIMAL ) 
    238238        { 
    239             x = (double) orInt(a); 
     239            x = (double) orInt(a1); 
    240240            y = orDecimal(b); 
    241241            goto fp; 
    242242        } 
    243         a = b; 
    244     } 
    245     else if( a->type == OT_DECIMAL ) 
    246     { 
    247         x = orDecimal(a); 
     243        a1 = b; 
     244    } 
     245    else if( a1->type == OT_DECIMAL ) 
     246    { 
     247        x = orDecimal(a1); 
    248248        if( b->type == OT_INTEGER ) 
    249249        { 
     
    256256            goto fp; 
    257257        } 
    258         a = b; 
    259     } 
    260     orErrorOp( "//", a ); 
     258        a1 = b; 
     259    } 
     260    orErrorOp( "//", a1 ); 
    261261    return; 
    262262