[devel_3.0_main] Cherry-pick Beautification of source-code. 80383
[platform/framework/native/appfw.git] / src / base / FBase_LocalizedNumParser.cpp
index bdcf7ec..7d5b68d 100644 (file)
@@ -18,7 +18,6 @@
  * @file               FBase_LocalizedNumParser.cpp
  * @brief              This is the implementation file for _LocalizedNumParser class.
  */
-
 #include <cerrno>
 #include <clocale>
 #include <cmath>
@@ -47,8 +46,7 @@ public:
                }
        }
 
-       result
-       Construct(const char* pLocale)
+       result Construct(const char* pLocale)
        {
                _locale = newlocale(LC_ALL, pLocale, null);
                SysTryReturnResult(NID_BASE, _locale != null, E_INVALID_ARG, "Creating a new locale object is failed. pLocale is invalid.");
@@ -76,7 +74,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 +95,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;
@@ -153,4 +151,4 @@ _LocalizedNumParser::ToString(float value, const char* pLocale)
        return String(sValue);
 }
 
-}}     // Tizen::Base
+}}  // Tizen::Base