[Libreoffice-commits] core.git: 2 commits - filter/source rsc/source sc/source sw/source tools/bootstrp

Julien Nabet serval2412 at yahoo.fr
Tue Feb 12 07:10:44 PST 2013


 filter/source/graphicfilter/itiff/ccidecom.cxx |    5 +++--
 rsc/source/res/rscarray.cxx                    |   11 ++++-------
 sc/source/ui/view/hdrcont.cxx                  |    1 -
 sw/source/filter/html/wrthtml.hxx              |    2 +-
 tools/bootstrp/md5.cxx                         |   17 +++++++----------
 5 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit 0c1a37e60393504b38990d1f0a95239bf6749766
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Feb 12 16:08:23 2013 +0100

    Some cppcheck cleaning
    
    Change-Id: I74ff9d8d116ebfe9ebc302c79a3763eda9c1250f

diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 601b757..09ae6c2 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -569,6 +569,7 @@ CCIDecompressor::CCIDecompressor( sal_uLong nOpts, sal_uInt32 nImageWidth ) :
     bTableBad   ( sal_False ),
     bStatus     ( sal_False ),
     pByteSwap   ( NULL ),
+    pIStream    ( NULL ),
     nWidth      ( nImageWidth ),
     nOptions    ( nOpts ),
     pLastLine   ( NULL )
@@ -623,7 +624,7 @@ void CCIDecompressor::StartDecompression( SvStream & rIStream )
 sal_Bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTargetBits )
 {
     sal_uInt16 i;
-    sal_uInt8 * pSrc,* pDst;
+    sal_uInt8 * pDst;
     sal_Bool b2D;
 
     if ( nEOLCount >= 5 )   // RTC (Return To Controller)
@@ -700,7 +701,7 @@ sal_Bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTa
     // if we're in 2D mode we have to remember the line:
     if ( nOptions & CCI_OPTION_2D && bStatus == sal_True )
     {
-        pSrc = pTarget;
+        sal_uInt8 *pSrc = pTarget;
         pDst = pLastLine;
         for ( i = 0; i < nLastLineSize; i++ ) *(pDst++)=*(pSrc++);
     }
diff --git a/rsc/source/res/rscarray.cxx b/rsc/source/res/rscarray.cxx
index 46e2086..8b8b6db 100644
--- a/rsc/source/res/rscarray.cxx
+++ b/rsc/source/res/rscarray.cxx
@@ -116,13 +116,13 @@ RscTop * RscArray::GetTypeClass() const
 static RscInstNode * Create( RscInstNode * pNode )
 {
     RscInstNode * pRetNode = NULL;
-    RscInstNode * pTmpNode;
 
     if( pNode )
     {
         pRetNode = new RscInstNode( pNode->GetId() );
         pRetNode->aInst = pNode->aInst.pClass->Create( NULL, pNode->aInst );
-        if( (pTmpNode = Create( pNode->Left() )) != NULL )
+        RscInstNode * pTmpNode = Create(pNode->Left());
+        if (pTmpNode)
             pRetNode->Insert( pTmpNode );
         if( (pTmpNode = Create( pNode->Right() )) != NULL )
             pRetNode->Insert( pTmpNode );
@@ -381,14 +381,11 @@ static sal_Bool IsValueDefault( RscInstNode * pNode, CLASS_DATA pDef )
 
 sal_Bool RscArray::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
 {
-    RscArrayInst * pClassData;
-    sal_Bool bRet;
-
-    bRet = RscTop::IsValueDefault( rInst, pDef );
+    sal_Bool bRet = RscTop::IsValueDefault( rInst, pDef );
 
     if( bRet )
     {
-        pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
+        RscArrayInst * pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
 
         bRet = ::IsValueDefault( pClassData->pNode, pDef );
     }
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 8b77193..a506a73 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -234,7 +234,7 @@ struct SwHTMLFmtInfo
 
     // Konstruktor fuer einen Dummy zum Suchen
     SwHTMLFmtInfo( const SwFmt *pF ) :
-        pFmt( pF ), pRefFmt(0), pItemSet( 0 ), nFirstLineIndent(0)
+        pFmt( pF ), pRefFmt(0), pItemSet( 0 ), nFirstLineIndent(0), bScriptDependent(false)
     {}
 
 
diff --git a/tools/bootstrp/md5.cxx b/tools/bootstrp/md5.cxx
index 9c1ed7b..bf2b72a 100644
--- a/tools/bootstrp/md5.cxx
+++ b/tools/bootstrp/md5.cxx
@@ -40,15 +40,10 @@
 
 void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
 {
-    const int OFFSET_PE_OFFSET = 0x3c;
-    const int OFFSET_COFF_TIMEDATESTAMP = 4;
-    const int PE_SIGNATURE_SIZE = 4;
-    const int COFFHEADER_SIZE = 20;
-    const int OFFSET_PE_OPTIONALHEADER_CHECKSUM = 64;
-
     // Check the header part of the file buffer
     if (buffer[0] == sal_uInt8('M') && buffer[1] == sal_uInt8('Z'))
     {
+        const int OFFSET_PE_OFFSET = 0x3c;
         unsigned long PEHeaderOffset = (long)buffer[OFFSET_PE_OFFSET];
         if (PEHeaderOffset < nBufferSize-4)
         {
@@ -57,6 +52,8 @@ void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
                  buffer[PEHeaderOffset+2] == 0 &&
                  buffer[PEHeaderOffset+3] == 0 )
             {
+                const int PE_SIGNATURE_SIZE = 4;
+                const int OFFSET_COFF_TIMEDATESTAMP = 4;
                 PEHeaderOffset += PE_SIGNATURE_SIZE;
                 if (PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP < nBufferSize-4)
                 {
@@ -68,7 +65,8 @@ void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
                     buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+2] = 0;
                     buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+3] = 0;
                 }
-
+                const int COFFHEADER_SIZE = 20;
+                const int OFFSET_PE_OPTIONALHEADER_CHECKSUM = 64;
                 if (PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM < nBufferSize-4)
                 {
                     // Set checksum to a normalized value
@@ -84,9 +82,6 @@ void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
 
 rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum)
 {
-    const size_t BUFFER_SIZE  = 0x1000;
-    const size_t MINIMAL_SIZE = 512;
-
     sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5];
     rtlDigestError error = rtl_Digest_E_None;
     rtl::OStringBuffer aChecksumBuf;
@@ -99,6 +94,7 @@ rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum)
 
         if ( digest )
         {
+            const size_t BUFFER_SIZE  = 0x1000;
             size_t          nBytesRead;
             sal_uInt8       buffer[BUFFER_SIZE];
             bool            bHeader(true);
@@ -109,6 +105,7 @@ rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum)
                 if (bHeader)
                 {
                     bHeader = false;
+                    const size_t MINIMAL_SIZE = 512;
                     if (nBytesRead >= MINIMAL_SIZE && buffer[0] == sal_uInt8('M') && buffer[1] == sal_uInt8('Z') )
                         normalize_pe_image(buffer, nBytesRead);
                 }
commit df98a644a2325f509eac8555cdc731f6ff46f404
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Feb 12 15:59:57 2013 +0100

    Fix duplicate conditions
    
    It was like this since initial commit in 2000-09-18
    
    Change-Id: I83c73fcd4ec564770502f00c6301d5e405dc6c62

diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index bb6c3f7..fb90a96 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -767,7 +767,6 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
         }
         else
         {
-            if (nNewWidth<0) nNewWidth=0;
             if (bDragMoved)
                 SetEntrySize( nDragNo, (sal_uInt16) nNewWidth );
         }


More information about the Libreoffice-commits mailing list