diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-13 14:57:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-13 21:14:34 +0200 |
commit | acb0cdeedafc5fd38703d4a0a545a33058f1673f (patch) | |
tree | 8700522058d85e7174f42419433b79ba4adc47ba /sal/osl/unx | |
parent | b6491f09e9dc3e41d571abce3c4f16467cb60c9c (diff) |
loplugin:sequentialassign in sal
Change-Id: I7bd1511a6acc105ab5b42c698c7578cfb9ce06b4
Reviewed-on: https://gerrit.libreoffice.org/70708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/unx')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 8 | ||||
-rw-r--r-- | sal/osl/unx/mutex.cxx | 14 | ||||
-rw-r--r-- | sal/osl/unx/profile.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/socket.cxx | 4 |
4 files changed, 8 insertions, 22 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 167877e5d670..31641593e781 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -482,9 +482,7 @@ oslFileError osl_psz_createDirectory(char const * pszPath, sal_uInt32 flags) static oslFileError osl_psz_removeDirectory( const sal_Char* pszPath ) { - int nRet=0; - - nRet = rmdir(pszPath); + int nRet = rmdir(pszPath); if ( nRet < 0 ) { @@ -724,9 +722,7 @@ static oslFileError osl_unlinkFile(const sal_Char* pszPath) static oslFileError osl_psz_moveFile(const sal_Char* pszPath, const sal_Char* pszDestPath) { - int nRet = 0; - - nRet = rename(pszPath,pszDestPath); + int nRet = rename(pszPath,pszDestPath); if (nRet < 0) { diff --git a/sal/osl/unx/mutex.cxx b/sal/osl/unx/mutex.cxx index 3f7fda0c7099..72bcc370eebb 100644 --- a/sal/osl/unx/mutex.cxx +++ b/sal/osl/unx/mutex.cxx @@ -75,9 +75,7 @@ void SAL_CALL osl_destroyMutex(oslMutex pMutex) if ( pMutex != nullptr ) { - int nRet=0; - - nRet = pthread_mutex_destroy(&(pMutex->mutex)); + int nRet = pthread_mutex_destroy(&(pMutex->mutex)); if ( nRet != 0 ) { SAL_WARN("sal.osl.mutex", "pthread_mutex_destroy failed: " << UnixErrnoString(nRet)); @@ -93,9 +91,7 @@ sal_Bool SAL_CALL osl_acquireMutex(oslMutex pMutex) if ( pMutex != nullptr ) { - int nRet=0; - - nRet = pthread_mutex_lock(&(pMutex->mutex)); + int nRet = pthread_mutex_lock(&(pMutex->mutex)); if ( nRet != 0 ) { SAL_WARN("sal.osl.mutex", "pthread_mutex_lock failed: " << UnixErrnoString(nRet)); @@ -116,8 +112,7 @@ sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutex pMutex) if ( pMutex ) { - int nRet = 0; - nRet = pthread_mutex_trylock(&(pMutex->mutex)); + int nRet = pthread_mutex_trylock(&(pMutex->mutex)); if ( nRet == 0 ) result = true; } @@ -131,8 +126,7 @@ sal_Bool SAL_CALL osl_releaseMutex(oslMutex pMutex) if ( pMutex ) { - int nRet=0; - nRet = pthread_mutex_unlock(&(pMutex->mutex)); + int nRet = pthread_mutex_unlock(&(pMutex->mutex)); if ( nRet != 0 ) { SAL_WARN("sal.osl.mutex", "pthread_mutex_unlock failed: " << UnixErrnoString(nRet)); diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index e06ff82aef32..44e7243c4b13 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -491,9 +491,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile, sal_Char* Line = nullptr; osl_TProfileSection* pSec; osl_TProfileImpl* pProfile = nullptr; - osl_TProfileImpl* pTmpProfile = nullptr; - - pTmpProfile = static_cast<osl_TProfileImpl*>(Profile); + osl_TProfileImpl* pTmpProfile = static_cast<osl_TProfileImpl*>(Profile); if ( pTmpProfile == nullptr ) { diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index 1dd62e330029..0984acb86aae 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -832,9 +832,7 @@ void SAL_CALL osl_getHostnameOfHostAddr ( const oslHostAddr Addr, rtl_uString **ustrHostname) { - const sal_Char* pHostname=nullptr; - - pHostname = osl_psz_getHostnameOfHostAddr(Addr); + const sal_Char* pHostname = osl_psz_getHostnameOfHostAddr(Addr); rtl_uString_newFromAscii (ustrHostname, pHostname); } |