Changeset 335 for cpp/frams/util
- Timestamp:
- 03/01/15 01:43:09 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r333 r335 384 384 int ExtValue::interpretCompare(CmpOperator op,CompareResult result,CmpContext *context) 385 385 { 386 int err=ResultUnequal_RelaxedEqual;//error when ResultUnequal_RelaxedEqual or higher (not comparable)386 CompareResult error_threshold=ResultUnequal_RelaxedEqual;//error when ResultUnequal_RelaxedEqual or higher (not comparable) 387 387 int ret=0; 388 388 switch (op) 389 389 { 390 case CmpEQ: ret=(result==ResultEqual)||(result==ResultEqualUnordered); err =ResultMismatch_RelaxedUnequal; break;391 case CmpNE: ret=!((result==ResultEqual)||(result==ResultEqualUnordered)); err =ResultMismatch_RelaxedUnequal; break;392 case CmpGT: ret=(result==ResultHigher); err =ResultEqualUnordered; break;393 case CmpGE: ret=(result==ResultEqual)||(result==ResultHigher); err =ResultEqualUnordered; break;394 case CmpLT: ret=(result==ResultLower); err =ResultEqualUnordered; break;395 case CmpLE: ret=(result==ResultEqual)||(result==ResultLower); err =ResultEqualUnordered; break;396 case CmpREQ: ret=(result==ResultEqual)||(result==ResultEqualUnordered)||(result==ResultUnequal_RelaxedEqual); err =ResultMismatch; break;397 case CmpRNE: ret=!((result==ResultEqual)||(result==ResultEqualUnordered)||(result==ResultUnequal_RelaxedEqual)); err =ResultMismatch; break;390 case CmpEQ: ret=(result==ResultEqual)||(result==ResultEqualUnordered); error_threshold=ResultMismatch_RelaxedUnequal; break; 391 case CmpNE: ret=!((result==ResultEqual)||(result==ResultEqualUnordered)); error_threshold=ResultMismatch_RelaxedUnequal; break; 392 case CmpGT: ret=(result==ResultHigher); error_threshold=ResultEqualUnordered; break; 393 case CmpGE: ret=(result==ResultEqual)||(result==ResultHigher); error_threshold=ResultEqualUnordered; break; 394 case CmpLT: ret=(result==ResultLower); error_threshold=ResultEqualUnordered; break; 395 case CmpLE: ret=(result==ResultEqual)||(result==ResultLower); error_threshold=ResultEqualUnordered; break; 396 case CmpREQ: ret=(result==ResultEqual)||(result==ResultEqualUnordered)||(result==ResultUnequal_RelaxedEqual); error_threshold=ResultMismatch; break; 397 case CmpRNE: ret=!((result==ResultEqual)||(result==ResultEqualUnordered)||(result==ResultUnequal_RelaxedEqual)); error_threshold=ResultMismatch; break; 398 398 default:; 399 399 } 400 if (result >=err)400 if (result >= error_threshold) 401 401 { 402 402 if (context) 403 403 { 404 SString msg="Type mismatch ";404 SString msg="Type mismatch while comparing"; 405 405 if (context->v1 && context->v2) 406 406 {
Note: See TracChangeset
for help on using the changeset viewer.