From: dahyeong.kim Date: Thu, 13 Jun 2013 08:32:43 +0000 (+0900) Subject: Change error condition of ToDouble()&ToFloat() X-Git-Tag: accepted/tizen/20130912.081851^2~236^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7342d320a5590d0b88faa0daf5397de099c040a7;p=platform%2Fframework%2Fnative%2Fappfw.git Change error condition of ToDouble()&ToFloat() Change-Id: If9b2fdd142208409b6317178f30197e7caf2a982 Signed-off-by: dahyeong.kim --- diff --git a/src/base/FBase_LocalizedNumParser.cpp b/src/base/FBase_LocalizedNumParser.cpp index bdcf7ec..34b43b2 100644 --- a/src/base/FBase_LocalizedNumParser.cpp +++ b/src/base/FBase_LocalizedNumParser.cpp @@ -76,7 +76,7 @@ _LocalizedNumParser::ToDouble(const String& str, const char* pLocale) double ret = wcstod(str.GetPointer(), &pEnd); SysTryReturn(NID_BASE, !(ret == 0 && errno == EINVAL) && (pEnd[0] == 0), std::numeric_limits< double >::quiet_NaN(), E_NUM_FORMAT, "[%s] wcstod() failed. Scan stopped at (%ls)", GetErrorMessage(E_NUM_FORMAT), pEnd); - SysTryReturn(NID_BASE, errno == 0 && ret != HUGE_VAL && ret != -HUGE_VAL, std::numeric_limits< double >::quiet_NaN(), + SysTryReturn(NID_BASE, errno == 0 || (ret != HUGE_VAL && ret != -HUGE_VAL), std::numeric_limits< double >::quiet_NaN(), E_NUM_FORMAT, "[%s] Parsed value cannot fit into a Double.", GetErrorMessage(E_NUM_FORMAT)); return ret; @@ -97,7 +97,7 @@ _LocalizedNumParser::ToFloat(const String& str, const char* pLocale) float ret = wcstof(str.GetPointer(), &pEnd); SysTryReturn(NID_BASE, !(ret == 0 && errno == EINVAL) && pEnd[0] == 0, std::numeric_limits< float >::quiet_NaN(), E_NUM_FORMAT, "[%s] wcstof() failed. Scan stopped at (%ls).", GetErrorMessage(E_NUM_FORMAT), pEnd); - SysTryReturn(NID_BASE, errno == 0 && ret != HUGE_VAL && ret != -HUGE_VAL, std::numeric_limits< float >::quiet_NaN(), + SysTryReturn(NID_BASE, errno == 0 || (ret != HUGE_VAL && ret != -HUGE_VAL), std::numeric_limits< float >::quiet_NaN(), E_NUM_FORMAT, "[%s] Parsed value cannot fit into a Float.", GetErrorMessage(E_NUM_FORMAT)); return ret;