[Libreoffice-commits] .: 8 commits - binfilter/bf_sc binfilter/bf_sw

Michael Meeks mmeeks at kemper.freedesktop.org
Fri Nov 26 03:03:16 PST 2010


 binfilter/bf_sc/source/core/tool/sc_interpr2.cxx  |   18 +++-----
 binfilter/bf_sc/source/core/tool/sc_interpr4.cxx  |   17 +++-----
 binfilter/bf_sc/source/core/tool/sc_token.cxx     |   45 ++++++++--------------
 binfilter/bf_sw/source/core/para/sw_paratr.cxx    |   16 +++----
 binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx  |   24 ++++-------
 binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx |   32 ++-------------
 6 files changed, 57 insertions(+), 95 deletions(-)

New commits:
commit 79c96493ae10750402701876da00b6493ac87a30
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:58:20 2010 +0100

    binfilter sw3io warning fixes
    
    regards
    
    >From d8ca0db19fdc508ebc0bf0ee42107fdea2f498b1 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Thu, 25 Nov 2010 21:10:27 +0100
    Subject: [PATCH 9/9] binfilter sw3io  warning fixes
    
    use of not initialized variables

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx
index 16c641a..3606f9b 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx
@@ -310,7 +310,7 @@ sal_Bool lcl_sw3io_insFtn( const SwTxtNode *pTxtNd )
 /*N*/ 	if( rSet.Count() )
 /*N*/ 	{
 /*N*/ 		// Beim 3.1 Export den aktuellen Attrset merken
-/*N*/ 		const SfxItemSet *pOldExportItemSet;
+/*N*/ 		const SfxItemSet *pOldExportItemSet = NULL;
 /*N*/ 		if( pExportInfo )
 /*N*/ 		{
 /*N*/ 			pOldExportItemSet = pExportInfo->pItemSet;
@@ -938,21 +938,21 @@ sal_Bool lcl_sw3io_insFtn( const SwTxtNode *pTxtNd )
 /*N*/ 	if( bWriteName )
 /*N*/ 		OutString( *pStrm, rFmt.GetName() );
 /*N*/ 
-/*N*/ 	BOOL bOldExportFlyFrmFmt;
-/*N*/ 	const SwFlyFrm* pOldExportFlyFrm;
 /*N*/ 	if( pExportInfo )
 /*N*/ 	{
-/*N*/ 		bOldExportFlyFrmFmt = pExportInfo->bFlyFrmFmt;
-/*N*/ 		pOldExportFlyFrm = pExportInfo->pFlyFrm;
+/*N*/ 		BOOL bOldExportFlyFrmFmt = pExportInfo->bFlyFrmFmt;
+/*N*/ 		const SwFlyFrm* pOldExportFlyFrm = pExportInfo->pFlyFrm;
 /*N*/ 		pExportInfo->bFlyFrmFmt = (cType == SWG_FLYFMT);
 /*N*/ 		pExportInfo->pFlyFrm = pExportFlyFrm;
-/*N*/ 	}
-/*N*/ 	OutAttrSet( rFmt.GetAttrSet(), SWG_SECTFMT == cType );
-/*N*/ 	if( pExportInfo )
-/*N*/ 	{
+                OutAttrSet( rFmt.GetAttrSet(), SWG_SECTFMT == cType );
 /*N*/ 		pExportInfo->bFlyFrmFmt = bOldExportFlyFrmFmt;
 /*N*/ 		pExportInfo->pFlyFrm = pOldExportFlyFrm;
+
 /*N*/ 	}
+        else
+        {
+/*N*/ 	    OutAttrSet( rFmt.GetAttrSet(), SWG_SECTFMT == cType );
+        }
 /*N*/ 	CloseRec( cType );
 /*N*/ 	if( cType != SWG_FREEFMT && cType != SWG_SECTFMT )
 /*N*/ 		((SwFmt&)rFmt).SetWritten();
@@ -1103,7 +1103,7 @@ sal_Bool lcl_sw3io_insFtn( const SwTxtNode *pTxtNd )
 
 extern BOOL TstFlyRange( const SwPaM* pPam, const SwIndex& rFlyPos );
 
-/*N*/ void Sw3IoImp::CollectFlyFrms( const SwPaM* pPaM )
+/*N*/ void Sw3IoImp::CollectFlyFrms( const SwPaM* /*pPaM*/ )
 /*N*/ {
 /*N*/ 	if( !pFlyFrms )
 /*N*/ 	{
commit fce92b18779ab7b533536c42edd77c9768a4d151
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:57:48 2010 +0100

    waring cleaning in binfilter sw3io
    
    regards
    
    >From a3757de1170fca97638be7e455b6602b9de228e1 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Thu, 25 Nov 2010 20:57:45 +0100
    Subject: [PATCH 8/9] waring cleaning in binfilter sw3io
    
    code removed due to compiler warning: (for both if, that is not an error)
    sw_sw3fmts.cxx:255:41: warning: comparison is always false due to limited range of data type

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx
index a61a027..16c641a 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3fmts.cxx
@@ -252,10 +252,6 @@ sal_Bool lcl_sw3io_insFtn( const SwTxtNode *pTxtNd )
 /*N*/ 
 /*N*/ 	// Hints that start behind the maximum string length of version 5.2
 /*N*/ 	// don't have to be exported.
-/*N*/ 	if( nBgn != STRING_LEN && nBgn > STRING_MAXLEN52 )
-/*N*/ 		return;
-/*N*/ 	if( nEnd != STRING_LEN && nEnd > STRING_MAXLEN52 )
-/*N*/ 		nEnd = STRING_MAXLEN52;
 /*N*/ 
 /*N*/ 	if( nWhich != RES_TXTATR_FTN || nFlyLevel == 0 )
 /*N*/ 	{
commit 6cb2335d7534e47012237c98765378db4f607f7b
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:57:12 2010 +0100

    warnings removal in binfilter sw_sw3redln.cxx
    
    regards
    
    >From 13a33d71df128454159d0e911f55179cddac2d72 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Thu, 25 Nov 2010 20:52:47 +0100
    Subject: [PATCH 7/9] warnings removal in binfilter sw_sw3redln.cxx
    
    all code deletion due to compiler warning with message:
    
    sw_sw3redln.cxx:255:25:
    warning: comparison is always false due to limited range of data type

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx
index e2453f4..2a3f9ef 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx
@@ -251,12 +251,7 @@ xub_StrLen lcl_sw3io_getNodeOff( const SwNodeIndex& rNdIdx, xub_StrLen nCntntIdx
     // unbenutzte Content-Position.
     const SwNode& rNode = rNdIdx.GetNode();
     if( rNode.IsCntntNode() )
-    {
-        if( nCntntIdx > STRING_MAXLEN52 )
-            return STRING_MAXLEN52;
-        else
-            return nCntntIdx;
-    }
+        return nCntntIdx;
 
     if( rNode.IsStartNode() )
         return 0;
@@ -294,10 +289,6 @@ xub_StrLen lcl_sw3io_getNodeOff( const SwNodeIndex& rNdIdx, xub_StrLen nCntntIdx
 /*?*/ 		// If the redline is within one node and starts behind the
 /*?*/ 		// last position that is possible within the 5.2 version,
 /*?*/ 		// it will be ignored.
-/*?*/ 		if( pPos->nContent.GetIndex() > STRING_MAXLEN52 &&
-/*?*/ 			pPos->nNode.GetIndex() == pEndPos->nNode.GetIndex() &&
-/*?*/ 			pEndPos->nContent.GetIndex() > STRING_MAXLEN52 )
-/*?*/ 			continue;
 /*?*/ 
 /*?*/ 		if( pDoc->IsInHeaderFooter( pPos->nNode ) )
 /*?*/ 		{
@@ -457,7 +448,7 @@ xub_StrLen lcl_sw3io_getNodeOff( const SwNodeIndex& rNdIdx, xub_StrLen nCntntIdx
 /*N*/ 		xub_StrLen nLen = rNode.GetCntntNode()->Len();
 /*N*/ 		xub_StrLen nIdx = static_cast< xub_StrLen >( nNodeOff+nCntntOff );
 /*N*/ 		ASSERT( nIdx>=0 && nIdx<=nLen, "ungueltiger Cntnt-Offset" );
-/*N*/ 		if( nIdx<0 || nIdx > nLen )
+/*N*/ 		if( nIdx > nLen )
 /*N*/ 		{
 /*N*/ 			bInvalid = sal_True;
 /*N*/ 		}
@@ -635,14 +626,6 @@ xub_StrLen lcl_sw3io_getNodeOff( const SwNodeIndex& rNdIdx, xub_StrLen nCntntIdx
 /*?*/ 				else if( pContentIdx )
 /*?*/ 					cFlags |= 0x20;
 /*?*/ 
-/*?*/ 				xub_StrLen nOffs = pMark->GetNodeOff();
-/*?*/ 				if( pDoc->GetNodes()[nIdx]->IsCntntNode() &&
-/*?*/ 					nOffs > STRING_MAXLEN52 )
-/*?*/ 					nOffs = STRING_MAXLEN52;
-/*?*/ 				*pStrm  << (BYTE)  cFlags
-/*?*/ 						<< (UINT16)pMark->GetId()
-/*?*/ 						<< (UINT16)nOffs;
-/*?*/ 
 /*?*/ 				if( pContentIdx )
 /*?*/ 				{
 /*?*/ 					ASSERT( pContentIdx->GetNode().EndOfSectionIndex() -
commit 59a7fd3608a6042e9b030a9f39f64ffdbc780ec5
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:56:43 2010 +0100

    waring cleaning in sw_sw3redln.cxx
    
    regards
    
    >From 84e58630f70dc34f71ee34419d9843980b14b723 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Thu, 25 Nov 2010 20:18:10 +0100
    Subject: [PATCH 6/9] waring cleaning in sw_sw3redln.cxx
    
    shadowing warning and unused parameters

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx
index b0a286b..e2453f4 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3redln.cxx
@@ -97,8 +97,6 @@ namespace binfilter {
 /*N*/ 	{
 /*N*/ 		OpenRec( SWG_REDLINEDATA_LCL );
 /*N*/ 
-/*N*/ 		BYTE cDFlags = OpenFlagRec();
-/*N*/ 
 /*N*/ 		BYTE cType;
 /*N*/ 		UINT16 nStrIdx;
 /*N*/ 
@@ -106,10 +104,10 @@ namespace binfilter {
 /*N*/ 				>> nStrIdx;
 /*N*/ 		CloseFlagRec();
 /*N*/ 
-/*N*/ 		UINT32 nDate, nTime;
+/*N*/ 		UINT32 nDate2, nTime2;
 /*N*/ 		String aComment;
-/*N*/ 		*pStrm 	>> nDate
-/*N*/ 				>> nTime;
+/*N*/ 		*pStrm 	>> nDate2
+/*N*/ 				>> nTime2;
 /*N*/ 		InString( *pStrm, aComment );
 /*N*/ 
 /*N*/ 		// Das oberste Element des Stack wurde als letztes geschrieben.
@@ -120,7 +118,7 @@ namespace binfilter {
 /*N*/ 			nAuthorIdx = pDoc->GetRedlineAuthor();
 /*N*/ 
 /*N*/ 		pData =	new SwRedlineData( (SwRedlineType)cType, nAuthorIdx,
-/*N*/ 								   DateTime( nDate, nTime ), aComment,
+/*N*/ 								   DateTime( nDate2, nTime2 ), aComment,
 /*N*/ 								   pData );
 /*N*/ 
 /*N*/ 		CloseRec( SWG_REDLINEDATA_LCL );
@@ -128,7 +126,6 @@ namespace binfilter {
 /*N*/ 
 /*N*/ 	// Der PaM ist erstmal egal und wird erst spaeter gesetzt
 /*N*/ 	SwPosition aDummyPos( pDoc->GetNodes().GetEndOfExtras() );
-/*N*/ 	BOOL bVisible = (cFlags & 0x10) != 0;
 /*N*/ 	SwRedline *pRedline =
 /*N*/ 		new SwRedline( pData, aDummyPos, (cFlags & 0x10) != 0,
 /*N*/ 					   (cFlags & 0x20) != 0, (cFlags & 0x40) != 0 );
commit eeca38c83d690fcb501d6afd638cb9796aee736f
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:56:09 2010 +0100

    waring removal in binfilter core/para
    
    regards
    
    >From 01e9e819f9dd8f1726ddff7672f27cfcbd44760c Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Thu, 25 Nov 2010 20:09:15 +0100
    Subject: [PATCH 5/9] waring removal in binfilter core/para

diff --git a/binfilter/bf_sw/source/core/para/sw_paratr.cxx b/binfilter/bf_sw/source/core/para/sw_paratr.cxx
index cb4dd70..0ba41e6 100644
--- a/binfilter/bf_sw/source/core/para/sw_paratr.cxx
+++ b/binfilter/bf_sw/source/core/para/sw_paratr.cxx
@@ -104,7 +104,7 @@ using namespace ::com::sun::star;
 
 
 
-/*N*/ void SwFmtDrop::Modify( SfxPoolItem *pA, SfxPoolItem *pB )
+/*N*/ void SwFmtDrop::Modify( SfxPoolItem * /*pA*/, SfxPoolItem * /*pB*/ )
 /*N*/ {
 /*N*/ 	if( pDefinedIn )
 /*N*/ 	{
@@ -130,7 +130,7 @@ using namespace ::com::sun::star;
 
 
 
-/*N*/ sal_Bool SwFmtDrop::GetInfo( SfxPoolItem& rInfo ) const
+/*N*/ sal_Bool SwFmtDrop::GetInfo( SfxPoolItem& /*rInfo*/ ) const
 /*N*/ {
 /*N*/ 	// fuers UNDO: pruefe ob das Attribut wirklich in diesem Format steht
 /*N*/ #ifdef USED_30
@@ -180,7 +180,7 @@ using namespace ::com::sun::star;
 /*N*/         case MID_DROPCAP_LINES : rVal <<= (sal_Int16)nLines; break;
 /*N*/         case MID_DROPCAP_COUNT : rVal <<= (sal_Int16)nChars; break;
 /*N*/         case MID_DROPCAP_DISTANCE : rVal <<= (sal_Int16) TWIP_TO_MM100(nDistance); break;
-/*N*/ 		case MID_DROPCAP_FORMAT:
+/*N*/         case MID_DROPCAP_FORMAT:
 /*N*/ 		{
 /*N*/ 		 	style::DropCapFormat aDrop;
 /*N*/ 			aDrop.Lines	= nLines   ;
@@ -244,8 +244,8 @@ using namespace ::com::sun::star;
 /*N*/ 				nDistance 	= MM100_TO_TWIP(pDrop->Distance);
 /*N*/ 			}
 /*N*/ 			else
-/*N*/ 				//exception( wrong_type)
-/*N*/ 				;
+/*N*/ 			{
+/*N*/ 			}
 /*N*/ 		}
 /*N*/ 		break;
 /*N*/ 		case MID_DROPCAP_WHOLE_WORD:
@@ -267,14 +267,14 @@ using namespace ::com::sun::star;
 /*N*/ }
 
 // class SwNumRuleItem -------------------------------------------------
-/*N*/ SfxPoolItem* SwNumRuleItem::Clone( SfxItemPool *pPool  ) const
+/*N*/ SfxPoolItem* SwNumRuleItem::Clone( SfxItemPool * /*pPool*/  ) const
 /*N*/ {
 /*N*/ 	return new SwNumRuleItem( *this );
 /*N*/ }
 /* -----------------------------27.06.00 11:05--------------------------------
 
  ---------------------------------------------------------------------------*/
-/*N*/ bool SwNumRuleItem::QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId ) const
+/*N*/ bool SwNumRuleItem::QueryValue( ::com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const
 /*N*/ {
 /*N*/ 	::rtl::OUString sRet = SwStyleNameMapper::GetProgName(GetValue(), GET_POOLID_NUMRULE );
 /*N*/ 	rVal <<= sRet;
@@ -283,7 +283,7 @@ using namespace ::com::sun::star;
 /* -----------------------------27.06.00 11:05--------------------------------
 
  ---------------------------------------------------------------------------*/
-/*N*/ bool SwNumRuleItem::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE nMemberId )
+/*N*/ bool SwNumRuleItem::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ )
 /*N*/ {
 /*N*/ 	::rtl::OUString uName;
 /*N*/ 	rVal >>= uName;
commit 9cc2b47b1a366245ae001cba7c7015b7c73076b8
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:55:34 2010 +0100

    binfilter sc_interpr4.cxx further warnings removal
    
    regards
    
    >From f6202b304ca7f0ffdd16cbd2886872465273852a Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Tue, 23 Nov 2010 21:58:53 +0100
    Subject: [PATCH 4/9] binfilter sc_interpr4.cxx further warnings removal

diff --git a/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx b/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx
index 1a64001..a9c9ee7 100644
--- a/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx
@@ -1358,7 +1358,7 @@ BOOL ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r
 /*N*/  	{
 /*N*/  		ScBaseCell* pCell;
 /*N*/  		ScQueryCellIterator aCellIter(pDok, nTab, aQueryParam);
-/*N*/  		if (pCell = aCellIter.GetFirst())
+/*N*/  		if ( (pCell = aCellIter.GetFirst() ) )
 /*N*/  		{
 /*N*/  			if (aCellIter.GetNext())
 /*N*/  				SetIllegalArgument();
@@ -1458,7 +1458,6 @@ BOOL ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r
 /*?*/ 
 /*?*/ 			for (i = nParamCount; (i > 0) && (nGlobalError == 0); i--)
 /*?*/ 			{
-/*?*/ 				BYTE nStackType = GetStackType();
 /*?*/ 				switch (eParamType[i])
 /*?*/ 				{
 /*?*/ 					case PTR_DOUBLE :
@@ -2098,14 +2097,14 @@ void ScInterpreter::ScMissing()
 /*?*/ 					{
 /*?*/ 						short nIdx[ 2 ];
 /*?*/ 						nIdx[ 0 ] = j+1;
-/*?*/ 						for( USHORT i = 0; i < nC; i++ )
+/*?*/ 						for( USHORT k = 0; k < nC; i++ )
 /*?*/ 						{
-/*?*/ 							nIdx[ 1 ] = i+1;
+/*?*/ 							nIdx[ 1 ] = k+1;
 /*?*/ 							SbxVariable* p = refArray->Get( nIdx );
-/*?*/ 							if (pMat->IsString(i, j))
-/*?*/ 								p->PutString( pMat->GetString(i, j) );
+/*?*/ 							if (pMat->IsString(k, j))
+/*?*/ 								p->PutString( pMat->GetString(k, j) );
 /*?*/ 							else
-/*?*/ 								p->PutDouble( pMat->GetDouble(i, j) );
+/*?*/ 								p->PutDouble( pMat->GetDouble(k, j) );
 /*?*/ 						}
 /*?*/ 					}
 /*?*/ 					pPar->PutObject( refArray );
@@ -3041,10 +3040,10 @@ void ScInterpreter::ScTTT()
 /*?*/ 				{	// Stack abraeumen, geht davon aus, dass jede Funktion
 /*?*/ 					// prinzipiell ein Ergebnis pusht, im Fehlerfall kann dies
 /*?*/ 					// ein zufaelliger Wert sein
-/*?*/ 					const ScToken* pResult = pStack[ sp - 1 ];
+/*?*/ 					const ScToken* pResult2 = pStack[ sp - 1 ];
 /*?*/ 					while ( sp > nStackBase )
 /*?*/ 						Pop();
-/*?*/ 					PushTempToken( *pResult );
+/*?*/ 					PushTempToken( *pResult2 );
 /*?*/ 				}
 /*N*/ 			}
 /*N*/ 		}
commit 9242801c872781913c40670b32cf88f5c84de286
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:54:17 2010 +0100

    remove warnings in binfilter - sc_interpr2.cxx
    
    regards
    
    >From 32814375a2999afaf0582a682975ae6ec769f6f5 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at 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

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
commit 6548f8db73553019a1da295f397a1c15f2123315
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date:   Fri Nov 26 07:52:20 2010 +0100

    suppress warning in binfilters sc_token
    
    Hello,
    here some patches in binfilter to remove warnings by compiling...
    Since some changes could (will) look strange, I submit it in little
    chunks, often with compiler warning in comment. This may help the reviewer.
    
    Hope I did no mistake
    regards
    Pierre-André
    
    >From c747a9dcc4af190aac1f216a93f7abd4b39fec85 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod at alumni.ethz.ch>
    Date: Tue, 23 Nov 2010 07:46:54 +0100
    Subject: [PATCH 1/9] suppress warning in binfilters sc_token
    
    changes based on following warnings:
    
    sc_token.cxx:1573:28: warning: comparison is always false due to limited range of data type
    sc_token.cxx:452:12: warning: unused parameter 'n'
    sc_token.cxx:452:12: warning: unused parameter 'rPos'
    sc_token.cxx:452:12: warning: unused parameter 'rPos'
    sc_token.cxx:452:12: warning: unused parameter 'n'
    sc_token.cxx:1613:26: warning: declaration of 'r' shadows a previous local
    sc_token.cxx:1593:25: warning: shadowed declaration is here

diff --git a/binfilter/bf_sc/source/core/tool/sc_token.cxx b/binfilter/bf_sc/source/core/tool/sc_token.cxx
index fe98c35..0bfad52 100644
--- a/binfilter/bf_sc/source/core/tool/sc_token.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_token.cxx
@@ -449,7 +449,7 @@ namespace binfilter {
 /*N*/ 	return 0;
 /*N*/ }
 
-/*N*/ void ScToken::SetByte( BYTE n )
+/*N*/ void ScToken::SetByte( BYTE /*n*/ )
 /*N*/ {
 /*N*/  DBG_ERRORFILE( "ScToken::SetByte: virtual dummy called" );
 /*N*/ }
@@ -502,12 +502,12 @@ namespace binfilter {
 /*N*/  	return aDummySingleRef;
 /*N*/  }
 
-/*N*/ void ScToken::CalcAbsIfRel( const ScAddress& rPos )
+/*N*/ void ScToken::CalcAbsIfRel( const ScAddress& /*rPos*/ )
 /*N*/ {
 /*N*/ 	DBG_ERRORFILE( "ScToken::CalcAbsIfRel: virtual dummy called" );
 /*N*/ }
 
-/*N*/ void ScToken::CalcRelFromAbs( const ScAddress& rPos )
+/*N*/ void ScToken::CalcRelFromAbs( const ScAddress& /*rPos*/ )
 /*N*/ {
 /*N*/ 	DBG_ERRORFILE( "ScToken::CalcRelFromAbs: virtual dummy called" );
 /*N*/ }
@@ -524,7 +524,7 @@ namespace binfilter {
 /*N*/ 	return 0;
 /*N*/ }
 
-/*N*/  void ScToken::SetIndex( USHORT n )
+/*N*/  void ScToken::SetIndex( USHORT /*n*/ )
 /*N*/  {
 /*N*/  	DBG_ERRORFILE( "ScToken::SetIndex: virtual dummy called" );
 /*N*/  }
@@ -1570,16 +1570,7 @@ namespace binfilter {
 /*N*/ 		{
 /*N*/ 			sal_Char c[ MAXSTRLEN+1 ];
 /*N*/ 			rStream >> n;
-/*N*/ 			if( n > MAXSTRLEN-1 )
-/*N*/ 			{
-/*?*/ 				DBG_ERRORFILE( "bad string array boundary" );
-/*?*/ 				USHORT nDiff = n - (MAXSTRLEN-1);
-/*?*/ 				n = MAXSTRLEN-1;
-/*?*/ 				rStream.Read( c, n );
-/*?*/ 				rStream.SeekRel( nDiff );
-/*N*/ 			}
-/*N*/ 			else
-/*N*/ 				rStream.Read( c, n );
+/*N*/ 			rStream.Read( c, n );
 /*N*/ 			cStr[ n ] = 0;
 /*N*/ 			CharSet eSrc = rStream.GetStreamCharSet();
 /*N*/ 			for ( BYTE j=0; j<n; j++ )
@@ -1590,10 +1581,10 @@ namespace binfilter {
 /*N*/ 		case svSingleRef:
 /*N*/ 		case svDoubleRef:
 /*N*/ 		{
-/*N*/ 			SingleRefData& r = aRef.Ref1;
-/*N*/ 			rStream >> r.nCol
-/*N*/ 					>> r.nRow
-/*N*/ 					>> r.nTab
+/*N*/ 			SingleRefData& r1 = aRef.Ref1;
+/*N*/ 			rStream >> r1.nCol
+/*N*/ 					>> r1.nRow
+/*N*/ 					>> r1.nTab
 /*N*/ 					>> n;
 /*N*/ 			if ( nVer < SC_RELATIVE_REFS )
 /*N*/ 			{
@@ -1602,18 +1593,18 @@ namespace binfilter {
 /*N*/ 				aBools.bRelRow = ( ( n >> 2 ) & 0x03 );
 /*N*/ 				aBools.bRelTab = ( ( n >> 4 ) & 0x03 );
 /*N*/ 				aBools.bOldFlag3D = ( ( n >> 6 ) & 0x03 );
-/*N*/ 				r.OldBoolsToNewFlags( aBools );
+/*N*/ 				r1.OldBoolsToNewFlags( aBools );
 /*N*/ 			}
 /*N*/ 			else
-/*N*/ 				r.CreateFlagsFromLoadByte( n );
+/*N*/ 				r1.CreateFlagsFromLoadByte( n );
 /*N*/ 			if( eType == svSingleRef )
-/*N*/ 				aRef.Ref2 = r;
+/*N*/ 				aRef.Ref2 = r1;
 /*N*/ 			else
 /*N*/ 			{
-/*N*/ 				SingleRefData& r = aRef.Ref2;
-/*N*/ 				rStream >> r.nCol
-/*N*/ 						>> r.nRow
-/*N*/ 						>> r.nTab
+/*N*/ 				SingleRefData& r2 = aRef.Ref2;
+/*N*/ 				rStream >> r2.nCol
+/*N*/ 						>> r2.nRow
+/*N*/ 						>> r2.nTab
 /*N*/ 						>> n;
 /*N*/ 				if ( nVer < SC_RELATIVE_REFS )
 /*N*/ 				{
@@ -1622,10 +1613,10 @@ namespace binfilter {
 /*N*/ 					aBools.bRelRow = ( ( n >> 2 ) & 0x03 );
 /*N*/ 					aBools.bRelTab = ( ( n >> 4 ) & 0x03 );
 /*N*/ 					aBools.bOldFlag3D = ( ( n >> 6 ) & 0x03 );
-/*N*/ 					r.OldBoolsToNewFlags( aBools );
+/*N*/ 					r2.OldBoolsToNewFlags( aBools );
 /*N*/ 				}
 /*N*/ 				else
-/*N*/ 					r.CreateFlagsFromLoadByte( n );
+/*N*/ 					r2.CreateFlagsFromLoadByte( n );
 /*N*/ 			}
 /*N*/ 			break;
 /*N*/ 		}


More information about the Libreoffice-commits mailing list