Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


regards

From 32814375a2999afaf0582a682975ae6ec769f6f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod@alumni.ethz.ch>
Date: Tue, 23 Nov 2010 21:06:58 +0100
Subject: [PATCH 2/9] remove warnings in binfilter - sc_interpr2.cxx

based on the following compiler warnings:

sc_interpr2.cxx:1729:22: warning: comparison is always false due to limited range of data type

sc_interpr2.cxx:893:12: warning: unused variable 'fRestwert1'
sc_interpr2.cxx:895:10: warning: unused variable 'bFirstFlag'
sc_interpr2.cxx:896:10: warning: unused variable 'b2Flag'
sc_interpr2.cxx:897:12: warning: unused variable 'fAbschlag'
sc_interpr2.cxx:1423:54: warning: suggest parentheses around assignment used as truth value
sc_interpr2.cxx:1484:32: warning: suggest explicit braces to avoid ambiguous 'else'
sc_interpr2.cxx:863:12: warning: 'nGda2' may be used uninitialized in this function
sc_interpr2.cxx:1420:22: warning: 'bHasNote' may be used uninitialized in this function
---
 binfilter/bf_sc/source/core/tool/sc_interpr2.cxx |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/binfilter/bf_sc/source/core/tool/sc_interpr2.cxx 
b/binfilter/bf_sc/source/core/tool/sc_interpr2.cxx
index 52bdf1d..71b27da 100644
--- a/binfilter/bf_sc/source/core/tool/sc_interpr2.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_interpr2.cxx
@@ -860,10 +860,8 @@ void ScInterpreter::ScGDA2()
     double nAbRate = 1.0 - pow(nRest / nWert, 1.0 / nDauer);
     nAbRate = ::rtl::math::approxFloor((nAbRate * 1000.0) + 0.5) / 1000.0;
     double nErsteAbRate = nWert * nAbRate * nMonate / 12.0;
-    double nGda2;
-    if (::rtl::math::approxFloor(nPeriode) == 1)
-        nGda2 = nErsteAbRate;
-    else
+    double nGda2  = nErsteAbRate;
+    if (::rtl::math::approxFloor(nPeriode) != 1)
     {
         double nSummAbRate = nErsteAbRate;
         double nMin = nDauer;
@@ -890,11 +888,7 @@ double ScInterpreter::ScInterVDB(double fWert,double fRest,double fDauer,
 
     double fTerm, fLia;
     double fRestwert = fWert - fRest;
-    double fRestwert1 = fRestwert;
     BOOL bNowLia = FALSE;
-    BOOL bFirstFlag=TRUE;
-    BOOL b2Flag=TRUE;
-    double fAbschlag=0;
 
     double fGda;
     ULONG i;
@@ -1417,10 +1411,10 @@ void ScInterpreter::ScBackSolver()
                 ScRange aVRange( aVAdr, aVAdr );       // fuer SetDirty
                 double nSaveVal;
                 ScPostIt aNote;
-                BOOL bHasNote;
+                BOOL bHasNote = 0;
                 if ( bTempCell )
                 {
-                    if ( bHasNote = (pVCell != NULL) )
+                    if ( ( bHasNote = (pVCell != NULL) ) )
                         bHasNote = pVCell->GetNote( aNote );
                     nSaveVal = 0.0;
                     pVCell = new ScValueCell( nSaveVal );
@@ -1482,10 +1476,12 @@ void ScInterpreter::ScBackSolver()
                         {
                             fs = (fn1 - fn) / (xn1 - xn);
                             if (fabs(fs) < nEps)
+                            {
                                 if (fs < 0.0)
                                     fs = -nEps;
                                 else
                                     fs = nEps;
+                            }
                         }
                         else
                             fs = nEps;
@@ -1726,7 +1722,7 @@ ScDdeLink* lcl_GetDdeLink( SvxLinkManager* pLinkMgr,
 /*N*/                  String aTopic = GetString();
 /*N*/                  String aAppl  = GetString();
 /*N*/  
-/*N*/                  if (nMode < SC_DDE_DEFAULT || nMode > SC_DDE_TEXT)
+/*N*/                  if (nMode > SC_DDE_TEXT)
 /*N*/                          nMode = SC_DDE_DEFAULT;
 /*N*/  
 /*N*/                  //      temporary documents (ScFunctionAccess) have no DocShell
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.