Le 11/01/2011 23:16, Julien Nabet a écrit :
Hello,
Here is a patch for cppcheck cleaning for cppu and cppuhelper
Compiling these modules was ok
I don't if it's a link but I had this in testtools (event after a rm
-rf unxlngi6.pro/ ) :
./constructors.uno.so
register component './bridgetest.uno.so' in registry
'uno_services.rdb' successful!
register component './cppobj.uno.so' in registry 'uno_services.rdb'
successful!
register component './constructors.uno.so' in registry
'uno_services.rdb' successful!
: &&
LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}/home/maryline/libreoffice-source/libo/clone/testing/testtools/unxlngi6.pro/lib:/home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/lib
/home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/bin/regcomp
-register -br ../../unxlngi6.pro/lib/uno_types.rdb -r
../../unxlngi6.pro/lib/uno_services.rdb \
-c javaloader.uno.so -c javavm.uno.so
javaloader.uno.so
javavm.uno.so
register component 'javaloader.uno.so' in registry
'../../unxlngi6.pro/lib/uno_services.rdb' successful!
register component 'javavm.uno.so' in registry
'../../unxlngi6.pro/lib/uno_services.rdb' successful!
: &&
LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}/home/maryline/libreoffice-source/libo/clone/testing/testtools/unxlngi6.pro/lib:/home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/lib
/home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/bin/regcomp
-register -br ../../unxlngi6.pro/misc/bridgetest/bootstrap.rdb -r
../../unxlngi6.pro/lib/uno_services.rdb -c \
file:///home/maryline/libreoffice-source/libo/clone/testing/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar
\
-env:URE_INTERNAL_JAVA_DIR=file:///home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/bin
using loader com.sun.star.loader.Java2
file:///home/maryline/libreoffice-source/libo/clone/testing/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar
/bin/bash: line 1: 3927 Segmentation fault
LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}/home/maryline/libreoffice-source/libo/clone/testing/testtools/unxlngi6.pro/lib:/home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/lib
/home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/bin/regcomp
-register -br ../../unxlngi6.pro/misc/bridgetest/bootstrap.rdb -r
../../unxlngi6.pro/lib/uno_services.rdb -c
file:///home/maryline/libreoffice-source/libo/clone/testing/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar
-env:URE_INTERNAL_JAVA_DIR=file:///home/maryline/libreoffice-source/libo/solver/330/unxlngi6.pro/bin
dmake: Error code 139, while making
'../../unxlngi6.pro/lib/uno_services.rdb'
dmake: '../../unxlngi6.pro/lib/uno_services.rdb' removed.
Julien
(LGPLv3+ / MPL)
It's better with the attachments :-)
commit bbb079a22252ad91bf6692628b60be10a17c1ec8
Author: Julien Nabet <[email protected]>
Date: Tue Jan 11 22:14:32 2011 +0100
Some cppcheck cleaning
diff --git a/cppu/source/threadpool/jobqueue.cxx
b/cppu/source/threadpool/jobqueue.cxx
index 6db0d68..61b581c 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -184,7 +184,7 @@ namespace cppu_threadpool {
return m_lstCallstack.empty();
}
- sal_Bool JobQueue::isBusy()
+ sal_Bool JobQueue::isBusy() const
{
return m_nToDo > 0;
}
diff --git a/cppu/source/threadpool/jobqueue.hxx
b/cppu/source/threadpool/jobqueue.hxx
index 7016fc0..9d4a35b 100644
--- a/cppu/source/threadpool/jobqueue.hxx
+++ b/cppu/source/threadpool/jobqueue.hxx
@@ -70,7 +70,7 @@ namespace cppu_threadpool
sal_Bool isEmpty();
sal_Bool isCallstackEmpty();
- sal_Bool isBusy();
+ sal_Bool isBusy() const;
private:
::osl::Mutex m_mutex;
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 12fbb25..b6da0b9 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -73,7 +73,7 @@ public:
inline Mapping( const Mapping & rMapping ) SAL_THROW( () );
inline ~Mapping() SAL_THROW( () );
inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping ) SAL_THROW(
() );
- inline Mapping & SAL_CALL operator = ( const Mapping & rMapping )
SAL_THROW( () )
+ inline Mapping & SAL_CALL operator = ( const Mapping & rMapping )
SAL_THROW( () ) const
{ return operator = ( rMapping._pMapping ); }
inline uno_Mapping * SAL_CALL get() const SAL_THROW( () )
{ return _pMapping; }
commit e1c484742761b7e715963462ca5e13b4f70e799a
Author: Julien Nabet <[email protected]>
Date: Tue Jan 11 23:10:40 2011 +0100
Some cppcheck cleaning
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
index 4f47fd4..79d14c1 100644
--- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
+++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
@@ -129,7 +129,7 @@ namespace cppu_ifcontainer
for (i = 0; i < nTests; i++)
{
Reference<XEventListener> xRef = new
ContainerListener(&aStats);
- int nNewLen = pContainer->addInterface(xRef);
+ pContainer->addInterface(xRef);
aListeners.push_back(xRef);
}
Sequence< Reference< XInterface > > aElements;
diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx
b/cppuhelper/qa/unourl/cppu_unourl.cxx
index c37d08a..792ff89 100644
--- a/cppuhelper/qa/unourl/cppu_unourl.cxx
+++ b/cppuhelper/qa/unourl/cppu_unourl.cxx
@@ -126,7 +126,6 @@ namespace cppu_unourl
{ "abc,def=%22", "abc,def=%22" },
{ "abc,def=\"", "abc,def=\"" },
{ "abc,def=%ed%a0%80", "abc,def=%ed%a0%80" } };
- bool bResult = true;
for (int i = 0; i < sizeof aTests / sizeof (Test); ++i)
{
bool bValid = false;
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index b811dad..17db064 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -273,7 +273,7 @@ OUString findBoostrapArgument(
}
Reference< registry::XSimpleRegistry > nestRegistries(
- const OUString baseDir,
+ const OUString &baseDir,
const Reference< lang::XSingleServiceFactory > & xSimRegFac,
const Reference< lang::XSingleServiceFactory > & xNesRegFac,
OUString csl_rdbs,
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 42bb1c1..507a90f 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -909,11 +909,11 @@ void OPropertySetHelper::firePropertiesChangeEvent(
Sequence<PropertyChangeEvent> aChanges( nFireLen );
PropertyChangeEvent* pChanges = aChanges.getArray();
- sal_Int32 nFirePos = 0;
{
// must lock the mutex outside the loop. So all values are consistent.
MutexGuard aGuard( rBHelper.rMutex );
Reference < XInterface > xSource( (XPropertySet *)this, UNO_QUERY );
+ sal_Int32 nFirePos = 0;
for( i = 0; i < nLen; i++ )
{
if( pHandles[i] != -1 )
@@ -946,7 +946,6 @@ PropertyState OPropertySetHelper::getPropertyState( const
OUString& PropertyName
Sequence< PropertyState > OPropertySetHelper::getPropertyStates( const
Sequence< OUString >& PropertyNames )
{
ULONG nNames = PropertyNames.getLength();
- const OUString* pNames = PropertyNames.getConstArray();
Sequence< PropertyState > aStates( nNames );
return aStates;
diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx
index c5b76e4..90547ed 100644
--- a/cppuhelper/source/tdmgr.cxx
+++ b/cppuhelper/source/tdmgr.cxx
@@ -502,8 +502,7 @@ inline static typelib_TypeDescription * createCTD(
0, 0 );
// cleanup
- if (pRefType)
- typelib_typedescription_release( pRefType );
+ typelib_typedescription_release( pRefType );
}
return pRet;
}
diff --git a/cppuhelper/test/testpropshlp.cxx b/cppuhelper/test/testpropshlp.cxx
index ebea7d0..8628567 100644
--- a/cppuhelper/test/testpropshlp.cxx
+++ b/cppuhelper/test/testpropshlp.cxx
@@ -461,7 +461,7 @@ public:
{
}
- sal_Int32 getRefCount()
+ sal_Int32 getRefCount() const
{ return m_refCount; }
// XEventListener
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice