From e60cea3c8d14c1146ed2855024872fecb0959f66 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 2 Jun 2015 11:27:42 +0200 Subject: loplugin:cstylecast: deal with those that are (technically) const_cast Change-Id: Iad01e628b692a6dcf882696908de0ef1f24c04c4 --- sal/osl/unx/module.cxx | 4 ++-- sal/osl/unx/mutex.cxx | 2 +- sal/osl/unx/process.cxx | 2 +- sal/osl/unx/socket.cxx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sal/osl') diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx index ca3318fad449..65e00570f4a1 100644 --- a/sal/osl/unx/module.cxx +++ b/sal/osl/unx/module.cxx @@ -161,7 +161,7 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR "dlopen(" << pModuleName << ", " << rtld_mode << "): " << dlerror()); #endif - return ((oslModule)(pLib)); + return pLib; } return NULL; } @@ -206,7 +206,7 @@ sal_Bool SAL_CALL osl_getModuleHandle(rtl_uString *, oslModule *pResult) { #if !defined(DISABLE_DYNLOADING) || defined(IOS) - *pResult = (oslModule) RTLD_DEFAULT; + *pResult = static_cast(RTLD_DEFAULT); #else *pResult = NULL; #endif diff --git a/sal/osl/unx/mutex.cxx b/sal/osl/unx/mutex.cxx index 515a2edb9102..bc51fbac498f 100644 --- a/sal/osl/unx/mutex.cxx +++ b/sal/osl/unx/mutex.cxx @@ -163,7 +163,7 @@ static void globalMutexInitImpl() { oslMutex * SAL_CALL osl_getGlobalMutex() { /* necessary to get a "oslMutex *" */ - static oslMutex globalMutex = (oslMutex) &globalMutexImpl; + static oslMutex globalMutex = &globalMutexImpl; static pthread_once_t once = PTHREAD_ONCE_INIT; if (pthread_once(&once, &globalMutexInitImpl) != 0) { diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index af4e59e73429..1198e73eebed 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -240,7 +240,7 @@ static void ChildStatusProc(void *pData) // No need to check the return value of execv. If we return from // it, an error has occurred. - execv(data.m_pszArgs[0], (sal_Char **)data.m_pszArgs); + execv(data.m_pszArgs[0], const_cast(data.m_pszArgs)); } OSL_TRACE("Failed to exec, errno=%d (%s)", errno, strerror(errno)); diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index 6aba809bce4f..2bc7217cd13a 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -460,7 +460,7 @@ oslSocket __osl_createSocketImpl(int Socket) void __osl_destroySocketImpl(oslSocket Socket) { if ( Socket != NULL) - free((struct oslSocketImpl *) Socket); + free(Socket); #if OSL_DEBUG_LEVEL > 1 g_nSocketImpl --; #endif @@ -2353,7 +2353,7 @@ oslSocketSet SAL_CALL osl_createSocketSet() FD_ZERO(&pSet->m_Set); } - return (oslSocketSet)pSet; + return pSet; } void SAL_CALL osl_destroySocketSet(oslSocketSet Set) -- cgit