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


Hi,
further warning cleaning within binfilter.

Whoever has written this liked shadowing. I got
{
    var a    <---- warning shadowing this
    {
        var a  <--- warning shadowing a
    }
}

which are nice to sort out !!!

I review twice these patches before sending, but I fear to have missed
some points. Due to shadowing "this", the compiler does not complain if
I miss a parameter within the shadowed scope. I hope my IDE helped
enough to catch my human failure.

Learning with experiences, from now, not yet done consistently within
this patch series, I will proceed following this pattern:

as soon as I get a variable aaa shadowing this
-> replace all aaa with aaa0 independently if this variable is shadowing
or not (maybe I rename also a variable within a function, where there is
not shadowing)
  -> for following shadowing, increase the postfix with aaa1, aaa2,..

this will make slightly bigger diff, but will reduce the error
possibilities, since the compiler will complain for a aaa0 which was out
of the shadowed scope.

I hope this kind of approach is OK for you

regards
Pierre-André
From 92ecf08e376e87d1d8075edaa37762c6ec244d6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre-Andr=C3=A9=20Jacquod?= <pjacquod@alumni.ethz.ch>
Date: Fri, 26 Nov 2010 19:17:56 +0100
Subject: [PATCH 1/7] warning cleaing binfilter sw3io

based on
sw_sw3nodes.cxx:: warning: comparison is always false due to limited range of data type
---
 binfilter/bf_sw/source/core/sw3io/sw_sw3nodes.cxx |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3nodes.cxx 
b/binfilter/bf_sw/source/core/sw3io/sw_sw3nodes.cxx
index 20ad31b..c6fdf62 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3nodes.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3nodes.cxx
@@ -1900,12 +1900,7 @@ SV_DECL_PTRARR( SwTxtAttrs, SwTxtAttrPtr, 5, 5 )//STRIP008 ;
 /*N*/          // der Header
 /*N*/          cFlags = 0x04;  // 4 Bytes Daten
 /*N*/          xub_StrLen nBegin = pWrong->GetBeginInv();
-/*N*/          if( nBegin > STRING_MAXLEN52 )
-/*N*/                  nBegin = STRING_MAXLEN52;
-/*N*/ 
 /*N*/          xub_StrLen nEnd = pWrong->GetEndInv();
-/*N*/          if( nEnd > STRING_MAXLEN52 )
-/*N*/                  nEnd = STRING_MAXLEN52;
 /*N*/ 
 /*N*/          *pStrm << cFlags
 /*N*/                     << (UINT16)nBegin
-- 
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.