diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-07-02 22:31:03 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-07-02 22:31:03 +0200 |
commit | e303d4b93cbe7ba9b96c9d274b83e88632f73073 (patch) | |
tree | b99c4d7d0e0282ee1c5be47c79d0198491208b1e /sal | |
parent | 592ab6435b22f7d1a0d9d940ccc32059fed05b87 (diff) |
loplugin:casttovoid: sal
Change-Id: I70cf54799f08e3bc586d42d6c634eb02a049ea0f
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/all/loadmodulerelative.cxx | 1 | ||||
-rw-r--r-- | sal/osl/unx/file.cxx | 3 | ||||
-rw-r--r-- | sal/osl/unx/pipe.cxx | 3 | ||||
-rw-r--r-- | sal/osl/unx/profile.cxx | 6 | ||||
-rw-r--r-- | sal/osl/unx/security.cxx | 78 | ||||
-rw-r--r-- | sal/qa/osl/file/osl_File.cxx | 3 | ||||
-rw-r--r-- | sal/rtl/bootstrap.cxx | 1 |
7 files changed, 13 insertions, 82 deletions
diff --git a/sal/osl/all/loadmodulerelative.cxx b/sal/osl/all/loadmodulerelative.cxx index bc599c59d775..e99669696bcc 100644 --- a/sal/osl/all/loadmodulerelative.cxx +++ b/sal/osl/all/loadmodulerelative.cxx @@ -47,7 +47,6 @@ oslModule SAL_CALL osl_loadModuleRelative( try { abs = rtl::Uri::convertRelToAbs(base, relativePath); } catch (const rtl::MalformedUriException & e) { - (void) e; // avoid warnings SAL_INFO("sal.osl", "rtl::MalformedUriException <" << e.getMessage() << ">"); return nullptr; } diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 0452f2dfac7f..7225b9326b6b 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -818,8 +818,9 @@ static bool osl_file_queryLocking(sal_uInt32 uFlags) // getenv is not thread safe, so minimize use of result return enabled; } -#endif +#else (void) uFlags; +#endif return false; } diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index 40c93e0c7add..5909c34001db 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -497,9 +497,8 @@ sal_Int32 SAL_CALL osl_sendPipe(oslPipe pPipe, return nRet; } -oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe) +oslPipeError SAL_CALL osl_getLastPipeError(SAL_UNUSED_PARAMETER oslPipe) { - (void) pPipe; /* unused */ return osl_PipeErrorFromNative(errno); } diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 200bb5d2f578..1ff9ed0a1865 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -214,7 +214,6 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) { bool bRet = storeProfile(pTmpProfile, true); SAL_WARN_IF(!bRet, "sal.osl", "storeProfile(pTmpProfile, true) ==> false"); - (void)bRet; } } else @@ -413,7 +412,6 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile, bRet=releaseProfile(pProfile); SAL_WARN_IF(!bRet, "sal.osl", "releaseProfile(pProfile) ==> false"); - (void)bRet; if ( pStr == nullptr ) { @@ -783,7 +781,6 @@ sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, bRet=releaseProfile(pProfile); SAL_WARN_IF(!bRet, "sal.osl", "releaseProfile(pProfile) ==> false"); - (void)bRet; pthread_mutex_unlock(&(pTmpProfile->m_AccessLock)); @@ -859,7 +856,6 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile, bRet=releaseProfile(pProfile); SAL_WARN_IF(!bRet, "sal.osl", "releaseProfile(pProfile) ==> false"); - (void)bRet; pthread_mutex_unlock(&(pTmpProfile->m_AccessLock)); @@ -1797,7 +1793,6 @@ static osl_TProfileImpl* acquireProfile(oslProfile Profile, bool bWriteable) pProfile->m_Stamp = Stamp; bool bRet = loadProfile(pProfile->m_pFile, pProfile); SAL_WARN_IF(!bRet, "sal.osl", "loadProfile(pProfile->m_pFile, pProfile) ==> false"); - (void)bRet; } } else @@ -1832,7 +1827,6 @@ static bool releaseProfile(osl_TProfileImpl* pProfile) { bool bRet = storeProfile(pProfile, false); SAL_WARN_IF(!bRet, "sal.osl", "storeProfile(pProfile, false) ==> false"); - (void)bRet; } closeFileImpl(pProfile->m_pFile,pProfile->m_Flags); diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx index 792ea8166c9c..d1d39c389b41 100644 --- a/sal/osl/unx/security.cxx +++ b/sal/osl/unx/security.cxx @@ -47,9 +47,6 @@ #define getpwuid_r(uid, pwd, buf, buflen, result) (*(result) = getpwuid(uid), (*(result) ? (memcpy (buf, *(result), sizeof (struct passwd)), 0) : errno)) #endif -static oslSecurityError SAL_CALL -osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd, - oslSecurity* pSecurity); static bool SAL_CALL osl_psz_getUserName(oslSecurity Security, sal_Char* pszName, sal_uInt32 nMax); static bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax); static bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax); @@ -139,74 +136,21 @@ oslSecurity SAL_CALL osl_getCurrentSecurity() } oslSecurityError SAL_CALL osl_loginUser( - rtl_uString *ustrUserName, - rtl_uString *ustrPassword, - oslSecurity *pSecurity + SAL_UNUSED_PARAMETER rtl_uString *, + SAL_UNUSED_PARAMETER rtl_uString *, + SAL_UNUSED_PARAMETER oslSecurity * ) { - oslSecurityError Error; - rtl_String* strUserName=nullptr; - rtl_String* strPassword=nullptr; - sal_Char* pszUserName=nullptr; - sal_Char* pszPassword=nullptr; - - if ( ustrUserName != nullptr ) - { - rtl_uString2String( &strUserName, - rtl_uString_getStr(ustrUserName), - rtl_uString_getLength(ustrUserName), - RTL_TEXTENCODING_UTF8, - OUSTRING_TO_OSTRING_CVTFLAGS ); - pszUserName = rtl_string_getStr(strUserName); - } - - if ( ustrPassword != nullptr ) - { - rtl_uString2String( &strPassword, - rtl_uString_getStr(ustrPassword), - rtl_uString_getLength(ustrPassword), - RTL_TEXTENCODING_UTF8, - OUSTRING_TO_OSTRING_CVTFLAGS ); - pszPassword = rtl_string_getStr(strPassword); - } - - Error=osl_psz_loginUser(pszUserName,pszPassword,pSecurity); - - if ( strUserName != nullptr ) - { - rtl_string_release(strUserName); - } - - if ( strPassword) - { - rtl_string_release(strPassword); - } - - return Error; -} - -static oslSecurityError SAL_CALL -osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd, - oslSecurity* pSecurity) -{ - (void)pszUserName; - (void)pszPasswd; - (void)pSecurity; - return osl_Security_E_None; } oslSecurityError SAL_CALL osl_loginUserOnFileServer( - rtl_uString *strUserName, - rtl_uString *strPasswd, - rtl_uString *strFileServer, - oslSecurity *pSecurity + SAL_UNUSED_PARAMETER rtl_uString *, + SAL_UNUSED_PARAMETER rtl_uString *, + SAL_UNUSED_PARAMETER rtl_uString *, + SAL_UNUSED_PARAMETER oslSecurity * ) { - (void) strUserName; /* unused */ - (void) strPasswd; /* unused */ - (void) strFileServer; /* unused */ - (void) pSecurity; /* unused */ return osl_Security_E_UserUnknown; } @@ -514,15 +458,11 @@ void SAL_CALL osl_freeSecurityHandle(oslSecurity Security) deleteSecurityImpl(static_cast<oslSecurityImpl *>(Security)); } -sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security) +sal_Bool SAL_CALL osl_loadUserProfile(SAL_UNUSED_PARAMETER oslSecurity) { - (void) Security; /* unused */ return false; } -void SAL_CALL osl_unloadUserProfile(oslSecurity Security) -{ - (void) Security; /* unused */ -} +void SAL_CALL osl_unloadUserProfile(SAL_UNUSED_PARAMETER oslSecurity) {} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index a38bc3642c16..68df587690da 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -3143,8 +3143,7 @@ namespace osl_File { createTestFile(aTmpName6); File tmpFile(aTmpName6); - osl::FileBase::RC err = tmpFile.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Read); - (void)err; + tmpFile.open(osl_File_OpenFlag_Write | osl_File_OpenFlag_Read); tmpFile.setSize(200); tmpFile.close(); // copy to new path diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 4a5fabfb6836..c3d2be34e322 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -644,7 +644,6 @@ rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open ( ::std::pair< bootstrap_map::t::iterator, bool > insertion( p_bootstrap_map->insert( bootstrap_map::t::value_type( iniName, that ) ) ); - (void) insertion; // WaE: unused variable OSL_ASSERT( insertion.second ); } else |