[Libreoffice-commits] core.git: idlc/source jvmfwk/source rsc/source sc/qa svtools/source

Julien Nabet serval2412 at yahoo.fr
Tue Feb 12 12:26:24 PST 2013


 idlc/source/idlc.cxx                           |    3 +--
 jvmfwk/source/fwkbase.cxx                      |    6 ++++--
 rsc/source/tools/rsctree.cxx                   |    4 ++--
 sc/qa/unit/helper/qahelper.hxx                 |    5 ++---
 svtools/source/uno/popupmenucontrollerbase.cxx |    3 +--
 5 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 56f4d7dc9d0a10dbe0bc2d55fb5fa931453c91db
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Feb 12 21:24:03 2013 +0100

    Some cppcheck cleaning
    
    Change-Id: I8609949377181f8edb30ac07b2791cfcd079fc7d

diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx
index 2fd2909..4002b13 100644
--- a/idlc/source/idlc.cxx
+++ b/idlc/source/idlc.cxx
@@ -153,10 +153,9 @@ static void SAL_CALL predefineXInterface(AstModule* pRoot)
 
 static void SAL_CALL initializePredefinedTypes(AstModule* pRoot)
 {
-    AstBaseType* pPredefined = NULL;
     if ( pRoot )
     {
-         pPredefined = new AstBaseType(ET_long, OString("long"), pRoot);
+         AstBaseType* pPredefined = new AstBaseType(ET_long, OString("long"), pRoot);
          pRoot->addDeclaration(pPredefined);
 
          pPredefined = new AstBaseType(ET_ulong, OString("unsigned long"), pRoot);
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index a251401..5a6693d 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -366,7 +366,6 @@ rtl::OString BootParams::getClasspath()
 {
     rtl::OString sClassPath;
     rtl::OUString sCP;
-    char szSep[] = {SAL_PATHSEPARATOR,0};
     if (Bootstrap::get()->getFrom(
         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_JAVA_JFW_CLASSPATH)),
         sCP) == sal_True)
@@ -387,6 +386,7 @@ rtl::OString BootParams::getClasspath()
         char * pCp = getenv("CLASSPATH");
         if (pCp)
         {
+            char szSep[] = {SAL_PATHSEPARATOR,0};
             sClassPath += rtl::OString(szSep) + rtl::OString(pCp);
         }
 #if OSL_DEBUG_LEVEL >=2
@@ -602,7 +602,6 @@ rtl::OString makeClassPathOption(OUString const & sUserClassPath)
     //Compose the class path
     rtl::OString sPaths;
     rtl::OUStringBuffer sBufCP(4096);
-    char szSep[] = {SAL_PATHSEPARATOR,0};
 
     // append all user selected jars to the class path
     if (!sUserClassPath.isEmpty())
@@ -613,7 +612,10 @@ rtl::OString makeClassPathOption(OUString const & sUserClassPath)
     if (!sAppCP.isEmpty())
     {
         if (!sUserClassPath.isEmpty())
+        {
+            char szSep[] = {SAL_PATHSEPARATOR,0};
             sBufCP.appendAscii(szSep);
+        }
         sBufCP.append(sAppCP);
     }
 
diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx
index 339ee39..f424d43 100644
--- a/rsc/source/tools/rsctree.cxx
+++ b/rsc/source/tools/rsctree.cxx
@@ -67,7 +67,6 @@ void BiNode::EnumNodes( Link aLink ) const{
 |*
 *************************************************************************/
 BiNode * BiNode::ChangeDLListBTree( BiNode * pList ){
-    BiNode * pRightNode;
     BiNode * pMiddle;
     BiNode * pTmp;
     sal_uInt32 nEle, i;
@@ -89,7 +88,8 @@ BiNode * BiNode::ChangeDLListBTree( BiNode * pList ){
             pTmp->pRight = (BiNode *)0;
 
         // linken Zeiger auf Null
-        if( NULL != (pRightNode = pMiddle->Right()) )
+        BiNode * pRightNode = pMiddle->Right();
+        if (pRightNode)
             pRightNode->pLeft = (BiNode *)0;
 
         pMiddle->pLeft = ChangeDLListBTree( pList );
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 86275f7..b09a61e 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -103,10 +103,9 @@ void loadFile(const OUString& aFileName, std::string& aContent)
     OString aOFileName = OUStringToOString(aFileName, RTL_TEXTENCODING_UTF8);
 
 #ifdef ANDROID
-    const char *contents;
     size_t size;
     if (strncmp(aOFileName.getStr(), "/assets/", sizeof("/assets/")-1) == 0) {
-        contents = (const char *) lo_apkentry(aOFileName.getStr(), &size);
+        const char *contents = (const char *) lo_apkentry(aOFileName.getStr(), &size);
         if (contents != 0) {
             aContent = std::string(contents, size);
             return;
@@ -243,7 +242,7 @@ public:
         for ( unsigned int index=0; index<numElems; ++index )
         {
             OUString sFileName = OUString::createFromAscii( aTestValues[ index ].sTestDoc );
-            printf("aTestValues[%d] %s\n", index, OUStringToOString( sFileName, RTL_TEXTENCODING_UTF8 ).getStr() );
+            printf("aTestValues[%u] %s\n", index, OUStringToOString( sFileName, RTL_TEXTENCODING_UTF8 ).getStr() );
             int nImportType =  aTestValues[ index ].nImportType;
             int nExportType =  aTestValues[ index ].nExportType;
             ScDocShellRef xShell = loadDoc( sFileName, nImportType );
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx
index e2b29c0..0469e92 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -85,10 +85,9 @@ void PopupMenuControllerBase::throwIfDisposed() throw ( RuntimeException )
 // protected function
 void PopupMenuControllerBase::resetPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu )
 {
-    VCLXPopupMenu* pPopupMenu = 0;
     if ( rPopupMenu.is() && rPopupMenu->getItemCount() > 0 )
     {
-         pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
+         VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu );
          if ( pPopupMenu )
          {
             SolarMutexGuard aSolarMutexGuard;


More information about the Libreoffice-commits mailing list