Changeset 58 for trunk/orca/op.c
- Timestamp:
- 02/21/06 23:18:49 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/op.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/op.c
r56 r58 671 671 } 672 672 673 #if 0674 static int tupleSame( const OValue* a, const OValue* b )675 {676 if( a->argc == b->argc )677 {678 int i;679 for( i = 0; i < a->argc; ++i )680 {681 if( a->tuple[i] != b->tuple[i] )682 return 0;683 }684 return 1;685 }686 return 0;687 }688 #endif689 690 673 691 674 static int orTypeEqual( const OValue* a, const OValue* b ) … … 826 809 else if( orType(a) == orType(b) ) 827 810 { 828 if( orIs(a, OT_WORD) ) // Should it be orIsWord(a)811 if( orIs(a, OT_WORD) ) 829 812 { 830 813 if( (a->word.atom == b->word.atom) && … … 837 820 logic = 1; 838 821 } 839 else if( orIsSeries( a->type) )822 else if( orIsSeries( orType(a) ) ) 840 823 { 841 824 if( (a->series.n == b->series.n) && … … 845 828 else if( orIs(a, OT_TUPLE) ) 846 829 { 847 logic = compareValue( a, b ); // tupleSame( a, b );830 logic = compareValue( a, b ); 848 831 } 849 832 } … … 925 908 if( orIs(b, OT_TUPLE) ) 926 909 { 927 int argc,i;928 a rgc = a->argc > b->argc ? a->argc : b->argc;929 for( i = 0; i < a rgc; i++ )910 int i; 911 a->argc = a->argc > b->argc ? a->argc : b->argc; 912 for( i = 0; i < a->argc; i++ ) 930 913 { 931 914 a->tuple[i] = a->tuple[i] & b->tuple[i]; … … 947 930 for( i = 0; i < a->argc; i++ ) 948 931 { 949 a->tuple[i] = a->tuple[i] & (int) orDecimal(b); 932 a->tuple[i] = a->tuple[i] & (int) orDecimal(b); 950 933 } 951 934 return; … … 982 965 if( orIs(b, OT_TUPLE) ) 983 966 { 984 int argc,i;985 a rgc = a->argc > b->argc ? a->argc : b->argc;986 for( i = 0; i < a rgc; i++ )967 int i; 968 a->argc = a->argc > b->argc ? a->argc : b->argc; 969 for( i = 0; i < a->argc; i++ ) 987 970 { 988 971 a->tuple[i] = a->tuple[i] | b->tuple[i]; … … 993 976 { 994 977 int i; 978 #ifndef LANG_ORCA 979 int tmp; 980 #endif 995 981 for( i = 0; i < a->argc; i++ ) 996 982 { 983 #ifdef LANG_ORCA 997 984 a->tuple[i] = a->tuple[i] | orInt(b); 985 #else 986 tmp = orToByteRange( orInt(b) ); 987 if ( tmp == 0) 988 a->tuple[i] = 0; 989 else if ( tmp == 255 ) 990 a->tuple[i] = 255; 991 else 992 a->tuple[i] = a->tuple[i] | orInt(b); 993 #endif 998 994 } 999 995 return; … … 1002 998 { 1003 999 int i; 1000 #ifndef LANG_ORCA 1001 int tmp; 1002 #endif 1004 1003 for( i = 0; i < a->argc; i++ ) 1005 1004 { 1005 #ifdef LANG_ORCA 1006 1006 a->tuple[i] = a->tuple[i] | (int) orDecimal(b); 1007 #else 1008 tmp = orToByteRange( (int) orDecimal(b) ); 1009 if ( tmp == 0) 1010 a->tuple[i] = 0; 1011 else if ( tmp == 255 ) 1012 a->tuple[i] = 255; 1013 else 1014 a->tuple[i] = a->tuple[i] | orToByteRange( (int) orDecimal(b) ); 1015 #endif 1007 1016 } 1008 1017 return; … … 1039 1048 if( orIs(b, OT_TUPLE) ) 1040 1049 { 1041 int argc,i;1042 a rgc = a->argc > b->argc ? a->argc : b->argc;1043 for( i = 0; i < a rgc; i++ )1050 int i; 1051 a->argc = a->argc > b->argc ? a->argc : b->argc; 1052 for( i = 0; i < a->argc; i++ ) 1044 1053 { 1045 1054 a->tuple[i] = a->tuple[i] ^ b->tuple[i]; … … 1050 1059 { 1051 1060 int i; 1061 #ifndef LANG_ORCA 1062 int tmp; 1063 #endif 1052 1064 for( i = 0; i < a->argc; i++ ) 1053 1065 { 1066 #ifdef LANG_ORCA 1054 1067 a->tuple[i] = a->tuple[i] ^ orInt(b); 1068 #else 1069 tmp = orToByteRange( orInt(b) ); 1070 if ( tmp == 0) 1071 a->tuple[i] = 0; 1072 else if ( tmp == 255 ) 1073 a->tuple[i] = 255; 1074 else 1075 a->tuple[i] = a->tuple[i] ^ orToByteRange( orInt(b) ); 1076 #endif 1055 1077 } 1056 1078 return; … … 1059 1081 { 1060 1082 int i; 1083 #ifndef LANG_ORCA 1084 int tmp; 1085 #endif 1061 1086 for( i = 0; i < a->argc; i++ ) 1062 1087 { 1088 #ifdef LANG_ORCA 1063 1089 a->tuple[i] = a->tuple[i] ^ (int) orDecimal(b); 1090 #else 1091 tmp = orToByteRange( (int) orDecimal(b) ); 1092 if ( tmp == 0) 1093 a->tuple[i] = 0; 1094 else if ( tmp == 255 ) 1095 a->tuple[i] = 255; 1096 else 1097 a->tuple[i] = a->tuple[i] ^ orToByteRange( (int) orDecimal(b) ); 1098 #endif 1064 1099 } 1065 1100 return;
