From 05df075154a832fcb476e1dfcfb865722d0ea898 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 14 Mar 2017 14:43:42 -0400 Subject: Replace FX_FLOAT with underlying float type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña --- xfa/fgas/localization/fgas_locale.cpp | 28 ++++++++++++++-------------- xfa/fgas/localization/fgas_locale.h | 2 +- xfa/fgas/localization/fgas_localeimp.h | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'xfa/fgas/localization') diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index 430215662e..b2c848fed9 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -95,11 +95,11 @@ class CFX_LCNumeric { CFX_LCNumeric(int64_t integral, uint32_t fractional = 0, int32_t exponent = 0); - explicit CFX_LCNumeric(FX_FLOAT dbRetValue); + explicit CFX_LCNumeric(float dbRetValue); explicit CFX_LCNumeric(double dbvalue); explicit CFX_LCNumeric(CFX_WideString& wsNumeric); - FX_FLOAT GetFloat() const; + float GetFloat() const; double GetDouble() const; CFX_WideString ToString() const; CFX_WideString ToString(int32_t nTreading, bool bTrimTailZeros) const; @@ -210,7 +210,7 @@ CFX_LCNumeric::CFX_LCNumeric(int64_t integral, m_Fractional = fractional; m_Exponent = exponent; } -CFX_LCNumeric::CFX_LCNumeric(FX_FLOAT dbRetValue) { +CFX_LCNumeric::CFX_LCNumeric(float dbRetValue) { m_Integral = (int64_t)dbRetValue; m_Fractional = (uint32_t)(((dbRetValue > 0) ? (dbRetValue - m_Integral) : (m_Integral - dbRetValue)) * @@ -227,11 +227,11 @@ CFX_LCNumeric::CFX_LCNumeric(double dbvalue) { CFX_LCNumeric::CFX_LCNumeric(CFX_WideString& wsNumeric) { FX_WStringToNumeric(wsNumeric, *this); } -FX_FLOAT CFX_LCNumeric::GetFloat() const { - FX_FLOAT dbRetValue = m_Fractional / 4294967296.0f; +float CFX_LCNumeric::GetFloat() const { + float dbRetValue = m_Fractional / 4294967296.0f; dbRetValue = m_Integral + (m_Integral >= 0 ? dbRetValue : -dbRetValue); if (m_Exponent != 0) { - dbRetValue *= FXSYS_pow(10, (FX_FLOAT)m_Exponent); + dbRetValue *= FXSYS_pow(10, (float)m_Exponent); } return dbRetValue; } @@ -239,7 +239,7 @@ double CFX_LCNumeric::GetDouble() const { double value = m_Fractional / 4294967296.0; value = m_Integral + (m_Integral >= 0 ? value : -value); if (m_Exponent != 0) { - value *= FXSYS_pow(10, (FX_FLOAT)m_Exponent); + value *= FXSYS_pow(10, (float)m_Exponent); } return value; } @@ -718,7 +718,7 @@ bool CFX_FormatString::ParseText(const CFX_WideString& wsSrcText, } bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_WideString& wsPattern, - FX_FLOAT& fValue) { + float& fValue) { fValue = 0.0f; if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) { return false; @@ -1412,7 +1412,7 @@ bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, } } if (iExponent) { - dbRetValue *= FXSYS_pow(10, (FX_FLOAT)iExponent); + dbRetValue *= FXSYS_pow(10, (float)iExponent); } if (bHavePercentSymbol) { dbRetValue /= 100.0; @@ -1420,7 +1420,7 @@ bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, if (bNeg) { dbRetValue = -dbRetValue; } - fValue = (FX_FLOAT)dbRetValue; + fValue = (float)dbRetValue; return true; } @@ -1893,7 +1893,7 @@ bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, if (iExponent || bHavePercentSymbol) { CFX_Decimal decimal = CFX_Decimal(wsValue.AsStringC()); if (iExponent) { - decimal = decimal * CFX_Decimal(FXSYS_pow(10, (FX_FLOAT)iExponent)); + decimal = decimal * CFX_Decimal(FXSYS_pow(10, (float)iExponent)); } if (bHavePercentSymbol) { decimal = decimal / CFX_Decimal(100); @@ -3492,7 +3492,7 @@ bool CFX_FormatString::FormatNum(const CFX_WideString& wsSrcNum, } return FormatStrNum(wsSrcNum.AsStringC(), wsPattern, wsOutput); } -bool CFX_FormatString::FormatNum(FX_FLOAT fNum, +bool CFX_FormatString::FormatNum(float fNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput) { if (wsPattern.IsEmpty()) { @@ -4412,8 +4412,8 @@ CFX_Decimal::CFX_Decimal(int64_t val) { SetNegate(); } } -CFX_Decimal::CFX_Decimal(FX_FLOAT val, uint8_t scale) { - FX_FLOAT newval = fabs(val); +CFX_Decimal::CFX_Decimal(float val, uint8_t scale) { + float newval = fabs(val); uint64_t phi, pmid, plo; plo = (uint64_t)newval; pmid = (uint64_t)(newval / 1e32); diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h index f15766d2dd..42f20f1c0f 100644 --- a/xfa/fgas/localization/fgas_locale.h +++ b/xfa/fgas/localization/fgas_locale.h @@ -103,7 +103,7 @@ class CFX_Decimal { explicit CFX_Decimal(uint64_t val); explicit CFX_Decimal(int32_t val); explicit CFX_Decimal(int64_t val); - explicit CFX_Decimal(FX_FLOAT val, uint8_t scale = 3); + explicit CFX_Decimal(float val, uint8_t scale = 3); explicit CFX_Decimal(const CFX_WideStringC& str); explicit CFX_Decimal(const CFX_ByteStringC& str); operator CFX_WideString() const; diff --git a/xfa/fgas/localization/fgas_localeimp.h b/xfa/fgas/localization/fgas_localeimp.h index a66921b61c..684dfee20b 100644 --- a/xfa/fgas/localization/fgas_localeimp.h +++ b/xfa/fgas/localization/fgas_localeimp.h @@ -28,7 +28,7 @@ class CFX_FormatString { CFX_WideString& wsValue); bool ParseNum(const CFX_WideString& wsSrcNum, const CFX_WideString& wsPattern, - FX_FLOAT& fValue); + float& fValue); bool ParseNum(const CFX_WideString& wsSrcNum, const CFX_WideString& wsPattern, CFX_WideString& wsValue); @@ -46,7 +46,7 @@ class CFX_FormatString { bool FormatNum(const CFX_WideString& wsSrcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput); - bool FormatNum(FX_FLOAT fNum, + bool FormatNum(float fNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput); bool FormatDateTime(const CFX_WideString& wsSrcDateTime, -- cgit v1.2.3