Kaydet (Commit) 233e5d5f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

clang-cl loplugin: basic

Change-Id: Ibb324ac81343d56038d18a4ee9b27b486df6e520
Reviewed-on: https://gerrit.libreoffice.org/29881Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 22001778
......@@ -151,7 +151,7 @@ void VBATest::testMiscOLEStuff()
fprintf(stderr, "macro result for %s\n", macroSource[ i ] );
fprintf(stderr, "macro returned:\n%s\n", OUStringToOString( pReturn->GetOUString(), RTL_TEXTENCODING_UTF8 ).getStr() );
}
CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != NULL );
CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != nullptr );
CPPUNIT_ASSERT_MESSAGE("Result not as expected", pReturn->GetOUString() == "OK" );
}
#else
......
......@@ -744,7 +744,7 @@ void SbiIoSystem::Shutdown()
vcl::Window* pParent = Application::GetDefDialogParent();
ScopedVclPtrInstance<MessBox>( pParent, WinBits( WB_OK ), OUString(), aOut )->Execute();
#else
ScopedVclPtrInstance<MessBox>( GetpApp()->GetDefDialogParent(), WinBits( WB_OK ), OUString(), aOut )->Execute();
ScopedVclPtrInstance<MessBox>( Application::GetDefDialogParent(), WinBits( WB_OK ), OUString(), aOut )->Execute();
#endif
}
aOut.clear();
......
......@@ -420,7 +420,7 @@ RTLFUNC(CurDir)
}
}
char* pBuffer = new char[ _MAX_PATH ];
if ( _getdcwd( nCurDir, pBuffer, _MAX_PATH ) != 0 )
if ( _getdcwd( nCurDir, pBuffer, _MAX_PATH ) != nullptr )
{
rPar.Get(0)->PutString( OUString::createFromAscii( pBuffer ) );
}
......
......@@ -285,7 +285,7 @@ RTLFUNC(CDec)
(void)bWrite;
#ifdef _WIN32
SbxDecimal* pDec = NULL;
SbxDecimal* pDec = nullptr;
if ( rPar.Count() == 2 )
{
SbxVariable *pSbxVariable = rPar.Get(1);
......
......@@ -92,28 +92,28 @@ void releaseDecimalPtr( SbxDecimal*& rpDecimal )
bool SbxDecimal::operator -= ( const SbxDecimal &r )
{
HRESULT hResult = VarDecSub( &maDec, (LPDECIMAL)&r.maDec, &maDec );
HRESULT hResult = VarDecSub( &maDec, const_cast<LPDECIMAL>(&r.maDec), &maDec );
bool bRet = ( hResult == S_OK );
return bRet;
}
bool SbxDecimal::operator += ( const SbxDecimal &r )
{
HRESULT hResult = VarDecAdd( &maDec, (LPDECIMAL)&r.maDec, &maDec );
HRESULT hResult = VarDecAdd( &maDec, const_cast<LPDECIMAL>(&r.maDec), &maDec );
bool bRet = ( hResult == S_OK );
return bRet;
}
bool SbxDecimal::operator /= ( const SbxDecimal &r )
{
HRESULT hResult = VarDecDiv( &maDec, (LPDECIMAL)&r.maDec, &maDec );
HRESULT hResult = VarDecDiv( &maDec, const_cast<LPDECIMAL>(&r.maDec), &maDec );
bool bRet = ( hResult == S_OK );
return bRet;
}
bool SbxDecimal::operator *= ( const SbxDecimal &r )
{
HRESULT hResult = VarDecMul( &maDec, (LPDECIMAL)&r.maDec, &maDec );
HRESULT hResult = VarDecMul( &maDec, const_cast<LPDECIMAL>(&r.maDec), &maDec );
bool bRet = ( hResult == S_OK );
return bRet;
}
......@@ -135,7 +135,7 @@ bool SbxDecimal::isZero()
SbxDecimal::CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight )
{
HRESULT hResult = VarDecCmp( (LPDECIMAL)&rLeft.maDec, (LPDECIMAL)&rRight.maDec );
HRESULT hResult = VarDecCmp( const_cast<LPDECIMAL>(&rLeft.maDec), const_cast<LPDECIMAL>(&rRight.maDec) );
SbxDecimal::CmpResult eRes = (SbxDecimal::CmpResult)hResult;
return eRes;
}
......@@ -226,11 +226,11 @@ bool SbxDecimal::setString( OUString* pOUString )
pBuffer[i] = ',';
i++;
}
hResult = VarDecFromStr( (OLECHAR*)pBuffer.get(), nLANGID, 0, &maDec );
hResult = VarDecFromStr( pBuffer.get(), nLANGID, 0, &maDec );
}
else
{
hResult = VarDecFromStr( (OLECHAR*)pOUString->getStr(), nLANGID, 0, &maDec );
hResult = VarDecFromStr( pOUString->getStr(), nLANGID, 0, &maDec );
}
bRet = ( hResult == S_OK );
return bRet;
......@@ -356,7 +356,7 @@ void SbxDecimal::getString( OUString& rString )
OLECHAR sz[100];
BSTR aBStr = SysAllocString( sz );
if( aBStr != NULL )
if( aBStr != nullptr )
{
HRESULT hResult = VarBstrFromDec( &maDec, nLANGID, 0, &aBStr );
if( hResult == S_OK )
......
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