Changeset 54 for trunk/orca/series.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/series.c

    r42 r54  
    512512            else if( a2->type == OT_CHAR ) 
    513513            { 
    514                 char tmp = a2->integer; 
     514                char tmp = orInt(a2); 
    515515                stringInsert( a1, &tmp, 1 ); 
    516516            } 
     
    584584 
    585585    if( orRefineSet(REF_RM_PART) ) 
    586         len = (REF_RM_RANGE)->integer; 
     586        len = orInt(REF_RM_RANGE); 
    587587    else 
    588588        len = 1; 
     
    710710            { 
    711711                orSetTF( result, OT_CHAR ); 
    712                 result->integer = str->charArray[ n ]; 
     712                orInt(result) = str->charArray[ n ]; 
    713713                return 1; 
    714714            } 
     
    723723            { 
    724724                orSetTF( result, OT_INTEGER ); 
    725                 result->integer = str->byteArray[ n ]; 
     725                orInt(result) = str->byteArray[ n ]; 
    726726                return 1; 
    727727            } 
     
    733733            { 
    734734                orSetTF( result, OT_INTEGER ); 
    735                 result->integer = ser->pair[ n ]; 
     735                orInt(result) = ser->pair[ n ]; 
    736736                return 1; 
    737737            } 
     
    742742            { 
    743743                orSetTF( result, OT_INTEGER ); 
    744                 result->integer = ser->tuple[ n ]; 
     744                orInt(result) = ser->tuple[ n ]; 
    745745                return 1; 
    746746            } 
     
    773773                const float* fp = &ser->vec3.x; 
    774774                orSetTF( result, OT_DECIMAL ); 
    775                 result->num.decimal = (double) fp[ n ]; 
     775                orDecimal(result) = (double) fp[ n ]; 
    776776                return 1; 
    777777            } 
     
    783783                OArray* arr = orSTRING( ser ); 
    784784                orSetTF( result, OT_DECIMAL ); 
    785                 result->num.decimal = (double) arr->floats[ n ]; 
     785                orDecimal(result) = (double) arr->floats[ n ]; 
    786786                return 1; 
    787787            } 
     
    797797            { 
    798798                orSetTF( result, OT_DECIMAL ); 
    799                 result->num.decimal = arr->decimals[ n ]; 
     799                orDecimal(result) = arr->decimals[ n ]; 
    800800                return 1; 
    801801            } 
     
    810810            { 
    811811                orSetTF( result, OT_INTEGER ); 
    812                 result->integer = arr->integers[ n ]; 
     812                orInt(result) = arr->integers[ n ]; 
    813813                return 1; 
    814814            } 
     
    876876                break; 
    877877            orSetTF( result, OT_CHAR ); 
    878             result->integer = str->charArray[ str->used - 1 ]; 
     878            orInt(result) = str->charArray[ str->used - 1 ]; 
    879879        } 
    880880            return; 
     
    908908                break; 
    909909            orSetTF( result, OT_DECIMAL ); 
    910             result->num.decimal = arr->decimals[ arr->used - 1 ]; 
     910            orDecimal(result) = arr->decimals[ arr->used - 1 ]; 
    911911        } 
    912912            return; 
     
    918918                break; 
    919919            orSetTF( result, OT_INTEGER ); 
    920             result->integer = arr->integers[ arr->used - 1 ]; 
     920            orInt(result) = arr->integers[ arr->used - 1 ]; 
    921921        } 
    922922            return; 
     
    964964        OValue* rval = REF_REV_RANGE; 
    965965        if( rval->type == OT_INTEGER ) 
    966             range = rval->integer; 
     966            range = orInt(rval); 
    967967        else 
    968968            range = rval->series.it; 
     
    10461046    { 
    10471047        if( a2->type == OT_INTEGER ) 
    1048             n = a2->integer; 
     1048            n = orInt(a2); 
    10491049        else if( a2->type == OT_DECIMAL ) 
    1050             n = (int) a2->num.decimal; 
     1050            n = (int) orDecimal(a2); 
    10511051        else    // OT_LOGIC 
    1052             n = a2->integer ? 0 : 1; 
     1052            n = orInt(a2) ? 0 : 1; 
    10531053 
    10541054        if( n ) 
     
    10751075    if( a2->type == OT_LOGIC ) 
    10761076    { 
    1077         n = a2->integer ? 0 : 1; 
     1077        n = orInt(a2) ? 0 : 1; 
    10781078    } 
    10791079    else 
    10801080    { 
    10811081        if( a2->type == OT_INTEGER ) 
    1082             n = a2->integer; 
     1082            n = orInt(a2); 
    10831083        else    // OT_DECIMAL 
    1084             n = ((int) a2->num.decimal); 
     1084            n = ((int) orDecimal(a2)); 
    10851085        if( n == 1 ) 
    10861086            n = 0; 
     
    11051105    if( a2->type == OT_INTEGER ) 
    11061106    { 
    1107         n = a2->integer; 
     1107        n = orInt(a2); 
    11081108        if( n > 0 ) 
    11091109            --n; 
     
    11131113    else if( a2->type == OT_DECIMAL ) 
    11141114    { 
    1115         n = (int) a2->num.decimal; 
     1115        n = (int) orDecimal(a2); 
    11161116        if( n > 0 ) 
    11171117            --n; 
     
    11211121    else    // OT_LOGIC 
    11221122    { 
    1123         n = a2->integer ? 0 : 1; 
     1123        n = orInt(a2) ? 0 : 1; 
    11241124    } 
    11251125 
     
    11441144 
    11451145    if( a2->type == OT_INTEGER ) 
    1146         n = a2->integer - 1; 
     1146        n = orInt(a2) - 1; 
    11471147    else if( a2->type == OT_DECIMAL ) 
    1148         n = ((int) a2->num.decimal) - 1; 
     1148        n = ((int) orDecimal(a2)) - 1; 
    11491149    else    // OT_LOGIC 
    1150         n = a2->integer ? 0 : 1; 
     1150        n = orInt(a2) ? 0 : 1; 
    11511151 
    11521152    n += a1->series.it; 
     
    11851185                if( n < str->used ) 
    11861186                { 
    1187                     str->charArray[ n ] = a3->integer; 
     1187                    str->charArray[ n ] = orInt(a3); 
    11881188                    orResultCopy( *a3 ); 
    11891189                    return; 
     
    11991199                if( n < arr->used ) 
    12001200                { 
    1201                     arr->decimals[ n ] = a3->num.decimal; 
     1201                    arr->decimals[ n ] = orDecimal(a3); 
    12021202                    orResultCopy( *a3 ); 
    12031203                    return; 
     
    12121212                if( n < arr->used ) 
    12131213                { 
    1214                     arr->integers[ n ] = a3->integer; 
     1214                    arr->integers[ n ] = orInt(a3); 
    12151215                    orResultCopy( *a3 ); 
    12161216                    return; 
     
    12861286            while( it != end ) 
    12871287            { 
    1288                 if( *it == a2->integer ) 
     1288                if( *it == orInt(a2) ) 
    12891289                { 
    12901290                    ++it; 
     
    14781478            OValue* rng = REF_COPY_RANGE; 
    14791479            if( rng->type == OT_INTEGER ) 
    1480                 part = rng->integer; 
     1480                part = orInt(rng); 
    14811481            else if( orIsSeries(rng->type) && orIsSeries(a1->type) ) 
    14821482                part = rng->series.it - a1->series.it; 
     
    15351535                    if( orRefineSet(REF_CHANGE_PART) ) 
    15361536                    { 
    1537                         int range = (REF_CHANGE_RANGE)->integer; 
     1537                        int range = orInt(REF_CHANGE_RANGE); 
    15381538                        if( range < len2 ) 
    15391539                        { 
     
    16101610                    ++s1->used; 
    16111611                } 
    1612                 s1->charArray[ a1->series.it ] = a2->integer; 
     1612                s1->charArray[ a1->series.it ] = orInt(a2); 
    16131613                a1->series.it += 1; 
    16141614                return; 
     
    16361636 
    16371637                    if( rngVal->type == OT_INTEGER ) 
    1638                         range = rngVal->integer; 
     1638                        range = orInt(rngVal); 
    16391639                    else 
    16401640                        range = rngVal->series.it - a1->series.it; 
     
    18401840            { 
    18411841                if( orRefineSet(REF_FIND_LAST) ) 
    1842                     found = orFindByteRev( s1, a1->series.it, a2->integer ); 
     1842                    found = orFindByteRev( s1, a1->series.it, orInt(a2) ); 
    18431843                else 
    1844                     found = orFindByte( s1, a1->series.it, a2->integer ); 
     1844                    found = orFindByte( s1, a1->series.it, orInt(a2) ); 
    18451845                if( found > -1 ) 
    18461846                { 
     
    19051905        char* pend; 
    19061906        OValue* a3 = a1 + 2; 
    1907         if( a3->integer < 0 ) 
     1907        if( orInt(a3) < 0 ) 
    19081908        { 
    19091909            orError( "/part less than zero." ); 
    19101910            return; 
    19111911        } 
    1912         pend = cp + a3->integer; 
     1912        pend = cp + orInt(a3); 
    19131913        if( end > pend ) 
    19141914            end = pend; 
     
    19361936        char* pend; 
    19371937        OValue* a3 = a1 + 2; 
    1938         if( a3->integer < 0 ) 
     1938        if( orInt(a3) < 0 ) 
    19391939        { 
    19401940            orError( "/part less than zero." ); 
    19411941            return; 
    19421942        } 
    1943         pend = cp + a3->integer; 
     1943        pend = cp + orInt(a3); 
    19441944        if( end > pend ) 
    19451945            end = pend;