Kaydet (Commit) 89718e94 authored tarafından jailletc36's avatar jailletc36 Kaydeden (comit) Markus Mohrhard

cppcheck : redundantCondition. In this case, it seems to be a typo.

Changed the redundant check against fRate with a test against fPrice as
everywhere else in the file.
Also change some comparisons against 0.0 instead of 0 when using floating
point variable (to be consistent with the rest of the code).

Change-Id: I94a397f1578a90156359987996cb1ef02d5e4209
Reviewed-on: https://gerrit.libreoffice.org/779Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 10542d92
......@@ -199,7 +199,7 @@ double SAL_CALL AnalysisAddIn::getPrice( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, double fRate, double fYield, double fRedemp, sal_Int32 nFreq,
const ANY& rOB ) THROWDEF_RTE_IAE
{
if( fYield < 0.0 || fRate < 0.0 || fRedemp <= 0 || CHK_Freq || nSettle >= nMat )
if( fYield < 0.0 || fRate < 0.0 || fRedemp <= 0.0 || CHK_Freq || nSettle >= nMat )
THROW_IAE;
double fRet = getPrice_( GetNullDate( xOpt ), nSettle, nMat, fRate, fYield, fRedemp, nFreq, getDateMode( xOpt, rOB ) );
......@@ -210,7 +210,7 @@ double SAL_CALL AnalysisAddIn::getPrice( constREFXPS& xOpt,
double SAL_CALL AnalysisAddIn::getPricedisc( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, double fDisc, double fRedemp, const ANY& rOB ) THROWDEF_RTE_IAE
{
if( fDisc <= 0.0 || fRedemp <= 0 || nSettle >= nMat )
if( fDisc <= 0.0 || fRedemp <= 0.0 || nSettle >= nMat )
THROW_IAE;
double fRet = fRedemp * ( 1.0 - fDisc * GetYearDiff( GetNullDate( xOpt ), nSettle, nMat, getDateMode( xOpt, rOB ) ) );
......@@ -336,7 +336,7 @@ double SAL_CALL AnalysisAddIn::getYieldmat( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue, double fRate, double fPrice, const ANY& rOB )
THROWDEF_RTE_IAE
{
if( fRate < 0.0 || fRate <= 0.0 || nSettle >= nMat )
if( fPrice <= 0.0 || fRate <= 0.0 || nSettle >= nMat )
THROW_IAE;
double fRet = GetYieldmat( GetNullDate( xOpt ), nSettle, nMat, nIssue, fRate, fPrice, getDateMode( xOpt, rOB ) );
......@@ -401,7 +401,7 @@ double SAL_CALL AnalysisAddIn::getOddfprice( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue, sal_Int32 nFirstCoup,
double fRate, double fYield, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE
{
if( fRate < 0 || fYield < 0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue )
if( fRate < 0.0 || fYield < 0.0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue )
THROW_IAE;
double fRet = GetOddfprice( GetNullDate( xOpt ), nSettle, nMat, nIssue, nFirstCoup, fRate, fYield, fRedemp, nFreq, getDateMode( xOpt, rOB ) );
......@@ -413,7 +413,7 @@ double SAL_CALL AnalysisAddIn::getOddfyield( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue, sal_Int32 nFirstCoup,
double fRate, double fPrice, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE
{
if( fRate < 0 || fPrice <= 0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue )
if( fRate < 0.0 || fPrice <= 0.0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue )
THROW_IAE;
double fRet = GetOddfyield( GetNullDate( xOpt ), nSettle, nMat, nIssue, nFirstCoup, fRate, fPrice, fRedemp, nFreq,
......@@ -426,7 +426,7 @@ double SAL_CALL AnalysisAddIn::getOddlprice( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nLastInterest,
double fRate, double fYield, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE
{
if( fRate < 0 || fYield < 0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest )
if( fRate < 0.0 || fYield < 0.0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest )
THROW_IAE;
double fRet = GetOddlprice( GetNullDate( xOpt ), nSettle, nMat, nLastInterest, fRate, fYield, fRedemp, nFreq,
......@@ -439,7 +439,7 @@ double SAL_CALL AnalysisAddIn::getOddlyield( constREFXPS& xOpt,
sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nLastInterest,
double fRate, double fPrice, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE
{
if( fRate < 0 || fPrice <= 0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest )
if( fRate < 0.0 || fPrice <= 0.0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest )
THROW_IAE;
double fRet = GetOddlyield( GetNullDate( xOpt ), nSettle, nMat, nLastInterest, fRate, fPrice, fRedemp, nFreq,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment