Kaydet (Commit) 0b018d20 authored tarafından Serge Krot's avatar Serge Krot Kaydeden (comit) Thorsten Behrens

tdf#39440: fix several warnings reported by cppcheck

Change-Id: I560d28b7cc67740c6479494d0e5aa62d2ac6ffae
Reviewed-on: https://gerrit.libreoffice.org/19587Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst ce463679
......@@ -385,7 +385,7 @@ namespace
#ifdef BRDEBUG
fprintf(stderr,"cpp_mediate1 gp=%p,fp=%p,ov=%p\n",gpreg,fpreg,ovrflw);
fprintf(stderr,"gp=%x,%x,%x,%x\n",gpreg[0],gpreg[1],gpreg[2],gpreg[3]);
fprintf(stderr,"gp=%p,%p,%p,%p\n",gpreg[0],gpreg[1],gpreg[2],gpreg[3]);
#endif
// gpreg: [ret *], this, [other gpr params]
......
......@@ -377,7 +377,7 @@ void * pRegReturn = &nRegReturn;
// fprintf(stderr,"cpp_mediate nFunctionIndex=%x\n",nFunctionIndex);
// fflush(stderr);
sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False;
const sal_Bool bComplex = (nFunctionIndex & 0x80000000) ? sal_True : sal_False;
typelib_TypeClass aType =
cpp_mediate( nFunctionIndex, vTableOffset, pCallStack+17, (sal_Int64*)&nRegReturn );
......
......@@ -112,7 +112,7 @@ void testWriter( const Reference < XComponent > & rCmp )
printf( "pleast type any text\n" );
while( true )
{
scanf( "%s" , pcText );
scanf( "%1023s" , pcText );
if( !strcmp( pcText , "end" ) )
{
......
......@@ -220,8 +220,7 @@ void comphelper::ConfigurationListener::addListener(ConfigurationListenerPropert
void comphelper::ConfigurationListener::removeListener(ConfigurationListenerPropertyBase *pListener)
{
auto it = maListeners.begin();
it = std::find( maListeners.begin(), maListeners.end(), pListener );
auto it = std::find( maListeners.begin(), maListeners.end(), pListener );
if ( it != maListeners.end() )
{
maListeners.erase( it );
......
......@@ -26,7 +26,7 @@ class AutoMem:
public RecursiveASTVisitor<AutoMem>, public loplugin::Plugin
{
public:
explicit AutoMem(InstantiationData const & data): Plugin(data) {}
explicit AutoMem(InstantiationData const & data): Plugin(data), mbInsideDestructor(false) {}
virtual void run() override
{
......
......@@ -89,7 +89,7 @@ class BadVectorInit:
public RecursiveASTVisitor<BadVectorInit>, public loplugin::Plugin
{
public:
explicit BadVectorInit(InstantiationData const & data): Plugin(data) {}
explicit BadVectorInit(InstantiationData const & data): Plugin(data), mbInsideFunction(false) {}
virtual void run() override
{
......
......@@ -21,7 +21,7 @@ class StaticMethods:
private:
bool bVisitedThis;
public:
explicit StaticMethods(InstantiationData const & data): Plugin(data) {}
explicit StaticMethods(InstantiationData const & data): Plugin(data), bVisitedThis(false) {}
void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
......
......@@ -616,17 +616,18 @@ Sequence< OUString > SvxLinguData_Impl::GetSortedImplNames( sal_Int16 nLang, sal
ServiceInfo_Impl * SvxLinguData_Impl::GetInfoByImplName( const OUString &rSvcImplName )
{
ServiceInfo_Impl* pInfo = 0;
for (sal_uLong i = 0; i < nDisplayServices && !pInfo; ++i)
for (sal_uLong i = 0; i < nDisplayServices; ++i)
{
ServiceInfo_Impl &rTmp = aDisplayServiceArr[ i ];
if (rTmp.sSpellImplName == rSvcImplName ||
rTmp.sHyphImplName == rSvcImplName ||
rTmp.sThesImplName == rSvcImplName ||
rTmp.sGrammarImplName == rSvcImplName)
pInfo = &rTmp;
{
return &rTmp;
}
}
return pInfo;
return 0;
}
......
......@@ -599,7 +599,7 @@ namespace drawinglayer
// offset in X, so iterate over Y first and draw lines
for(sal_Int32 nYPos(nBTop); nYPos < nOTop + nOHeight; nYPos += nBHeight, nPosY++)
{
for(sal_Int32 nXPos(nPosY % 2 ? nBLeft - nBWidth + nOffsetX : nBLeft);
for(sal_Int32 nXPos((nPosY % 2) ? nBLeft - nBWidth + nOffsetX : nBLeft);
nXPos < nOLeft + nOWidth; nXPos += nBWidth)
{
const Rectangle aOutRectPixel(Point(nXPos, nYPos), aNeededBitmapSizePixel);
......@@ -626,7 +626,7 @@ namespace drawinglayer
// possible offset in Y, so iterate over X first and draw columns
for(sal_Int32 nXPos(nBLeft); nXPos < nOLeft + nOWidth; nXPos += nBWidth, nPosX++)
{
for(sal_Int32 nYPos(nPosX % 2 ? nBTop - nBHeight + nOffsetY : nBTop);
for(sal_Int32 nYPos((nPosX % 2) ? nBTop - nBHeight + nOffsetY : nBTop);
nYPos < nOTop + nOHeight; nYPos += nBHeight)
{
const Rectangle aOutRectPixel(Point(nXPos, nYPos), aNeededBitmapSizePixel);
......
......@@ -780,7 +780,7 @@ namespace drawinglayer
{
for(double fPosX(fStartX); basegfx::fTools::less(fPosX, 1.0); fPosX += fWidth, nPosX++)
{
for(double fPosY(nPosX % 2 ? fStartY - fHeight + (mfOffsetY * fHeight) : fStartY);
for(double fPosY((nPosX % 2) ? fStartY - fHeight + (mfOffsetY * fHeight) : fStartY);
basegfx::fTools::less(fPosY, 1.0); fPosY += fHeight)
{
rMatrices.push_back(
......@@ -796,7 +796,7 @@ namespace drawinglayer
{
for(double fPosY(fStartY); basegfx::fTools::less(fPosY, 1.0); fPosY += fHeight, nPosY++)
{
for(double fPosX(nPosY % 2 ? fStartX - fWidth + (mfOffsetX * fWidth) : fStartX);
for(double fPosX((nPosY % 2) ? fStartX - fWidth + (mfOffsetX * fWidth) : fStartX);
basegfx::fTools::less(fPosX, 1.0); fPosX += fWidth)
{
rMatrices.push_back(
......
......@@ -206,7 +206,7 @@ int SAL_CALL main( int nArgc, char* Argv[] )
// threaded apartment we need a message loop to deliver
// messages to our XTDataObject
//HRESULT hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
HRESULT hr = CoInitialize( NULL );
(void)CoInitialize( NULL );
char buff[6];
......
......@@ -68,7 +68,7 @@ unsigned int _stdcall ThreadProc(LPVOID pParam)
WaitForSingleObject( g_hEvtThreadWakeup, INFINITE );
IDataObject* pIDo;
IDataObject* pIDo = NULL;
#ifdef RAW_MARSHALING
......
......@@ -139,7 +139,6 @@ LRESULT AWindow::OnMouseAction(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
LRESULT AWindow::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
HRESULT hr;
USES_CONVERSION;
KillTimer( 1);
if(m_xDragSource.is())
......
......@@ -61,8 +61,8 @@ bool isAccessibilitySupportDesired()
sValue == "1" )
return false;
bool retVal = false;
#ifdef WNT
bool retVal = false;
HKEY hKey = 0;
if (RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\LibreOffice\\Accessibility\\AtToolSupport",
......@@ -104,7 +104,7 @@ bool isAccessibilitySupportDesired()
#elif defined UNX
// Java is no longer required for a11y - we use atk directly.
retVal = ::rtl::Bootstrap::get( "JFW_PLUGIN_FORCE_ACCESSIBILITY", sValue) && sValue == "1";
bool retVal = ::rtl::Bootstrap::get( "JFW_PLUGIN_FORCE_ACCESSIBILITY", sValue) && sValue == "1";
#endif
return retVal;
......
......@@ -392,7 +392,7 @@ static sal_Bool writeProfileImpl(osl_TFile* pFile)
bRet=WriteFile(pFile->m_Handle, pFile->m_pWriteBuf, pFile->m_nWriteBufLen - pFile->m_nWriteBufFree,&BytesWritten,NULL);
if ( bRet == 0 || BytesWritten <= 0 )
if ( bRet == 0 || BytesWritten == 0 )
{
OSL_ENSURE(bRet,"WriteFile failed!!!");
OSL_TRACE("write failed '%s'",strerror(errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment