Some cppcheck cleaning

Change-Id: I8609949377181f8edb30ac07b2791cfcd079fc7d
This commit is contained in:
Julien Nabet
2013-02-12 21:24:03 +01:00
parent 1aaf9a9b36
commit 56f4d7dc9d
5 changed files with 10 additions and 11 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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;