Changeset 54 for trunk/orca/series.c
- Timestamp:
- 02/17/06 15:30:01 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/series.c (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/series.c
r42 r54 512 512 else if( a2->type == OT_CHAR ) 513 513 { 514 char tmp = a2->integer;514 char tmp = orInt(a2); 515 515 stringInsert( a1, &tmp, 1 ); 516 516 } … … 584 584 585 585 if( orRefineSet(REF_RM_PART) ) 586 len = (REF_RM_RANGE)->integer;586 len = orInt(REF_RM_RANGE); 587 587 else 588 588 len = 1; … … 710 710 { 711 711 orSetTF( result, OT_CHAR ); 712 result->integer= str->charArray[ n ];712 orInt(result) = str->charArray[ n ]; 713 713 return 1; 714 714 } … … 723 723 { 724 724 orSetTF( result, OT_INTEGER ); 725 result->integer= str->byteArray[ n ];725 orInt(result) = str->byteArray[ n ]; 726 726 return 1; 727 727 } … … 733 733 { 734 734 orSetTF( result, OT_INTEGER ); 735 result->integer= ser->pair[ n ];735 orInt(result) = ser->pair[ n ]; 736 736 return 1; 737 737 } … … 742 742 { 743 743 orSetTF( result, OT_INTEGER ); 744 result->integer= ser->tuple[ n ];744 orInt(result) = ser->tuple[ n ]; 745 745 return 1; 746 746 } … … 773 773 const float* fp = &ser->vec3.x; 774 774 orSetTF( result, OT_DECIMAL ); 775 result->num.decimal= (double) fp[ n ];775 orDecimal(result) = (double) fp[ n ]; 776 776 return 1; 777 777 } … … 783 783 OArray* arr = orSTRING( ser ); 784 784 orSetTF( result, OT_DECIMAL ); 785 result->num.decimal= (double) arr->floats[ n ];785 orDecimal(result) = (double) arr->floats[ n ]; 786 786 return 1; 787 787 } … … 797 797 { 798 798 orSetTF( result, OT_DECIMAL ); 799 result->num.decimal= arr->decimals[ n ];799 orDecimal(result) = arr->decimals[ n ]; 800 800 return 1; 801 801 } … … 810 810 { 811 811 orSetTF( result, OT_INTEGER ); 812 result->integer= arr->integers[ n ];812 orInt(result) = arr->integers[ n ]; 813 813 return 1; 814 814 } … … 876 876 break; 877 877 orSetTF( result, OT_CHAR ); 878 result->integer= str->charArray[ str->used - 1 ];878 orInt(result) = str->charArray[ str->used - 1 ]; 879 879 } 880 880 return; … … 908 908 break; 909 909 orSetTF( result, OT_DECIMAL ); 910 result->num.decimal= arr->decimals[ arr->used - 1 ];910 orDecimal(result) = arr->decimals[ arr->used - 1 ]; 911 911 } 912 912 return; … … 918 918 break; 919 919 orSetTF( result, OT_INTEGER ); 920 result->integer= arr->integers[ arr->used - 1 ];920 orInt(result) = arr->integers[ arr->used - 1 ]; 921 921 } 922 922 return; … … 964 964 OValue* rval = REF_REV_RANGE; 965 965 if( rval->type == OT_INTEGER ) 966 range = rval->integer;966 range = orInt(rval); 967 967 else 968 968 range = rval->series.it; … … 1046 1046 { 1047 1047 if( a2->type == OT_INTEGER ) 1048 n = a2->integer;1048 n = orInt(a2); 1049 1049 else if( a2->type == OT_DECIMAL ) 1050 n = (int) a2->num.decimal;1050 n = (int) orDecimal(a2); 1051 1051 else // OT_LOGIC 1052 n = a2->integer? 0 : 1;1052 n = orInt(a2) ? 0 : 1; 1053 1053 1054 1054 if( n ) … … 1075 1075 if( a2->type == OT_LOGIC ) 1076 1076 { 1077 n = a2->integer? 0 : 1;1077 n = orInt(a2) ? 0 : 1; 1078 1078 } 1079 1079 else 1080 1080 { 1081 1081 if( a2->type == OT_INTEGER ) 1082 n = a2->integer;1082 n = orInt(a2); 1083 1083 else // OT_DECIMAL 1084 n = ((int) a2->num.decimal);1084 n = ((int) orDecimal(a2)); 1085 1085 if( n == 1 ) 1086 1086 n = 0; … … 1105 1105 if( a2->type == OT_INTEGER ) 1106 1106 { 1107 n = a2->integer;1107 n = orInt(a2); 1108 1108 if( n > 0 ) 1109 1109 --n; … … 1113 1113 else if( a2->type == OT_DECIMAL ) 1114 1114 { 1115 n = (int) a2->num.decimal;1115 n = (int) orDecimal(a2); 1116 1116 if( n > 0 ) 1117 1117 --n; … … 1121 1121 else // OT_LOGIC 1122 1122 { 1123 n = a2->integer? 0 : 1;1123 n = orInt(a2) ? 0 : 1; 1124 1124 } 1125 1125 … … 1144 1144 1145 1145 if( a2->type == OT_INTEGER ) 1146 n = a2->integer- 1;1146 n = orInt(a2) - 1; 1147 1147 else if( a2->type == OT_DECIMAL ) 1148 n = ((int) a2->num.decimal) - 1;1148 n = ((int) orDecimal(a2)) - 1; 1149 1149 else // OT_LOGIC 1150 n = a2->integer? 0 : 1;1150 n = orInt(a2) ? 0 : 1; 1151 1151 1152 1152 n += a1->series.it; … … 1185 1185 if( n < str->used ) 1186 1186 { 1187 str->charArray[ n ] = a3->integer;1187 str->charArray[ n ] = orInt(a3); 1188 1188 orResultCopy( *a3 ); 1189 1189 return; … … 1199 1199 if( n < arr->used ) 1200 1200 { 1201 arr->decimals[ n ] = a3->num.decimal;1201 arr->decimals[ n ] = orDecimal(a3); 1202 1202 orResultCopy( *a3 ); 1203 1203 return; … … 1212 1212 if( n < arr->used ) 1213 1213 { 1214 arr->integers[ n ] = a3->integer;1214 arr->integers[ n ] = orInt(a3); 1215 1215 orResultCopy( *a3 ); 1216 1216 return; … … 1286 1286 while( it != end ) 1287 1287 { 1288 if( *it == a2->integer)1288 if( *it == orInt(a2) ) 1289 1289 { 1290 1290 ++it; … … 1478 1478 OValue* rng = REF_COPY_RANGE; 1479 1479 if( rng->type == OT_INTEGER ) 1480 part = rng->integer;1480 part = orInt(rng); 1481 1481 else if( orIsSeries(rng->type) && orIsSeries(a1->type) ) 1482 1482 part = rng->series.it - a1->series.it; … … 1535 1535 if( orRefineSet(REF_CHANGE_PART) ) 1536 1536 { 1537 int range = (REF_CHANGE_RANGE)->integer;1537 int range = orInt(REF_CHANGE_RANGE); 1538 1538 if( range < len2 ) 1539 1539 { … … 1610 1610 ++s1->used; 1611 1611 } 1612 s1->charArray[ a1->series.it ] = a2->integer;1612 s1->charArray[ a1->series.it ] = orInt(a2); 1613 1613 a1->series.it += 1; 1614 1614 return; … … 1636 1636 1637 1637 if( rngVal->type == OT_INTEGER ) 1638 range = rngVal->integer;1638 range = orInt(rngVal); 1639 1639 else 1640 1640 range = rngVal->series.it - a1->series.it; … … 1840 1840 { 1841 1841 if( orRefineSet(REF_FIND_LAST) ) 1842 found = orFindByteRev( s1, a1->series.it, a2->integer);1842 found = orFindByteRev( s1, a1->series.it, orInt(a2) ); 1843 1843 else 1844 found = orFindByte( s1, a1->series.it, a2->integer);1844 found = orFindByte( s1, a1->series.it, orInt(a2) ); 1845 1845 if( found > -1 ) 1846 1846 { … … 1905 1905 char* pend; 1906 1906 OValue* a3 = a1 + 2; 1907 if( a3->integer< 0 )1907 if( orInt(a3) < 0 ) 1908 1908 { 1909 1909 orError( "/part less than zero." ); 1910 1910 return; 1911 1911 } 1912 pend = cp + a3->integer;1912 pend = cp + orInt(a3); 1913 1913 if( end > pend ) 1914 1914 end = pend; … … 1936 1936 char* pend; 1937 1937 OValue* a3 = a1 + 2; 1938 if( a3->integer< 0 )1938 if( orInt(a3) < 0 ) 1939 1939 { 1940 1940 orError( "/part less than zero." ); 1941 1941 return; 1942 1942 } 1943 pend = cp + a3->integer;1943 pend = cp + orInt(a3); 1944 1944 if( end > pend ) 1945 1945 end = pend;
