From 669a418f75c05d4a39e2bcaff2b7b93dec1c5764 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 3 Apr 2017 14:51:45 -0400 Subject: Drop FXSYS_ from math methods This Cl drops the FXSYS_ from math methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I85c9ff841fd9095b1434f67319847ba0cd9df7ac Reviewed-on: https://pdfium-review.googlesource.com/3598 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/fm2js/xfa_fm2jscontext.cpp | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'xfa/fxfa/fm2js') diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index b95a6d3aab..d38a6715e8 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -615,8 +615,7 @@ void CXFA_FM2JSContext::Ceil(CFXJSE_Value* pThis, return; } - args.GetReturnValue()->SetFloat( - FXSYS_ceil(ValueToFloat(pThis, argValue.get()))); + args.GetReturnValue()->SetFloat(ceil(ValueToFloat(pThis, argValue.get()))); } // static @@ -688,8 +687,7 @@ void CXFA_FM2JSContext::Floor(CFXJSE_Value* pThis, return; } - args.GetReturnValue()->SetFloat( - FXSYS_floor(ValueToFloat(pThis, argValue.get()))); + args.GetReturnValue()->SetFloat(floor(ValueToFloat(pThis, argValue.get()))); } // static @@ -1419,7 +1417,7 @@ void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis, return; } int32_t iTime = (int32_t)ValueToFloat(pThis, timeValue.get()); - if (FXSYS_abs(iTime) < 1.0) { + if (abs(iTime) < 1.0) { args.GetReturnValue()->SetNull(); return; } @@ -1466,7 +1464,7 @@ void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis, return; } float fTime = ValueToFloat(pThis, timeValue.get()); - if (FXSYS_fabs(fTime) < 1.0) { + if (fabs(fTime) < 1.0) { args.GetReturnValue()->SetNull(); return; } @@ -2407,9 +2405,8 @@ void CXFA_FM2JSContext::CTerm(CFXJSE_Value* pThis, return; } - args.GetReturnValue()->SetFloat( - FXSYS_log((float)(nFutureValue / nInitAmount)) / - FXSYS_log((float)(1 + nRate))); + args.GetReturnValue()->SetFloat(log((float)(nFutureValue / nInitAmount)) / + log((float)(1 + nRate))); } // static @@ -2487,10 +2484,10 @@ void CXFA_FM2JSContext::IPmt(CFXJSE_Value* pThis, } float nRateOfMonth = nRate / 12; - int32_t iNums = (int32_t)( - (FXSYS_log10((float)(nPayment / nPrincipalAmount)) - - FXSYS_log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / - FXSYS_log10((float)(1 + nRateOfMonth))); + int32_t iNums = + (int32_t)((log10((float)(nPayment / nPrincipalAmount)) - + log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / + log10((float)(1 + nRateOfMonth))); int32_t iEnd = std::min((int32_t)(nFirstMonth + nNumberOfMonths - 1), iNums); if (nPayment < nPrincipalAmount * nRateOfMonth) { @@ -2622,10 +2619,10 @@ void CXFA_FM2JSContext::PPmt(CFXJSE_Value* pThis, } float nRateOfMonth = nRate / 12; - int32_t iNums = (int32_t)( - (FXSYS_log10((float)(nPayment / nPrincipalAmount)) - - FXSYS_log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / - FXSYS_log10((float)(1 + nRateOfMonth))); + int32_t iNums = + (int32_t)((log10((float)(nPayment / nPrincipalAmount)) - + log10((float)(nPayment / nPrincipalAmount - nRateOfMonth))) / + log10((float)(1 + nRateOfMonth))); int32_t iEnd = std::min((int32_t)(nFirstMonth + nNumberOfMonths - 1), iNums); if (nPayment < nPrincipalAmount * nRateOfMonth) { pContext->ThrowArgumentMismatchException(); @@ -2739,9 +2736,8 @@ void CXFA_FM2JSContext::Term(CFXJSE_Value* pThis, return; } - args.GetReturnValue()->SetFloat( - FXSYS_log((float)(nFuture / nMount * nRate) + 1) / - FXSYS_log((float)(1 + nRate))); + args.GetReturnValue()->SetFloat(log((float)(nFuture / nMount * nRate) + 1) / + log((float)(1 + nRate))); } // static -- cgit v1.2.3