Changeset 153
- Timestamp:
- 05/14/06 04:07:39 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/ovalue.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/ovalue.c
r148 r153 650 650 static int orMake( int type, OValue* from, OValue* res ) 651 651 { 652 orSetTF( res, type );653 654 652 switch( type ) 655 653 { … … 667 665 orIntern( &ctx, str->charArray + start, 668 666 str->used - start, res ); 667 orSetTF( res, type ); 669 668 return 1; 670 669 } 671 670 else if( orIs(from, OT_WORD) ) 672 671 { 672 orSetTF( res, type ); 673 673 res->word = from->word; 674 674 return 1; … … 693 693 if( orIs(from, OT_LOGIC) ) 694 694 { 695 orSetTF( res, type ); 695 696 orInt(res) = orInt(from); 696 697 return 1; … … 698 699 else if( orIs(from, OT_DECIMAL) ) 699 700 { 701 orSetTF( res, type ); 700 702 orInt(res) = (int) orDecimal(from); 701 703 return 1; … … 707 709 char* end = str->charArray + str->used; 708 710 const char* fin; 709 orInt(res) = orStringToInt( it, end, &fin ); 711 int n; 712 n = orStringToInt( it, end, &fin ); 710 713 if( fin == end ) 714 { 715 orSetTF( res, type ); 716 orInt(res) = n; 711 717 return 1; 718 } 712 719 } 713 720 break; … … 717 724 orIs(from, OT_LOGIC) ) 718 725 { 726 orSetTF( res, type ); 719 727 orDecimal(res) = (double) orInt(from); 720 728 return 1; … … 726 734 char* end = str->charArray + str->used; 727 735 const char* fin; 728 orDecimal(res) = orStringToDec( it, end, &fin ); 736 double n; 737 n = orStringToDec( it, end, &fin ); 729 738 if( fin == end ) 739 { 740 orSetTF( res, type ); 741 orDecimal(res) = n; 730 742 return 1; 743 } 731 744 } 732 745 break; … … 769 782 if( it == end ) 770 783 { 784 orSetTF( res, OT_TUPLE ); 771 785 res->argc = tuple - res->tuple; 772 786 return 1; … … 979 993 980 994 res = a1; 981 orSetTF( res, type );982 995 983 996 if( orIsBlock(type) ) … … 985 998 if( orIsBlock(a2->type) ) 986 999 { 1000 orSetTF( res, type ); 987 1001 res->series = a2->series; 988 1002 return; … … 992 1006 { 993 1007 OBlock* blk = orMakeBlock( 3 ); 1008 orSetTF( res, type ); 994 1009 orSetSeries( res, orBlockN(blk), 0 ); 995 1010 orAppendDecimal( blk, a2->vec3.x ); … … 1003 1018 OString* arr = orSTRING(a2); 1004 1019 OBlock* blk = orMakeBlock( 16 ); 1020 orSetTF( res, type ); 1005 1021 orSetSeries( res, orBlockN(blk), 0 ); 1006 1022 for( i = 0; i < 16; ++i ) … … 1014 1030 OBinary* bin = orSTRINGS + a2->index; 1015 1031 OBlock* blk = orMakeBlock( 0 ); 1032 orSetTF( res, type ); 1016 1033 orSetSeries( res, orBlockN(blk), 0 ); 1017 1034 … … 1033 1050 blk->used = 1; 1034 1051 1052 orSetTF( res, type ); 1035 1053 orSetSeries( res, blk - orBLOCKS, 0 ); 1036 1054 return; … … 1041 1059 if( orIsString(a2->type) ) 1042 1060 { 1061 orSetTF( res, type ); 1043 1062 res->series = a2->series; 1044 1063 return; … … 1052 1071 1053 1072 str = orMakeString( 0 ); 1073 orSetTF( res, type ); 1054 1074 orSetSeries( res, str - orSTRINGS, 0 ); 1055 1075 … … 1065 1085 OString* str = orMakeString( 0 ); 1066 1086 orForm( str, a2 ); 1087 orSetTF( res, type ); 1067 1088 orSetSeries( res, str - orSTRINGS, 0 ); 1068 1089 return; … … 1075 1096 { 1076 1097 OBinary* bin = orMakeBinary( 0 ); 1098 orSetTF( res, type ); 1077 1099 orSetSeries( res, orBinaryN(bin), 0 ); 1078 1100 orCompileByteCodes( bin, a2 ); … … 1756 1778 orSetTF( val, OT_ERROR ); 1757 1779 val->argc = type; 1780 val->error.block = 0; // Init for orSetErrorLoc(). 1758 1781 1759 1782 orEnv->error = val;
