diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-08 16:27:22 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-08 16:27:22 +0200 |
commit | 30b089fe491b391931470e960b4af2ccaca9408a (patch) | |
tree | 268669b4faa689c048abe489ac4581c846ebe80c /sal/rtl | |
parent | e56bec5ccd7bdd91e0389381dc4e2f1e48f2c32d (diff) |
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: Ibd373cddb1e25f05528e627349953b5f7d115330
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/alloc_cache.cxx | 4 | ||||
-rw-r--r-- | sal/rtl/cipher.cxx | 14 | ||||
-rw-r--r-- | sal/rtl/digest.cxx | 26 | ||||
-rw-r--r-- | sal/rtl/random.cxx | 6 |
4 files changed, 25 insertions, 25 deletions
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index 50e2961912a4..8a80e70fba1b 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -1338,7 +1338,7 @@ rtl_cache_wsupdate_init() &(g_cache_list.m_update_thread), NULL, rtl_cache_wsupdate_all, reinterpret_cast<void*>(10)) != 0) { /* failure */ - g_cache_list.m_update_thread = (pthread_t)(0); + g_cache_list.m_update_thread = pthread_t(); } RTL_MEMORY_LOCK_RELEASE(&(g_cache_list.m_lock)); } @@ -1370,7 +1370,7 @@ rtl_cache_wsupdate_fini() pthread_cond_signal (&(g_cache_list.m_update_cond)); RTL_MEMORY_LOCK_RELEASE(&(g_cache_list.m_lock)); - if (g_cache_list.m_update_thread != (pthread_t)(0)) + if (g_cache_list.m_update_thread != pthread_t()) pthread_join (g_cache_list.m_update_thread, NULL); } diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx index 50de1a9ad822..c5bd0f24d834 100644 --- a/sal/rtl/cipher.cxx +++ b/sal/rtl/cipher.cxx @@ -112,7 +112,7 @@ rtlCipher SAL_CALL rtl_cipher_create ( rtlCipherAlgorithm Algorithm, rtlCipherMode Mode) SAL_THROW_EXTERN_C() { - rtlCipher Cipher = (rtlCipher)NULL; + rtlCipher Cipher = nullptr; switch (Algorithm) { case rtl_Cipher_AlgorithmBF: @@ -1005,10 +1005,10 @@ static sal_uInt32 __rtl_cipherBF (CipherKeyBF *key, sal_uInt32 x) */ rtlCipher SAL_CALL rtl_cipher_createBF (rtlCipherMode Mode) SAL_THROW_EXTERN_C() { - CipherBF_Impl *pImpl = (CipherBF_Impl*)NULL; + CipherBF_Impl *pImpl = nullptr; if (Mode == rtl_Cipher_ModeInvalid) - return ((rtlCipher)NULL); + return (nullptr); pImpl = static_cast<CipherBF_Impl*>(rtl_allocateZeroMemory (sizeof (CipherBF_Impl))); if (pImpl) @@ -1022,7 +1022,7 @@ rtlCipher SAL_CALL rtl_cipher_createBF (rtlCipherMode Mode) SAL_THROW_EXTERN_C() pImpl->m_cipher.m_decode = rtl_cipher_decodeBF; pImpl->m_cipher.m_delete = rtl_cipher_destroyBF; } - return ((rtlCipher)pImpl); + return (static_cast<rtlCipher>(pImpl)); } /* @@ -1241,10 +1241,10 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( rtlCipher SAL_CALL rtl_cipher_createARCFOUR (rtlCipherMode Mode) SAL_THROW_EXTERN_C() { - CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)NULL; + CipherARCFOUR_Impl *pImpl = nullptr; if (!(Mode == rtl_Cipher_ModeStream)) - return ((rtlCipher)NULL); + return (nullptr); pImpl = static_cast<CipherARCFOUR_Impl*>(rtl_allocateZeroMemory (sizeof (CipherARCFOUR_Impl))); if (pImpl) @@ -1258,7 +1258,7 @@ rtlCipher SAL_CALL rtl_cipher_createARCFOUR (rtlCipherMode Mode) pImpl->m_cipher.m_decode = rtl_cipher_decodeARCFOUR; pImpl->m_cipher.m_delete = rtl_cipher_destroyARCFOUR; } - return ((rtlCipher)pImpl); + return (static_cast<rtlCipher>(pImpl)); } /* diff --git a/sal/rtl/digest.cxx b/sal/rtl/digest.cxx index d8f4c7119142..b997dcfc9357 100644 --- a/sal/rtl/digest.cxx +++ b/sal/rtl/digest.cxx @@ -93,7 +93,7 @@ static void __rtl_digest_swapLong (sal_uInt32 *pData, sal_uInt32 nDatLen) rtlDigest SAL_CALL rtl_digest_create (rtlDigestAlgorithm Algorithm) SAL_THROW_EXTERN_C() { - rtlDigest Digest = (rtlDigest)NULL; + rtlDigest Digest = nullptr; switch (Algorithm) { case rtl_Digest_AlgorithmMD2: @@ -390,14 +390,14 @@ rtlDigestError SAL_CALL rtl_digest_MD2 ( */ rtlDigest SAL_CALL rtl_digest_createMD2() SAL_THROW_EXTERN_C() { - DigestMD2_Impl *pImpl = (DigestMD2_Impl*)NULL; + DigestMD2_Impl *pImpl = nullptr; pImpl = RTL_DIGEST_CREATE(DigestMD2_Impl); if (pImpl) { pImpl->m_digest = __rtl_digest_MD2; __rtl_digest_initMD2 (&(pImpl->m_context)); } - return (rtlDigest)pImpl; + return static_cast<rtlDigest>(pImpl); } /* @@ -761,14 +761,14 @@ rtlDigestError SAL_CALL rtl_digest_MD5 ( */ rtlDigest SAL_CALL rtl_digest_createMD5() SAL_THROW_EXTERN_C() { - DigestMD5_Impl *pImpl = (DigestMD5_Impl*)NULL; + DigestMD5_Impl *pImpl = nullptr; pImpl = RTL_DIGEST_CREATE(DigestMD5_Impl); if (pImpl) { pImpl->m_digest = __rtl_digest_MD5; __rtl_digest_initMD5 (&(pImpl->m_context)); } - return (rtlDigest)pImpl; + return static_cast<rtlDigest>(pImpl); } /* @@ -1245,14 +1245,14 @@ rtlDigestError SAL_CALL rtl_digest_SHA ( */ rtlDigest SAL_CALL rtl_digest_createSHA() SAL_THROW_EXTERN_C() { - DigestSHA_Impl *pImpl = (DigestSHA_Impl*)NULL; + DigestSHA_Impl *pImpl = nullptr; pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl); if (pImpl) { pImpl->m_digest = __rtl_digest_SHA_0; __rtl_digest_initSHA (&(pImpl->m_context), __rtl_digest_updateSHA_0); } - return (rtlDigest)pImpl; + return static_cast<rtlDigest>(pImpl); } /* @@ -1435,14 +1435,14 @@ rtlDigestError SAL_CALL rtl_digest_SHA1 ( */ rtlDigest SAL_CALL rtl_digest_createSHA1() SAL_THROW_EXTERN_C() { - DigestSHA_Impl *pImpl = (DigestSHA_Impl*)NULL; + DigestSHA_Impl *pImpl = nullptr; pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl); if (pImpl) { pImpl->m_digest = __rtl_digest_SHA_1; __rtl_digest_initSHA (&(pImpl->m_context), __rtl_digest_updateSHA_1); } - return (rtlDigest)pImpl; + return static_cast<rtlDigest>(pImpl); } /* @@ -1678,14 +1678,14 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_MD5 ( */ rtlDigest SAL_CALL rtl_digest_createHMAC_MD5() SAL_THROW_EXTERN_C() { - DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)NULL; + DigestHMAC_MD5_Impl *pImpl = nullptr; pImpl = RTL_DIGEST_CREATE(DigestHMAC_MD5_Impl); if (pImpl) { pImpl->m_digest = __rtl_digest_HMAC_MD5; __rtl_digest_initHMAC_MD5 (&(pImpl->m_context)); } - return (rtlDigest)pImpl; + return static_cast<rtlDigest>(pImpl); } /* @@ -1910,14 +1910,14 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1 ( */ rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1() SAL_THROW_EXTERN_C() { - DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)NULL; + DigestHMAC_SHA1_Impl *pImpl = nullptr; pImpl = RTL_DIGEST_CREATE(DigestHMAC_SHA1_Impl); if (pImpl) { pImpl->m_digest = __rtl_digest_HMAC_SHA1; __rtl_digest_initHMAC_SHA1 (&(pImpl->m_context)); } - return (rtlDigest)pImpl; + return static_cast<rtlDigest>(pImpl); } /* diff --git a/sal/rtl/random.cxx b/sal/rtl/random.cxx index 0a5638f57423..1f6d2b42d4cd 100644 --- a/sal/rtl/random.cxx +++ b/sal/rtl/random.cxx @@ -268,17 +268,17 @@ static void __rtl_random_readPool ( */ rtlRandomPool SAL_CALL rtl_random_createPool() SAL_THROW_EXTERN_C() { - RandomPool_Impl *pImpl = (RandomPool_Impl*)NULL; + RandomPool_Impl *pImpl = nullptr; pImpl = static_cast<RandomPool_Impl*>(rtl_allocateZeroMemory (sizeof(RandomPool_Impl))); if (pImpl) { if (!__rtl_random_initPool (pImpl)) { rtl_freeZeroMemory (pImpl, sizeof(RandomPool_Impl)); - pImpl = (RandomPool_Impl*)NULL; + pImpl = nullptr; } } - return (rtlRandomPool)pImpl; + return static_cast<rtlRandomPool>(pImpl); } /* |