summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:12:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:12:46 +0100
commit8af176d7776938249f6e59dee3ed4f5c05edbebc (patch)
treef5f468ea916a9d52ed5796287759186f24cbec0a /ucb
parentb7f0446d78923c46ab604ccaf48970a6b405ba5e (diff)
More loplugin:cstylecast: ucb
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I17a91ab6117f1d451fa8daec2a6f9542fc9ed2df
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/FileAccess.cxx2
-rw-r--r--ucb/source/sorter/sortresult.cxx48
-rw-r--r--ucb/source/sorter/sortresult.hxx4
-rw-r--r--ucb/source/ucp/file/filinpstr.cxx2
-rw-r--r--ucb/source/ucp/file/filstr.cxx4
-rw-r--r--ucb/source/ucp/file/filtask.cxx2
-rw-r--r--ucb/source/ucp/ftp/ftpdirp.hxx2
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx4
8 files changed, 34 insertions, 34 deletions
diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx
index 3093a71e43fa..a581ff4f226f 100644
--- a/ucb/source/core/FileAccess.cxx
+++ b/ucb/source/core/FileAccess.cxx
@@ -399,7 +399,7 @@ sal_Int32 OFileAccess::getSize( const OUString& FileURL )
INetURLObject aObj( FileURL, INetProtocol::File );
ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), mxEnvironment.get(), comphelper::getProcessComponentContext() );
aCnt.getPropertyValue( "Size" ) >>= nTemp;
- nSize = (sal_Int32)nTemp;
+ nSize = static_cast<sal_Int32>(nTemp);
return nSize;
}
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 4998409330e2..4041fdcb806e 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -952,11 +952,11 @@ sal_IntPtr SortedResultSet::CompareImpl( const Reference < XResultSet >& xResult
if ( xResultTwo->absolute( nIndexTwo ) )
aTwo = xRowTwo->getDate( nColumn );
- nTmp = (sal_Int32) aTwo.Year - (sal_Int32) aOne.Year;
+ nTmp = static_cast<sal_Int32>(aTwo.Year) - static_cast<sal_Int32>(aOne.Year);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Month - (sal_Int32) aOne.Month;
+ nTmp = static_cast<sal_Int32>(aTwo.Month) - static_cast<sal_Int32>(aOne.Month);
if ( !nTmp )
- nTmp = (sal_Int32) aTwo.Day - (sal_Int32) aOne.Day;
+ nTmp = static_cast<sal_Int32>(aTwo.Day) - static_cast<sal_Int32>(aOne.Day);
}
if ( nTmp < 0 )
@@ -978,14 +978,14 @@ sal_IntPtr SortedResultSet::CompareImpl( const Reference < XResultSet >& xResult
if ( xResultTwo->absolute( nIndexTwo ) )
aTwo = xRowTwo->getTime( nColumn );
- nTmp = (sal_Int32) aTwo.Hours - (sal_Int32) aOne.Hours;
+ nTmp = static_cast<sal_Int32>(aTwo.Hours) - static_cast<sal_Int32>(aOne.Hours);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Minutes - (sal_Int32) aOne.Minutes;
+ nTmp = static_cast<sal_Int32>(aTwo.Minutes) - static_cast<sal_Int32>(aOne.Minutes);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Seconds - (sal_Int32) aOne.Seconds;
+ nTmp = static_cast<sal_Int32>(aTwo.Seconds) - static_cast<sal_Int32>(aOne.Seconds);
if ( !nTmp )
- nTmp = (sal_Int32) aTwo.NanoSeconds
- - (sal_Int32) aOne.NanoSeconds;
+ nTmp = static_cast<sal_Int32>(aTwo.NanoSeconds)
+ - static_cast<sal_Int32>(aOne.NanoSeconds);
}}
if ( nTmp < 0 )
@@ -1007,20 +1007,20 @@ sal_IntPtr SortedResultSet::CompareImpl( const Reference < XResultSet >& xResult
if ( xResultTwo->absolute( nIndexTwo ) )
aTwo = xRowTwo->getTimestamp( nColumn );
- nTmp = (sal_Int32) aTwo.Year - (sal_Int32) aOne.Year;
+ nTmp = static_cast<sal_Int32>(aTwo.Year) - static_cast<sal_Int32>(aOne.Year);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Month - (sal_Int32) aOne.Month;
+ nTmp = static_cast<sal_Int32>(aTwo.Month) - static_cast<sal_Int32>(aOne.Month);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Day - (sal_Int32) aOne.Day;
+ nTmp = static_cast<sal_Int32>(aTwo.Day) - static_cast<sal_Int32>(aOne.Day);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Hours - (sal_Int32) aOne.Hours;
+ nTmp = static_cast<sal_Int32>(aTwo.Hours) - static_cast<sal_Int32>(aOne.Hours);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Minutes - (sal_Int32) aOne.Minutes;
+ nTmp = static_cast<sal_Int32>(aTwo.Minutes) - static_cast<sal_Int32>(aOne.Minutes);
if ( !nTmp ) {
- nTmp = (sal_Int32) aTwo.Seconds - (sal_Int32) aOne.Seconds;
+ nTmp = static_cast<sal_Int32>(aTwo.Seconds) - static_cast<sal_Int32>(aOne.Seconds);
if ( !nTmp )
- nTmp = (sal_Int32) aTwo.NanoSeconds
- - (sal_Int32) aOne.NanoSeconds;
+ nTmp = static_cast<sal_Int32>(aTwo.NanoSeconds)
+ - static_cast<sal_Int32>(aOne.NanoSeconds);
}}}}}
if ( nTmp < 0 )
@@ -1402,7 +1402,7 @@ void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEv
// remove the entries from the lists and correct the positions
// in the original2sorted list
- for ( i=0; i < (sal_uInt32) nCount; i++ )
+ for ( i=0; i < static_cast<sal_uInt32>(nCount); i++ )
{
sal_IntPtr nSortPos = m_O2S[nPos];
m_O2S.erase(m_O2S.begin() + nPos);
@@ -1619,7 +1619,7 @@ void SortedResultSet::ResortModified( EventList* pList )
if ( nNewPos != nCurPos )
{
// correct the lists!
- maS2O.Remove( (sal_uInt32) nCurPos );
+ maS2O.Remove( static_cast<sal_uInt32>(nCurPos) );
maS2O.Insert( pData, nNewPos );
for (size_t j = 1; j < m_O2S.size(); ++j)
{
@@ -1658,13 +1658,13 @@ void SortedResultSet::ResortNew( EventList* pList )
sal_IntPtr i, nNewPos, nVal;
try {
- for ( i = mnLastSort; i<(sal_IntPtr)maS2O.Count(); i++ )
+ for ( i = mnLastSort; i<static_cast<sal_IntPtr>(maS2O.Count()); i++ )
{
SortListData *const pData = m_ModList[i];
nNewPos = FindPos( pData, 1, mnLastSort );
if ( nNewPos != i )
{
- maS2O.Remove( (sal_uInt32) i );
+ maS2O.Remove( static_cast<sal_uInt32>(i) );
maS2O.Insert( pData, nNewPos );
for (size_t j=1; j< m_O2S.size(); ++j)
{
@@ -1709,7 +1709,7 @@ void SortedEntryList::Clear()
void SortedEntryList::Insert( SortListData *pEntry, sal_IntPtr nPos )
{
- if ( nPos < (sal_IntPtr) maData.size() )
+ if ( nPos < static_cast<sal_IntPtr>(maData.size()) )
maData.insert( maData.begin() + nPos, pEntry );
else
maData.push_back( pEntry );
@@ -1720,7 +1720,7 @@ SortListData* SortedEntryList::Remove( sal_IntPtr nPos )
{
SortListData *pData;
- if ( nPos < (sal_IntPtr) maData.size() )
+ if ( nPos < static_cast<sal_IntPtr>(maData.size()) )
{
pData = maData[ nPos ];
maData.erase( maData.begin() + nPos );
@@ -1736,7 +1736,7 @@ SortListData* SortedEntryList::GetData( sal_IntPtr nPos )
{
SortListData *pData;
- if ( nPos < (sal_IntPtr) maData.size() )
+ if ( nPos < static_cast<sal_IntPtr>(maData.size()) )
pData = maData[ nPos ];
else
pData = nullptr;
@@ -1749,7 +1749,7 @@ sal_IntPtr SortedEntryList::operator [] ( sal_IntPtr nPos ) const
{
SortListData *pData;
- if ( nPos < (sal_IntPtr) maData.size() )
+ if ( nPos < static_cast<sal_IntPtr>(maData.size()) )
pData = maData[ nPos ];
else
pData = nullptr;
diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx
index 80b6df0c566a..649a5c957e5d 100644
--- a/ucb/source/sorter/sortresult.hxx
+++ b/ucb/source/sorter/sortresult.hxx
@@ -57,7 +57,7 @@ public:
SortedEntryList(){}
~SortedEntryList(){ Clear(); }
- sal_uInt32 Count() const { return (sal_uInt32) maData.size(); }
+ sal_uInt32 Count() const { return static_cast<sal_uInt32>(maData.size()); }
void Clear();
void Insert( SortListData *pEntry, sal_IntPtr nPos );
@@ -76,7 +76,7 @@ public:
EventList(){}
~EventList(){ Clear(); }
- sal_uInt32 Count() { return (sal_uInt32) maData.size(); }
+ sal_uInt32 Count() { return static_cast<sal_uInt32>(maData.size()); }
void AddEvent( sal_IntPtr nType, sal_IntPtr nPos );
void Insert( css::ucb::ListAction *pAction ) { maData.push_back( pAction ); }
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index bacdb6f6b1b9..997605a79409 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -133,7 +133,7 @@ XInputStream_impl::readBytes(
// if any code relies on this, so be conservative---SB):
if (sal::static_int_cast<sal_Int32>(nrc) != nBytesToRead)
aData.realloc(sal_Int32(nrc));
- return ( sal_Int32 ) nrc;
+ return static_cast<sal_Int32>(nrc);
}
sal_Int32 SAL_CALL
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx
index 40dd928da6b6..69fc4aa28283 100644
--- a/ucb/source/ucp/file/filstr.cxx
+++ b/ucb/source/ucp/file/filstr.cxx
@@ -146,8 +146,8 @@ XStream_impl::readBytes(
{
throw io::IOException( THROW_WHERE );
}
- aData = uno::Sequence< sal_Int8 > ( buffer.get(), (sal_uInt32)nrc );
- return ( sal_Int32 ) nrc;
+ aData = uno::Sequence< sal_Int8 > ( buffer.get(), static_cast<sal_uInt32>(nrc) );
+ return static_cast<sal_Int32>(nrc);
}
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index ca8c7cc954be..ba01d7508f7b 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -695,7 +695,7 @@ void TaskManager::page( sal_Int32 CommandId,
err = aFile.read( static_cast<void*>(BFF),bfz,nrc );
if( err == osl::FileBase::E_None )
{
- uno::Sequence< sal_Int8 > seq( BFF, (sal_uInt32)nrc );
+ uno::Sequence< sal_Int8 > seq( BFF, static_cast<sal_uInt32>(nrc) );
try
{
xOutputStream->writeBytes( seq );
diff --git a/ucb/source/ucp/ftp/ftpdirp.hxx b/ucb/source/ucp/ftp/ftpdirp.hxx
index 31e617bc3567..3284c7357fb4 100644
--- a/ucb/source/ucp/ftp/ftpdirp.hxx
+++ b/ucb/source/ucp/ftp/ftpdirp.hxx
@@ -80,7 +80,7 @@ namespace ftp {
FTPDirentry()
: m_aDate(),
m_nMode(INETCOREFTP_FILEMODE_UNKNOWN),
- m_nSize((sal_uInt32)-1) { }
+ m_nSize(sal_uInt32(-1)) { }
void clear() {
m_aURL.clear();
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index f9ccc0072c49..40bbb9d13568 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -456,7 +456,7 @@ extern "C" int NeonSession_CertificationNotify( void *userdata,
{
rtl::Reference< ucbhelper::SimpleCertificateValidationRequest >
xRequest( new ucbhelper::SimpleCertificateValidationRequest(
- (sal_Int32)certValidity, xEECert, pSession->getHostName() ) );
+ static_cast<sal_Int32>(certValidity), xEECert, pSession->getHostName() ) );
xIH->handle( xRequest.get() );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
@@ -1549,7 +1549,7 @@ void NeonSession::LOCK( const OUString & inPath,
}
// Set the lock timeout
- theLock->timeout = (long)rLock.Timeout;
+ theLock->timeout = static_cast<long>(rLock.Timeout);
// Set the lock owner
OUString aValue;