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@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
---
binfilter/bf_sc/source/core/tool/sc_token.cxx | 45 ++++++++++---------------
1 files changed, 18 insertions(+), 27 deletions(-)
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*/ }
--
1.7.1
Context
- [Libreoffice] [PATCH 1/9] suppress warning in binfilters sc_token · Pierre-André Jacquod
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.