summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-02-12 16:08:23 +0100
committerJulien Nabet <serval2412@yahoo.fr>2013-02-12 16:08:44 +0100
commit0c1a37e60393504b38990d1f0a95239bf6749766 (patch)
treeaebfe560d9f4aa816c43856195e6b1b424931b4a
parentdf98a644a2325f509eac8555cdc731f6ff46f404 (diff)
Some cppcheck cleaning
Change-Id: I74ff9d8d116ebfe9ebc302c79a3763eda9c1250f
-rw-r--r--filter/source/graphicfilter/itiff/ccidecom.cxx5
-rw-r--r--rsc/source/res/rscarray.cxx11
-rw-r--r--sw/source/filter/html/wrthtml.hxx2
-rw-r--r--tools/bootstrp/md5.cxx17
4 files changed, 15 insertions, 20 deletions
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 601b7579ac12..09ae6c233f69 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 46e208667450..8b8b6db7b29a 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 8b771939622b..a506a73a2243 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 9c1ed7b16713..bf2b72aaf7ee 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);
}