Changeset 375 for cpp/frams/util/extvalue.cpp
- Timestamp:
- 04/26/15 00:59:09 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r372 r375 98 98 if (warn) 99 99 { 100 Hprintf("ExtValue", "getObjectTarget", HMLV_WARN, "%s object expected, %s found", classname, interfaceName());100 logPrintf("ExtValue", "getObjectTarget", LOG_WARN, "%s object expected, %s found", classname, interfaceName()); 101 101 } 102 102 … … 269 269 if (tmp.len() > 30) tmp = tmp.substr(0, 30) + "..."; 270 270 if (type == TString) tmp = SString("\"") + tmp + SString("\""); 271 Hprintf("ExtValue", "getObjectTarget", HMLV_WARN, "%s object expected, %s found", classname, tmp.c_str());271 logPrintf("ExtValue", "getObjectTarget", LOG_WARN, "%s object expected, %s found", classname, tmp.c_str()); 272 272 } 273 273 return NULL; … … 419 419 context->v2->typeAndValue().c_str()); 420 420 } 421 Hprintf("ExtValue", "interpretCompare", HMLV_ERROR, "%s", msg.c_str());421 logPrintf("ExtValue", "interpretCompare", LOG_ERROR, "%s", msg.c_str()); 422 422 ret = -1; 423 423 } … … 448 448 { 449 449 case TDouble: 450 Hprintf("ExtValue", "add", HMLV_WARN, "Adding %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());450 logPrintf("ExtValue", "add", LOG_WARN, "Adding %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str()); 451 451 setDouble(double(getInt()) + src.getDouble()); 452 452 return; … … 487 487 default:; 488 488 } 489 Hprintf("ExtValue", "add", HMLV_ERROR, "Can't add %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());489 logPrintf("ExtValue", "add", LOG_ERROR, "Can't add %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str()); 490 490 } 491 491 … … 502 502 return; 503 503 case TDouble: 504 Hprintf("ExtValue", "subtract", HMLV_WARN, "Subtracting %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());504 logPrintf("ExtValue", "subtract", LOG_WARN, "Subtracting %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str()); 505 505 setDouble(double(getInt()) - src.getDouble()); 506 506 return; … … 520 520 default:; 521 521 } 522 Hprintf("ExtValue", "subtract", HMLV_ERROR, "Can't subtract %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());522 logPrintf("ExtValue", "subtract", LOG_ERROR, "Can't subtract %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str()); 523 523 } 524 524 … … 535 535 return; 536 536 case TDouble: 537 Hprintf("ExtValue", "multiply", HMLV_WARN, "Multiplying %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());537 logPrintf("ExtValue", "multiply", LOG_WARN, "Multiplying %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str()); 538 538 setDouble(double(getInt())*src.getDouble()); 539 539 return; … … 591 591 default:; 592 592 } 593 Hprintf("ExtValue", "multiply", HMLV_WARN, "Can't multiply %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());593 logPrintf("ExtValue", "multiply", LOG_WARN, "Can't multiply %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str()); 594 594 } 595 595 … … 611 611 else 612 612 { 613 Hprintf("ExtValue", "divide", HMLV_CRITICAL, "Division by zero: %d/0", idata());613 logPrintf("ExtValue", "divide", LOG_CRITICAL, "Division by zero: %d/0", idata()); 614 614 setInvalid(); 615 615 } … … 620 620 if (a == 0.0) 621 621 { 622 Hprintf("ExtValue", "divide", HMLV_CRITICAL, "Division by zero: %s/0.0", getString().c_str());622 logPrintf("ExtValue", "divide", LOG_CRITICAL, "Division by zero: %s/0.0", getString().c_str()); 623 623 setInvalid(); 624 624 } … … 629 629 if (!finite(tmp)) 630 630 { 631 Hprintf("ExtValue", "divide", HMLV_CRITICAL, "Overflow %s/%g", getString().c_str(), a); setInvalid();631 logPrintf("ExtValue", "divide", LOG_CRITICAL, "Overflow %s/%g", getString().c_str(), a); setInvalid(); 632 632 } 633 633 else … … 635 635 // niby dobrze ale lepiej byloby to robic bardziej systematycznie a nie tylko w dzieleniu? 636 636 //if (isnan(ddata())) //http://www.digitalmars.com/d/archives/c++/Traping_divide_by_zero_5728.html 637 // { Hprintf("ExtValue","divide",HMLV_ERROR,"not-a-number",(const char*)getString()); setInvalid(); }637 // { logPrintf("ExtValue","divide",LOG_ERROR,"not-a-number",(const char*)getString()); setInvalid(); } 638 638 fpExceptEnable(); 639 639 } … … 651 651 return; 652 652 case TDouble: 653 Hprintf("ExtValue", "divide", HMLV_WARN, "Dividing %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());653 logPrintf("ExtValue", "divide", LOG_WARN, "Dividing %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str()); 654 654 divDouble(src.ddata()); 655 655 return; … … 673 673 default:; 674 674 } 675 Hprintf("ExtValue", "divide", HMLV_ERROR, "Can't divide %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());675 logPrintf("ExtValue", "divide", LOG_ERROR, "Can't divide %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str()); 676 676 } 677 677 … … 778 778 779 779 case TObj: case TUnknown: case TInvalid: 780 Hprintf("ExtValue", "modulo", HMLV_WARN, "Can't apply modulo to %s", typeDescription().c_str());780 logPrintf("ExtValue", "modulo", LOG_WARN, "Can't apply modulo to %s", typeDescription().c_str()); 781 781 782 782 default:; … … 791 791 { 792 792 if (error) 793 Hprintf("ExtValue", "parseInt", HMLV_ERROR, "Could not parse '%s'%s", s, strict ? " (strict)" : "");793 logPrintf("ExtValue", "parseInt", LOG_ERROR, "Could not parse '%s'%s", s, strict ? " (strict)" : ""); 794 794 return false; 795 795 } … … 805 805 { 806 806 if (error) 807 Hprintf("ExtValue", "parseDouble", HMLV_ERROR, "Could not parse '%s'", s);807 logPrintf("ExtValue", "parseDouble", LOG_ERROR, "Could not parse '%s'", s); 808 808 return false; 809 809 } … … 836 836 case TString: return getInt(sdata().c_str()); 837 837 case TObj: 838 Hprintf("ExtValue", "getInt", HMLV_WARN, "Getting integer value from object reference (%s)", getString().c_str());838 logPrintf("ExtValue", "getInt", LOG_WARN, "Getting integer value from object reference (%s)", getString().c_str()); 839 839 return (paInt)(intptr_t)odata().param; 840 840 default:; … … 851 851 case TString: return getDouble(sdata().c_str()); 852 852 case TObj: 853 Hprintf("ExtValue", "getDouble", HMLV_WARN, "Getting floating point value from object reference (%s)", getString().c_str());853 logPrintf("ExtValue", "getDouble", LOG_WARN, "Getting floating point value from object reference (%s)", getString().c_str()); 854 854 return (double)(intptr_t)odata().param; 855 855 default:; … … 989 989 else 990 990 { 991 Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing '\"' in string: '%s'", ret);991 logPrintf("ExtValue", "deserialize", LOG_ERROR, "Missing '\"' in string: '%s'", ret); 992 992 return NULL; 993 993 } … … 1011 1011 else if (*p != ']') 1012 1012 { 1013 Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing ',' in Vector: '%s'", p);1013 logPrintf("ExtValue", "deserialize", LOG_ERROR, "Missing ',' in Vector: '%s'", p); 1014 1014 return NULL; 1015 1015 } … … 1037 1037 if ((!ret) || (args[1].getType() != TString)) { p = NULL; break; } 1038 1038 p = ret; 1039 if (*p != ':') { Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing ':' in Dictionary: '%s'", p); p = NULL; break; }1039 if (*p != ':') { logPrintf("ExtValue", "deserialize", LOG_ERROR, "Missing ':' in Dictionary: '%s'", p); p = NULL; break; } 1040 1040 p++; 1041 1041 ret = args[0].deserialize(p); … … 1046 1046 else if (*p != '}') 1047 1047 { 1048 Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing ',' in Dictionary: '%s'", p);1048 logPrintf("ExtValue", "deserialize", LOG_ERROR, "Missing ',' in Dictionary: '%s'", p); 1049 1049 return NULL; 1050 1050 } … … 1086 1086 } 1087 1087 } 1088 Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Invalid reference: '%s'", in - 1);1088 logPrintf("ExtValue", "deserialize", LOG_ERROR, "Invalid reference: '%s'", in - 1); 1089 1089 return NULL; 1090 1090 } … … 1133 1133 } 1134 1134 setEmpty(); 1135 Hprintf("ExtValue", "deserialize", HMLV_WARN, "object of class \"%s\" could not be deserialized", clsname.c_str());1135 logPrintf("ExtValue", "deserialize", LOG_WARN, "object of class \"%s\" could not be deserialized", clsname.c_str()); 1136 1136 return ret; 1137 1137 } 1138 Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Bad syntax: '%s'", in);1138 logPrintf("ExtValue", "deserialize", LOG_ERROR, "Bad syntax: '%s'", in); 1139 1139 setEmpty(); 1140 1140 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.