- Timestamp:
- 05/31/18 03:23:05 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r786 r794 945 945 { 946 946 case TInt: return idata(); 947 case TDouble: return (int)ddata(); 947 case TDouble: 948 { 949 bool toobig = false; 950 if (((toobig = (ddata() > (double)INT_MAX))) 951 || (ddata() < (double)INT_MIN)) 952 { 953 logPrintf("ExtValue", "getInt", LOG_ERROR, "Overflow when converting floating point value to integer; using %s allowed integer '%d' instead of '%s'", toobig ? "maximal" : "minimal", toobig ? INT_MAX : INT_MIN, getString().c_str()); 954 return toobig ? INT_MAX : INT_MIN; 955 } 956 return (int)ddata(); 957 } 948 958 case TString: return getInt(sdata().c_str()); 949 959 case TObj:
Note: See TracChangeset
for help on using the changeset viewer.