Changeset 105 for trunk/orca/ovalue.c
- Timestamp:
- 03/30/06 14:50:55 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/ovalue.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/ovalue.c
r99 r105 641 641 642 642 643 /* 644 Returns non-zero of successful. 645 */ 643 646 static int orMake( int type, OValue* from, OValue* res ) 644 647 { … … 651 654 case OT_GETWORD: 652 655 case OT_LITWORD: 653 if( from->type == OT_STRING)656 if( orIs(from, OT_STRING) ) 654 657 { 655 658 OContext ctx; … … 662 665 return 1; 663 666 } 664 else if( from->type == OT_WORD)667 else if( orIs(from, OT_WORD) ) 665 668 { 666 669 res->word = from->word; … … 683 686 684 687 case OT_INTEGER: 685 if( from->type == OT_LOGIC)688 if( orIs(from, OT_LOGIC) ) 686 689 { 687 690 orInt(res) = orInt(from); 688 691 return 1; 689 692 } 690 else if( from->type == OT_DECIMAL)693 else if( orIs(from, OT_DECIMAL) ) 691 694 { 692 695 orInt(res) = (int) orDecimal(from); 693 696 return 1; 694 697 } 695 else if( from->type == OT_STRING)698 else if( orIs(from, OT_STRING) ) 696 699 { 697 700 OString* str = orSTRING(from); … … 706 709 707 710 case OT_DECIMAL: 708 if( (from->type ==OT_INTEGER) ||709 (from->type ==OT_LOGIC) )711 if( orIs(from, OT_INTEGER) || 712 orIs(from, OT_LOGIC) ) 710 713 { 711 714 orDecimal(res) = (double) orInt(from); … … 725 728 726 729 case OT_PAIR: 727 if( from->type == OT_BLOCK)730 if( orIs(from, OT_BLOCK) ) 728 731 { 729 732 OBlock* blk = orBLOCK( from ); … … 744 747 745 748 case OT_TUPLE: 746 if( from->type == OT_BLOCK)749 if( orIs(from, OT_BLOCK) ) 747 750 { 748 751 OBlock* blk = orBLOCK( from ); … … 768 771 } 769 772 break; 773 774 case OT_BINARY: 775 if( orIs(from, OT_STRING) ) 776 { 777 OString* str; 778 OBinary* bin; 779 int len; 780 781 str = orSTRING( from ); 782 len = str->used - from->series.it; 783 784 bin = orMakeBinary( len ); 785 bin->used = len; 786 memCpy(bin->byteArray, str->charArray + from->series.it, len); 787 788 orSetTF( res, OT_BINARY ); 789 orSetSeries( res, orBinaryN(bin), 0 ); 790 return 1; 791 } 792 break; 770 793 } 771 794 … … 777 800 static OBinary* _makeBitset( OBlock* blk, int index ); 778 801 779 void orMakeNative( OValue* a1)802 OR_NATIVE( orMakeNative ) 780 803 { 781 804 OValue* a2 = a1 + 1;
