Changeset 59 for trunk/orca/op.c
- Timestamp:
- 02/22/06 00:37:24 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/op.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/op.c
r58 r59 73 73 return; 74 74 } 75 #ifdef LANG_ORCA 75 76 else if( orIs(b, OT_TUPLE) ) 76 77 { … … 89 90 return; 90 91 } 92 #endif 91 93 a = b; 92 94 } … … 178 180 return; 179 181 } 180 182 #ifdef LANG_ORCA 183 else if( orIs(b, OT_TUPLE) ) 184 { 185 int tmp, i; 186 OValue *res; 187 188 res = b; 189 190 for( i = 0; i < res->argc; i++ ) 191 { 192 tmp = orInt(a) - b->tuple[i]; 193 res->tuple[i] = orToByteRange(tmp); 194 } 195 196 orResultCopy( *res ); 197 return; 198 } 199 #endif 181 200 a = b; 182 201 } … … 193 212 return; 194 213 } 214 #ifdef LANG_ORCA 215 else if( orIs(b, OT_TUPLE) ) 216 { 217 int tmp, i; 218 OValue *res; 219 220 res = b; 221 222 for( i = 0; i < res->argc; i++ ) 223 { 224 tmp = (int) orDecimal(a) - b->tuple[i]; 225 res->tuple[i] = orToByteRange(tmp); 226 } 227 228 orResultCopy( *res ); 229 return; 230 } 231 #endif 195 232 a = b; 196 233 } … … 326 363 return; 327 364 } 365 #ifdef LANG_ORCA 328 366 else if( orIs(b, OT_TUPLE) ) 329 367 { … … 342 380 return; 343 381 } 382 #endif 344 383 a = b; 345 384 } … … 414 453 return; 415 454 } 455 #ifdef LANG_ORCA 456 else if( orIs(b, OT_TUPLE) ) 457 { 458 int tmp, i; 459 OValue *res; 460 461 res = b; 462 463 for( i = 0; i < res->argc; i++ ) 464 { 465 if( b->tuple[i] == 0 ) 466 goto div0; 467 tmp = orInt(a) / b->tuple[i]; 468 res->tuple[i] = orToByteRange(tmp); 469 } 470 471 orResultCopy( *res ); 472 return; 473 } 474 #endif 416 475 a = b; 417 476 } … … 432 491 return; 433 492 } 493 #ifdef LANG_ORCA 494 else if( orIs(b, OT_TUPLE) ) 495 { 496 int tmp, i; 497 OValue *res; 498 499 res = b; 500 501 for( i = 0; i < res->argc; i++ ) 502 { 503 if( b->tuple[i] == 0 ) 504 goto div0; 505 tmp = (int) orDecimal(a) / b->tuple[i]; 506 res->tuple[i] = orToByteRange(tmp); 507 } 508 509 orResultCopy( *res ); 510 return; 511 } 512 #endif 434 513 a = b; 435 514 } … … 446 525 for( i = 0; i < res->argc; i++ ) 447 526 { 448 if ( b->tuple[i] == 0)527 if( b->tuple[i] == 0 ) 449 528 goto div0; 450 529 tmp = a->tuple[i] / b->tuple[i]; … … 462 541 for( i = 0; i < res->argc; i++ ) 463 542 { 464 if (orInt(b) == 0)543 if( orInt(b) == 0 ) 465 544 goto div0; 466 545 tmp = a->tuple[i] / orInt(b); … … 478 557 for( i = 0; i < res->argc; i++ ) 479 558 { 480 if (orDecimal(b) == 0)559 if( orDecimal(b) == 0 ) 481 560 goto div0; 482 561 tmp = a->tuple[i] / (int) orDecimal(b); … … 887 966 return; 888 967 } 889 a = b; 890 } 968 #ifdef LANG_ORCA 969 else if( orIs(b, OT_TUPLE) ) 970 { 971 int i; 972 OValue *res; 973 974 res = b; 975 976 for( i = 0; i < res->argc; i++ ) 977 { 978 res->tuple[i] = orInt(a) & b->tuple[i]; 979 } 980 981 orResultCopy( *res ); 982 return; 983 } 984 #endif 985 a = b; 986 } 987 #ifdef LANG_ORCA 988 else if( orIs(a, OT_DECIMAL) ) 989 { 990 if( orIs(b, OT_TUPLE) ) 991 { 992 int i; 993 OValue *res; 994 995 res = b; 996 997 for( i = 0; i < res->argc; i++ ) 998 { 999 res->tuple[i] = (int) orDecimal(a) & b->tuple[i]; 1000 } 1001 1002 orResultCopy( *res ); 1003 return; 1004 } 1005 a = b; 1006 } 1007 #endif 891 1008 else if( orIs(a, OT_LOGIC) ) 892 1009 { … … 950 1067 return; 951 1068 } 952 a = b; 953 } 1069 #ifdef LANG_ORCA 1070 else if( orIs(b, OT_TUPLE) ) 1071 { 1072 int i; 1073 OValue *res; 1074 1075 res = b; 1076 1077 for( i = 0; i < res->argc; i++ ) 1078 { 1079 res->tuple[i] = orInt(a) | b->tuple[i]; 1080 } 1081 1082 orResultCopy( *res ); 1083 return; 1084 } 1085 #endif 1086 a = b; 1087 } 1088 #ifdef LANG_ORCA 1089 else if( orIs(a, OT_DECIMAL) ) 1090 { 1091 if( orIs(b, OT_TUPLE) ) 1092 { 1093 int i; 1094 OValue *res; 1095 1096 res = b; 1097 1098 for( i = 0; i < res->argc; i++ ) 1099 { 1100 res->tuple[i] = (int) orDecimal(a) | b->tuple[i]; 1101 } 1102 1103 orResultCopy( *res ); 1104 return; 1105 } 1106 a = b; 1107 } 1108 #endif 954 1109 else if( orIs(a, OT_LOGIC) ) 955 1110 { … … 985 1140 #else 986 1141 tmp = orToByteRange( orInt(b) ); 987 if ( tmp == 0)1142 if( tmp == 0 ) 988 1143 a->tuple[i] = 0; 989 else if ( tmp == 255 )1144 else if( tmp == 255 ) 990 1145 a->tuple[i] = 255; 991 1146 else … … 1007 1162 #else 1008 1163 tmp = orToByteRange( (int) orDecimal(b) ); 1009 if ( tmp == 0)1164 if( tmp == 0 ) 1010 1165 a->tuple[i] = 0; 1011 else if ( tmp == 255 )1166 else if( tmp == 255 ) 1012 1167 a->tuple[i] = 255; 1013 1168 else … … 1033 1188 return; 1034 1189 } 1035 a = b; 1036 } 1190 #ifdef LANG_ORCA 1191 else if( orIs(b, OT_TUPLE) ) 1192 { 1193 int i; 1194 OValue *res; 1195 1196 res = b; 1197 1198 for( i = 0; i < res->argc; i++ ) 1199 { 1200 res->tuple[i] = orInt(a) ^ b->tuple[i]; 1201 } 1202 1203 orResultCopy( *res ); 1204 return; 1205 } 1206 #endif 1207 a = b; 1208 } 1209 #ifdef LANG_ORCA 1210 else if( orIs(a, OT_DECIMAL) ) 1211 { 1212 if( orIs(b, OT_TUPLE) ) 1213 { 1214 int i; 1215 OValue *res; 1216 1217 res = b; 1218 1219 for( i = 0; i < res->argc; i++ ) 1220 { 1221 res->tuple[i] = (int) orDecimal(a) ^ b->tuple[i]; 1222 } 1223 1224 orResultCopy( *res ); 1225 return; 1226 } 1227 a = b; 1228 } 1229 #endif 1037 1230 else if( orIs(a, OT_LOGIC) ) 1038 1231 { … … 1068 1261 #else 1069 1262 tmp = orToByteRange( orInt(b) ); 1070 if ( tmp == 0)1263 if( tmp == 0 ) 1071 1264 a->tuple[i] = 0; 1072 else if ( tmp == 255 )1265 else if( tmp == 255 ) 1073 1266 a->tuple[i] = 255; 1074 1267 else … … 1090 1283 #else 1091 1284 tmp = orToByteRange( (int) orDecimal(b) ); 1092 if ( tmp == 0)1285 if( tmp == 0 ) 1093 1286 a->tuple[i] = 0; 1094 else if ( tmp == 255 )1287 else if( tmp == 255 ) 1095 1288 a->tuple[i] = 255; 1096 1289 else
