Changeset 54 for trunk/orca/ovalue.c
- Timestamp:
- 02/17/06 15:30:01 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/ovalue.c (modified) (34 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/ovalue.c
r44 r54 396 396 397 397 // Makes sure double is aligned on 8 byte boundary. 398 assert( ((char*) res) + 8 == ((char*) & res->num.decimal) );398 assert( ((char*) res) + 8 == ((char*) &orDecimal(res)) ); 399 399 400 400 orNative( orNativeNative, "native" ); … … 651 651 if( from->type == OT_INTEGER ) 652 652 { 653 orResult( OT_ACTION, from->integer);653 orResult( OT_ACTION, orInt(from) ); 654 654 return 1; 655 655 } … … 657 657 #endif 658 658 case OT_LOGIC: 659 orResult( OT_LOGIC, from->integer? 1 : 0 );659 orResult( OT_LOGIC, orInt(from) ? 1 : 0 ); 660 660 return 1; 661 661 … … 663 663 if( from->type == OT_LOGIC ) 664 664 { 665 res->integer = from->integer;665 orInt(res) = orInt(from); 666 666 return 1; 667 667 } 668 668 else if( from->type == OT_DECIMAL ) 669 669 { 670 res->integer = (int) from->num.decimal;670 orInt(res) = (int) orDecimal(from); 671 671 return 1; 672 672 } … … 677 677 char* end = str->charArray + str->used; 678 678 const char* fin; 679 res->integer= orStringToInt( it, end, &fin );679 orInt(res) = orStringToInt( it, end, &fin ); 680 680 if( fin == end ) 681 681 return 1; … … 687 687 (from->type == OT_LOGIC) ) 688 688 { 689 res->num.decimal = (double) from->integer;689 orDecimal(res) = (double) orInt(from); 690 690 return 1; 691 691 } … … 696 696 char* end = str->charArray + str->used; 697 697 const char* fin; 698 res->num.decimal= orStringToDec( it, end, &fin );698 orDecimal(res) = orStringToDec( it, end, &fin ); 699 699 if( fin == end ) 700 700 return 1; … … 735 735 if( it->type != OT_INTEGER ) 736 736 break; 737 *tuple++ = it->integer;737 *tuple++ = orInt(it); 738 738 ++it; 739 739 } … … 760 760 if( a1->type == OT_DATATYPE ) 761 761 { 762 if( orMake( a1->integer, a2, a1 ) )762 if( orMake( orInt(a1), a2, a1 ) ) 763 763 return; 764 764 765 switch( a1->integer)765 switch( orInt(a1) ) 766 766 { 767 767 case OT_BLOCK: 768 768 if( a2->type == OT_INTEGER ) 769 769 { 770 OBlock* blk = orMakeBlock( a2->integer);770 OBlock* blk = orMakeBlock( orInt(a2) ); 771 771 orResultBLOCK( blk - orBLOCKS ); 772 772 return; … … 777 777 if( a2->type == OT_INTEGER ) 778 778 { 779 OString* str = orMakeString( a2->integer);779 OString* str = orMakeString( orInt(a2) ); 780 780 orResultSTRING( str - orSTRINGS ); 781 781 return; … … 843 843 else if( a2->type == OT_INTEGER ) 844 844 { 845 OBlock* blk = orMakeList( a2->integer);845 OBlock* blk = orMakeList( orInt(a2) ); 846 846 orResultSeries( OT_LIST, orBlockN(blk), LIST_TAIL ); 847 847 return; … … 869 869 { 870 870 OValue* res = orRESULT; 871 orSetTF( res, a1->integer);871 orSetTF( res, orInt(a1) ); 872 872 res->vec3.x = 0.0f; 873 873 res->vec3.y = 0.0f; … … 922 922 type = a1->type; 923 923 if( type == OT_DATATYPE ) 924 type = a1->integer;924 type = orInt(a1); 925 925 926 926 if( type == a2->type ) … … 1477 1477 int logic; 1478 1478 if( (a1->type == OT_NONE) || 1479 ((a1->type == OT_LOGIC) && ( a1->integer== OR_FALSE)) )1479 ((a1->type == OT_LOGIC) && (orInt(a1) == OR_FALSE)) ) 1480 1480 logic = OR_TRUE; 1481 1481 else … … 1515 1515 if( a1->type != OT_NONE ) 1516 1516 { 1517 if( (a1->type != OT_LOGIC) || ( a1->integer!= 0) )1517 if( (a1->type != OT_LOGIC) || (orInt(a1) != 0) ) 1518 1518 --blkArg; 1519 1519 } … … 1526 1526 OIndex body; 1527 1527 OIndex bi; 1528 int n = a1->integer;1528 int n = orInt(a1); 1529 1529 1530 1530 ++a1; … … 1556 1556 { 1557 1557 int counter = 0; 1558 int n = a2->integer;1558 int n = orInt(a2); 1559 1559 orSetTF( wval, OT_INTEGER ); 1560 1560 while( counter < n ) 1561 1561 { 1562 wval->integer= ++counter;1562 orInt(wval) = ++counter; 1563 1563 orEvalBlock( orBLOCKS + body, bi ); 1564 1564 if( orErrorThrown ) … … 1600 1600 if( si >= str->used ) 1601 1601 break; 1602 wval->integer= str->charArray[ si++ ];1602 orInt(wval) = str->charArray[ si++ ]; 1603 1603 orEvalBlock( orBLOCKS + body, bi ); 1604 1604 if( orErrorThrown ) … … 1628 1628 if( res->type != OT_NONE ) 1629 1629 { 1630 if( (res->type != OT_LOGIC) || ( res->integer!= 0) )1630 if( (res->type != OT_LOGIC) || (orInt(res) != 0) ) 1631 1631 break; 1632 1632 } … … 1657 1657 if( res->type != OT_NONE ) 1658 1658 { 1659 if( (res->type != OT_LOGIC) || ( res->integer!= 0) )1659 if( (res->type != OT_LOGIC) || (orInt(res) != 0) ) 1660 1660 { 1661 1661 if( onstack ) … … 1927 1927 if( pit->type == OT_INTEGER ) 1928 1928 { 1929 orPick( cres, pit->integer- 1, result );1929 orPick( cres, orInt(pit) - 1, result ); 1930 1930 } 1931 1931 else if( pit->type == OT_GETWORD ) … … 1935 1935 if( wval->type != OT_INTEGER ) 1936 1936 goto invalid; 1937 orPick( cres, wval->integer- 1, result );1937 orPick( cres, orInt(wval) - 1, result ); 1938 1938 } 1939 1939 else … … 1967 1967 if( pit->type == OT_INTEGER ) 1968 1968 { 1969 orPick( cres, pit->integer- 1, result );1969 orPick( cres, orInt(pit) - 1, result ); 1970 1970 cres = result; 1971 1971 } … … 2036 2036 if( end->type == OT_INTEGER ) 2037 2037 { 2038 result->series.it = end->integer- 1;2038 result->series.it = orInt(end) - 1; 2039 2039 } 2040 2040 else if( end->type == OT_GETWORD ) … … 2045 2045 if( val->type != OT_INTEGER ) 2046 2046 goto invalid; 2047 result->series.it = val->integer- 1;2047 result->series.it = orInt(val) - 1; 2048 2048 } 2049 2049 else if( end->type == OT_WORD ) … … 2103 2103 int index = ser->series.it; 2104 2104 if( index < str->used ) 2105 str->charArray[ index ] = val->integer;2105 str->charArray[ index ] = orInt(val); 2106 2106 } 2107 2107 break; … … 2781 2781 it = DATA_TOP + (count - funcv->argc - refc); 2782 2782 it->type = OT_LOGIC; 2783 it->integer= 1;2783 orLogic(it) = 1; 2784 2784 2785 2785 if( si->LAST_ARG ) … … 2995 2995 if( res->type != OT_NONE ) 2996 2996 { 2997 if( (res->type != OT_LOGIC) || ( res->integer!= 0) )2997 if( (res->type != OT_LOGIC) || (orLogic(res) != 0) ) 2998 2998 { 2999 2999 return; … … 3028 3028 3029 3029 res = orRESULT; 3030 if( res->type == OT_NONE)3030 if( orIs(res, OT_NONE) ) 3031 3031 goto fail; 3032 if( (res->type == OT_LOGIC) && (res->integer== 0) )3032 if( orIs(res, OT_LOGIC) && (orLogic(res) == 0) ) 3033 3033 goto fail; 3034 3034 } … … 3110 3110 else if( it->type == OT_DATATYPE ) 3111 3111 { 3112 dprint( " %s\n", orDatatypeName( it->integer) );3112 dprint( " %s\n", orDatatypeName(orInt(it)) ); 3113 3113 } 3114 3114 else if( (it->type == OT_OBJECT) || … … 3812 3812 3813 3813 case OT_CHAR: 3814 orSetBit( bin->byteArray, it->integer);3815 range = it->integer;3814 orSetBit( bin->byteArray, orInt(it) ); 3815 range = orInt(it); 3816 3816 break; 3817 3817 … … 3823 3823 if( (rend != end) && (rend->type == OT_CHAR) ) 3824 3824 { 3825 r2 = rend->integer;3825 r2 = orInt(rend); 3826 3826 while( range < r2 ) 3827 3827 { … … 3981 3981 3982 3982 orSetTF( val, OT_DECIMAL ); 3983 val->num.decimal= n;3983 orDecimal(val) = n; 3984 3984 return val; 3985 3985 } … … 4061 4061 orWordVal( it, ctxBlk, val ); 4062 4062 if( val->type == OT_DATATYPE ) 4063 it->integer = val->integer;4063 orInt(it) = orInt(val); 4064 4064 else 4065 it->integer= val->type;4065 orInt(it) = val->type; 4066 4066 } 4067 4067 else 4068 4068 { 4069 it->integer= it->type;4069 orInt(it) = it->type; 4070 4070 } 4071 4071 it->type = OT_DATATYPE;
