diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-10-31 18:57:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-11-01 17:10:14 +0100 |
commit | 76af7256e04ac5a24205f76663fc20aa810a9c3d (patch) | |
tree | dc230856a6c4b630467cfb70d146b2ea5aafe2e3 /sal/rtl | |
parent | f67c6fa040346dcf211699d0c31676909fae4b95 (diff) |
Moved various sal/rtl/source files from C to C++, for easier maintenance.
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/source/alloc_fini.cxx | 19 | ||||
-rw-r--r-- | sal/rtl/source/byteseq.cxx (renamed from sal/rtl/source/byteseq.c) | 13 | ||||
-rw-r--r-- | sal/rtl/source/cipher.cxx (renamed from sal/rtl/source/cipher.c) | 55 | ||||
-rw-r--r-- | sal/rtl/source/cmdargs.cxx | 2 | ||||
-rw-r--r-- | sal/rtl/source/crc.cxx (renamed from sal/rtl/source/crc.c) | 2 | ||||
-rw-r--r-- | sal/rtl/source/digest.cxx (renamed from sal/rtl/source/digest.c) | 104 | ||||
-rw-r--r-- | sal/rtl/source/locale.cxx (renamed from sal/rtl/source/locale.c) | 29 | ||||
-rw-r--r-- | sal/rtl/source/memory.cxx (renamed from sal/rtl/source/memory.c) | 2 | ||||
-rw-r--r-- | sal/rtl/source/random.cxx (renamed from sal/rtl/source/random.c) | 16 | ||||
-rw-r--r-- | sal/rtl/source/uuid.cxx | 4 |
10 files changed, 137 insertions, 109 deletions
diff --git a/sal/rtl/source/alloc_fini.cxx b/sal/rtl/source/alloc_fini.cxx index 1c1d30af43d1..c19e8dcb47ef 100644 --- a/sal/rtl/source/alloc_fini.cxx +++ b/sal/rtl/source/alloc_fini.cxx @@ -28,8 +28,10 @@ #include <rtl/instance.hxx> -extern "C" void rtl_memory_fini (void); -extern "C" void rtl_memory_init (void); +#include "internal/rtl_locale_init.h" + +extern "C" void rtl_memory_fini(); +extern "C" void rtl_memory_init(); namespace { struct rtlMemorySingleton @@ -51,8 +53,8 @@ extern "C" void ensureMemorySingleton() theMemorySingleton::get(); } -extern "C" void rtl_cache_fini (void); -extern "C" void rtl_cache_init (void); +extern "C" void rtl_cache_fini(); +extern "C" void rtl_cache_init(); namespace { struct rtlCacheSingleton @@ -74,8 +76,8 @@ extern "C" void ensureCacheSingleton() theCacheSingleton::get(); } -extern "C" void rtl_arena_fini (void); -extern "C" void rtl_arena_init (void); +extern "C" void rtl_arena_fini(); +extern "C" void rtl_arena_init(); namespace { struct rtlArenaSingleton @@ -97,8 +99,6 @@ extern "C" void ensureArenaSingleton() theArenaSingleton::get(); } -extern "C" void rtl_locale_fini (void); -extern "C" void rtl_locale_init (void); namespace { struct rtlLocaleSingleton @@ -115,7 +115,8 @@ namespace class theLocaleSingleton : public rtl::Static<rtlLocaleSingleton, theLocaleSingleton>{}; } -extern "C" void ensureLocaleSingleton() + +void ensureLocaleSingleton() { theLocaleSingleton::get(); } diff --git a/sal/rtl/source/byteseq.c b/sal/rtl/source/byteseq.cxx index 52c81d8df375..76423f78f1f9 100644 --- a/sal/rtl/source/byteseq.c +++ b/sal/rtl/source/byteseq.cxx @@ -45,7 +45,7 @@ static sal_Sequence aEmpty_rtl_ByteSeq = //================================================================================================== void SAL_CALL rtl_byte_sequence_reference2One( - sal_Sequence ** ppSequence ) + sal_Sequence ** ppSequence ) SAL_THROW_EXTERN_C() { sal_Sequence * pSequence, * pNew; sal_Int32 nElements; @@ -83,7 +83,7 @@ void SAL_CALL rtl_byte_sequence_reference2One( //================================================================================================== void SAL_CALL rtl_byte_sequence_realloc( - sal_Sequence ** ppSequence, sal_Int32 nSize ) + sal_Sequence ** ppSequence, sal_Int32 nSize ) SAL_THROW_EXTERN_C() { sal_Sequence * pSequence, * pNew; sal_Int32 nElements; @@ -133,6 +133,7 @@ void SAL_CALL rtl_byte_sequence_realloc( //================================================================================================== void SAL_CALL rtl_byte_sequence_acquire( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( pSequence ); osl_incrementInterlockedCount( &(pSequence->nRefCount) ); @@ -140,6 +141,7 @@ void SAL_CALL rtl_byte_sequence_acquire( sal_Sequence *pSequence ) //================================================================================================== void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { if ( pSequence != 0 ) { @@ -152,6 +154,7 @@ void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence ) //================================================================================================== void SAL_CALL rtl_byte_sequence_construct( sal_Sequence **ppSequence , sal_Int32 nLength ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( ppSequence ); if( *ppSequence ) @@ -179,6 +182,7 @@ void SAL_CALL rtl_byte_sequence_construct( sal_Sequence **ppSequence , sal_Int32 //================================================================================================== void SAL_CALL rtl_byte_sequence_constructNoDefault( sal_Sequence **ppSequence , sal_Int32 nLength ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( ppSequence ); if( *ppSequence ) @@ -199,6 +203,7 @@ void SAL_CALL rtl_byte_sequence_constructNoDefault( sal_Sequence **ppSequence , //================================================================================================== void SAL_CALL rtl_byte_sequence_constructFromArray( sal_Sequence **ppSequence, const sal_Int8 *pData , sal_Int32 nLength ) + SAL_THROW_EXTERN_C() { rtl_byte_sequence_constructNoDefault( ppSequence , nLength ); if ( *ppSequence != 0 ) @@ -207,6 +212,7 @@ void SAL_CALL rtl_byte_sequence_constructFromArray( //================================================================================================== void SAL_CALL rtl_byte_sequence_assign( sal_Sequence **ppSequence , sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { if ( *ppSequence != pSequence) { @@ -224,6 +230,7 @@ void SAL_CALL rtl_byte_sequence_assign( sal_Sequence **ppSequence , sal_Sequence //================================================================================================== sal_Bool SAL_CALL rtl_byte_sequence_equals( sal_Sequence *pSequence1 , sal_Sequence *pSequence2 ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( pSequence1 ); OSL_ASSERT( pSequence2 ); @@ -244,12 +251,14 @@ sal_Bool SAL_CALL rtl_byte_sequence_equals( sal_Sequence *pSequence1 , sal_Seque //================================================================================================== const sal_Int8 *SAL_CALL rtl_byte_sequence_getConstArray( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { return ((const sal_Int8*)(pSequence->elements)); } //================================================================================================== sal_Int32 SAL_CALL rtl_byte_sequence_getLength( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { return pSequence->nElements; } diff --git a/sal/rtl/source/cipher.c b/sal/rtl/source/cipher.cxx index e6ede4274af6..19647ab3186d 100644 --- a/sal/rtl/source/cipher.c +++ b/sal/rtl/source/cipher.cxx @@ -98,7 +98,7 @@ typedef void (SAL_CALL cipher_delete_t) (rtlCipher Cipher); /** Cipher_Impl. */ -typedef struct cipher_impl_st +struct Cipher_Impl { rtlCipherAlgorithm m_algorithm; rtlCipherDirection m_direction; @@ -108,7 +108,7 @@ typedef struct cipher_impl_st cipher_update_t *m_encode; cipher_update_t *m_decode; cipher_delete_t *m_delete; -} Cipher_Impl; +}; /*======================================================================== * @@ -120,7 +120,7 @@ typedef struct cipher_impl_st */ rtlCipher SAL_CALL rtl_cipher_create ( rtlCipherAlgorithm Algorithm, - rtlCipherMode Mode) + rtlCipherMode Mode) SAL_THROW_EXTERN_C() { rtlCipher Cipher = (rtlCipher)NULL; switch (Algorithm) @@ -146,7 +146,7 @@ rtlCipherError SAL_CALL rtl_cipher_init ( rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, - const sal_uInt8 *pArgData, sal_Size nArgLen) + const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl == NULL) @@ -164,7 +164,7 @@ rtlCipherError SAL_CALL rtl_cipher_init ( rtlCipherError SAL_CALL rtl_cipher_encode ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl == NULL) @@ -181,7 +181,7 @@ rtlCipherError SAL_CALL rtl_cipher_encode ( rtlCipherError SAL_CALL rtl_cipher_decode ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl == NULL) @@ -195,7 +195,7 @@ rtlCipherError SAL_CALL rtl_cipher_decode ( /* * rtl_cipher_destroy. */ -void SAL_CALL rtl_cipher_destroy (rtlCipher Cipher) +void SAL_CALL rtl_cipher_destroy (rtlCipher Cipher) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl && pImpl->m_delete) @@ -209,13 +209,13 @@ void SAL_CALL rtl_cipher_destroy (rtlCipher Cipher) *======================================================================*/ #define CIPHER_ROUNDS_BF 16 -typedef struct cipherBF_key_st +struct CipherKeyBF { sal_uInt32 m_S[4][256]; sal_uInt32 m_P[CIPHER_ROUNDS_BF + 2]; -} CipherKeyBF; +}; -typedef struct cipherBF_context_st +struct CipherContextBF { CipherKeyBF m_key; union @@ -224,13 +224,13 @@ typedef struct cipherBF_context_st sal_uInt8 m_byte[8]; } m_iv; sal_uInt32 m_offset; -} CipherContextBF; +}; -typedef struct cipherBF_impl_st +struct CipherBF_Impl { Cipher_Impl m_cipher; CipherContextBF m_context; -} CipherBF_Impl; +}; /** __rtl_cipherBF_init. */ @@ -1017,7 +1017,7 @@ static sal_uInt32 __rtl_cipherBF (CipherKeyBF *key, sal_uInt32 x) /* * rtl_cipher_createBF. */ -rtlCipher SAL_CALL rtl_cipher_createBF (rtlCipherMode Mode) +rtlCipher SAL_CALL rtl_cipher_createBF (rtlCipherMode Mode) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)NULL; @@ -1046,7 +1046,7 @@ rtlCipherError SAL_CALL rtl_cipher_initBF ( rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, - const sal_uInt8 *pArgData, sal_Size nArgLen) + const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; @@ -1072,7 +1072,7 @@ rtlCipherError SAL_CALL rtl_cipher_initBF ( rtlCipherError SAL_CALL rtl_cipher_encodeBF ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; if (pImpl == NULL) @@ -1098,7 +1098,7 @@ rtlCipherError SAL_CALL rtl_cipher_encodeBF ( rtlCipherError SAL_CALL rtl_cipher_decodeBF ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; if (pImpl == NULL) @@ -1121,7 +1121,7 @@ rtlCipherError SAL_CALL rtl_cipher_decodeBF ( /* * rtl_cipher_destroyBF. */ -void SAL_CALL rtl_cipher_destroyBF (rtlCipher Cipher) +void SAL_CALL rtl_cipher_destroyBF (rtlCipher Cipher) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; if (pImpl) @@ -1140,17 +1140,17 @@ void SAL_CALL rtl_cipher_destroyBF (rtlCipher Cipher) *======================================================================*/ #define CIPHER_CBLOCK_ARCFOUR 256 -typedef struct cipherARCFOUR_context_st +struct ContextARCFOUR_Impl { unsigned int m_S[CIPHER_CBLOCK_ARCFOUR]; unsigned int m_X, m_Y; -} ContextARCFOUR_Impl; +}; -typedef struct cipherARCFOUR_impl_st +struct CipherARCFOUR_Impl { Cipher_Impl m_cipher; ContextARCFOUR_Impl m_context; -} CipherARCFOUR_Impl; +}; /** rtl_cipherARCFOUR_update_Impl. */ @@ -1253,6 +1253,7 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( * rtl_cipher_createARCFOUR. */ rtlCipher SAL_CALL rtl_cipher_createARCFOUR (rtlCipherMode Mode) + SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)NULL; @@ -1281,11 +1282,9 @@ rtlCipherError SAL_CALL rtl_cipher_initARCFOUR ( rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, - const sal_uInt8 *pArgData, sal_Size nArgLen) + const sal_uInt8 *, sal_Size) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; - (void) pArgData; // avoid warning - (void) nArgLen; // avoid warning if ((pImpl == NULL) || (pKeyData == NULL)) return rtl_Cipher_E_Argument; @@ -1307,7 +1306,7 @@ rtlCipherError SAL_CALL rtl_cipher_initARCFOUR ( rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; if (pImpl == NULL) @@ -1330,7 +1329,7 @@ rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR ( rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; if (pImpl == NULL) @@ -1350,7 +1349,7 @@ rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR ( /* * rtl_cipher_destroyARCFOUR. */ -void SAL_CALL rtl_cipher_destroyARCFOUR (rtlCipher Cipher) +void SAL_CALL rtl_cipher_destroyARCFOUR (rtlCipher Cipher) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; if (pImpl) diff --git a/sal/rtl/source/cmdargs.cxx b/sal/rtl/source/cmdargs.cxx index ed44843b11cc..475e5fb76236 100644 --- a/sal/rtl/source/cmdargs.cxx +++ b/sal/rtl/source/cmdargs.cxx @@ -103,7 +103,7 @@ oslProcessError SAL_CALL rtl_getAppCommandArg ( return (result); } -sal_uInt32 SAL_CALL rtl_getAppCommandArgCount (void) +sal_uInt32 SAL_CALL rtl_getAppCommandArgCount() { init(); return g_nCommandArgCount; diff --git a/sal/rtl/source/crc.c b/sal/rtl/source/crc.cxx index fa372aaf4339..bd61347edc24 100644 --- a/sal/rtl/source/crc.c +++ b/sal/rtl/source/crc.cxx @@ -148,7 +148,7 @@ static const sal_uInt32 rtl_crc32Table[256] = */ sal_uInt32 SAL_CALL rtl_crc32 ( sal_uInt32 Crc, - const void *Data, sal_uInt32 DatLen) + const void *Data, sal_uInt32 DatLen) SAL_THROW_EXTERN_C() { if (Data) { diff --git a/sal/rtl/source/digest.c b/sal/rtl/source/digest.cxx index 92736cf4dd95..28655858d425 100644 --- a/sal/rtl/source/digest.c +++ b/sal/rtl/source/digest.cxx @@ -67,7 +67,7 @@ typedef rtlDigestError (SAL_CALL Digest_update_t) ( typedef rtlDigestError (SAL_CALL Digest_get_t) ( void *ctx, sal_uInt8 *Buffer, sal_uInt32 BufLen); -typedef struct digest_impl_st +struct Digest_Impl { rtlDigestAlgorithm m_algorithm; sal_uInt32 m_length; @@ -76,7 +76,7 @@ typedef struct digest_impl_st Digest_delete_t *m_delete; Digest_update_t *m_update; Digest_get_t *m_get; -} Digest_Impl; +}; /* * __rtl_digest_swapLong. @@ -102,6 +102,7 @@ static void __rtl_digest_swapLong (sal_uInt32 *pData, sal_uInt32 nDatLen) * rtl_digest_create. */ rtlDigest SAL_CALL rtl_digest_create (rtlDigestAlgorithm Algorithm) + SAL_THROW_EXTERN_C() { rtlDigest Digest = (rtlDigest)NULL; switch (Algorithm) @@ -140,6 +141,7 @@ rtlDigest SAL_CALL rtl_digest_create (rtlDigestAlgorithm Algorithm) * rtl_digest_queryAlgorithm. */ rtlDigestAlgorithm SAL_CALL rtl_digest_queryAlgorithm (rtlDigest Digest) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl) @@ -152,6 +154,7 @@ rtlDigestAlgorithm SAL_CALL rtl_digest_queryAlgorithm (rtlDigest Digest) * rtl_digest_queryLength. */ sal_uInt32 SAL_CALL rtl_digest_queryLength (rtlDigest Digest) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl) @@ -165,6 +168,7 @@ sal_uInt32 SAL_CALL rtl_digest_queryLength (rtlDigest Digest) */ rtlDigestError SAL_CALL rtl_digest_init ( rtlDigest Digest, const sal_uInt8 *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl) @@ -182,6 +186,7 @@ rtlDigestError SAL_CALL rtl_digest_init ( */ rtlDigestError SAL_CALL rtl_digest_update ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl && pImpl->m_update) @@ -195,6 +200,7 @@ rtlDigestError SAL_CALL rtl_digest_update ( */ rtlDigestError SAL_CALL rtl_digest_get ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl && pImpl->m_get) @@ -206,7 +212,7 @@ rtlDigestError SAL_CALL rtl_digest_get ( /* * rtl_digest_destroy. */ -void SAL_CALL rtl_digest_destroy (rtlDigest Digest) +void SAL_CALL rtl_digest_destroy (rtlDigest Digest) SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl && pImpl->m_delete) @@ -221,19 +227,19 @@ void SAL_CALL rtl_digest_destroy (rtlDigest Digest) #define DIGEST_CBLOCK_MD2 16 #define DIGEST_LBLOCK_MD2 16 -typedef struct digestMD2_context_st +struct DigestContextMD2 { sal_uInt32 m_nDatLen; sal_uInt8 m_pData[DIGEST_CBLOCK_MD2]; sal_uInt32 m_state[DIGEST_LBLOCK_MD2]; sal_uInt32 m_chksum[DIGEST_LBLOCK_MD2]; -} DigestContextMD2; +}; -typedef struct digestMD2_impl_st +struct DigestMD2_Impl { Digest_Impl m_digest; DigestContextMD2 m_context; -} DigestMD2_Impl; +}; static void __rtl_digest_initMD2 (DigestContextMD2 *ctx); static void __rtl_digest_updateMD2 (DigestContextMD2 *ctx); @@ -374,7 +380,7 @@ static void __rtl_digest_endMD2 (DigestContextMD2 *ctx) */ rtlDigestError SAL_CALL rtl_digest_MD2 ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestMD2_Impl digest; rtlDigestError result; @@ -393,7 +399,7 @@ rtlDigestError SAL_CALL rtl_digest_MD2 ( /* * rtl_digest_createMD2. */ -rtlDigest SAL_CALL rtl_digest_createMD2 (void) +rtlDigest SAL_CALL rtl_digest_createMD2() SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestMD2_Impl); @@ -410,6 +416,7 @@ rtlDigest SAL_CALL rtl_digest_createMD2 (void) */ rtlDigestError SAL_CALL rtl_digest_updateMD2 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -468,6 +475,7 @@ rtlDigestError SAL_CALL rtl_digest_updateMD2 ( */ rtlDigestError SAL_CALL rtl_digest_getMD2 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl *)Digest; sal_uInt32 i; @@ -496,7 +504,7 @@ rtlDigestError SAL_CALL rtl_digest_getMD2 ( /* * rtl_digest_destroyMD2. */ -void SAL_CALL rtl_digest_destroyMD2 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroyMD2 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl *)Digest; if (pImpl) @@ -516,19 +524,19 @@ void SAL_CALL rtl_digest_destroyMD2 (rtlDigest Digest) #define DIGEST_CBLOCK_MD5 64 #define DIGEST_LBLOCK_MD5 16 -typedef struct digestMD5_context_st +struct DigestContextMD5 { sal_uInt32 m_nDatLen; sal_uInt32 m_pData[DIGEST_LBLOCK_MD5]; sal_uInt32 m_nA, m_nB, m_nC, m_nD; sal_uInt32 m_nL, m_nH; -} DigestContextMD5; +}; -typedef struct digestMD5_impl_st +struct DigestMD5_Impl { Digest_Impl m_digest; DigestContextMD5 m_context; -} DigestMD5_Impl; +}; static void __rtl_digest_initMD5 (DigestContextMD5 *ctx); static void __rtl_digest_updateMD5 (DigestContextMD5 *ctx); @@ -739,7 +747,7 @@ static void __rtl_digest_endMD5 (DigestContextMD5 *ctx) */ rtlDigestError SAL_CALL rtl_digest_MD5 ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestMD5_Impl digest; rtlDigestError result; @@ -758,7 +766,7 @@ rtlDigestError SAL_CALL rtl_digest_MD5 ( /* * rtl_digest_createMD5. */ -rtlDigest SAL_CALL rtl_digest_createMD5 (void) +rtlDigest SAL_CALL rtl_digest_createMD5() SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestMD5_Impl); @@ -775,6 +783,7 @@ rtlDigest SAL_CALL rtl_digest_createMD5 (void) */ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -847,6 +856,7 @@ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( */ rtlDigestError SAL_CALL rtl_digest_getMD5 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -879,6 +889,7 @@ rtlDigestError SAL_CALL rtl_digest_getMD5 ( */ rtlDigestError SAL_CALL rtl_digest_rawMD5 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -909,7 +920,7 @@ rtlDigestError SAL_CALL rtl_digest_rawMD5 ( /* * rtl_digest_destroyMD5. */ -void SAL_CALL rtl_digest_destroyMD5 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroyMD5 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; if (pImpl) @@ -934,20 +945,20 @@ typedef sal_uInt32 DigestSHA_update_t (sal_uInt32 x); static sal_uInt32 __rtl_digest_updateSHA_0 (sal_uInt32 x); static sal_uInt32 __rtl_digest_updateSHA_1 (sal_uInt32 x); -typedef struct digestSHA_context_st +struct DigestContextSHA { DigestSHA_update_t *m_update; sal_uInt32 m_nDatLen; sal_uInt32 m_pData[DIGEST_LBLOCK_SHA]; sal_uInt32 m_nA, m_nB, m_nC, m_nD, m_nE; sal_uInt32 m_nL, m_nH; -} DigestContextSHA; +}; -typedef struct digestSHA_impl_st +struct DigestSHA_Impl { Digest_Impl m_digest; DigestContextSHA m_context; -} DigestSHA_Impl; +}; static void __rtl_digest_initSHA ( DigestContextSHA *ctx, DigestSHA_update_t *fct); @@ -1216,7 +1227,7 @@ static sal_uInt32 __rtl_digest_updateSHA_0 (sal_uInt32 x) */ rtlDigestError SAL_CALL rtl_digest_SHA ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestSHA_Impl digest; rtlDigestError result; @@ -1235,7 +1246,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA ( /* * rtl_digest_createSHA. */ -rtlDigest SAL_CALL rtl_digest_createSHA (void) +rtlDigest SAL_CALL rtl_digest_createSHA() SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl); @@ -1252,6 +1263,7 @@ rtlDigest SAL_CALL rtl_digest_createSHA (void) */ rtlDigestError SAL_CALL rtl_digest_updateSHA ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -1324,6 +1336,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA ( */ rtlDigestError SAL_CALL rtl_digest_getSHA ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -1355,7 +1368,7 @@ rtlDigestError SAL_CALL rtl_digest_getSHA ( /* * rtl_digest_destroySHA. */ -void SAL_CALL rtl_digest_destroySHA (rtlDigest Digest) +void SAL_CALL rtl_digest_destroySHA (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; if (pImpl) @@ -1404,7 +1417,7 @@ static sal_uInt32 __rtl_digest_updateSHA_1 (sal_uInt32 x) */ rtlDigestError SAL_CALL rtl_digest_SHA1 ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestSHA_Impl digest; rtlDigestError result; @@ -1423,7 +1436,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA1 ( /* * rtl_digest_createSHA1. */ -rtlDigest SAL_CALL rtl_digest_createSHA1 (void) +rtlDigest SAL_CALL rtl_digest_createSHA1() SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl); @@ -1440,6 +1453,7 @@ rtlDigest SAL_CALL rtl_digest_createSHA1 (void) */ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -1512,6 +1526,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( */ rtlDigestError SAL_CALL rtl_digest_getSHA1 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -1543,7 +1558,7 @@ rtlDigestError SAL_CALL rtl_digest_getSHA1 ( /* * rtl_digest_destroySHA1. */ -void SAL_CALL rtl_digest_destroySHA1 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroySHA1 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; if (pImpl) @@ -1562,17 +1577,17 @@ void SAL_CALL rtl_digest_destroySHA1 (rtlDigest Digest) *======================================================================*/ #define DIGEST_CBLOCK_HMAC_MD5 64 -typedef struct _contextHMAC_MD5_st +struct ContextHMAC_MD5 { DigestMD5_Impl m_hash; sal_uInt8 m_opad[DIGEST_CBLOCK_HMAC_MD5]; -} ContextHMAC_MD5; +}; -typedef struct _digestHMAC_MD5_impl_st +struct DigestHMAC_MD5_Impl { Digest_Impl m_digest; ContextHMAC_MD5 m_context; -} DigestHMAC_MD5_Impl; +}; static void __rtl_digest_initHMAC_MD5 (ContextHMAC_MD5 * ctx); static void __rtl_digest_ipadHMAC_MD5 (ContextHMAC_MD5 * ctx); @@ -1642,7 +1657,7 @@ static void __rtl_digest_opadHMAC_MD5 (ContextHMAC_MD5 * ctx) rtlDigestError SAL_CALL rtl_digest_HMAC_MD5 ( const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl digest; rtlDigestError result; @@ -1664,7 +1679,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_MD5 ( /* * rtl_digest_createHMAC_MD5. */ -rtlDigest SAL_CALL rtl_digest_createHMAC_MD5 (void) +rtlDigest SAL_CALL rtl_digest_createHMAC_MD5() SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestHMAC_MD5_Impl); @@ -1681,6 +1696,7 @@ rtlDigest SAL_CALL rtl_digest_createHMAC_MD5 (void) */ rtlDigestError SAL_CALL rtl_digest_initHMAC_MD5 ( rtlDigest Digest, const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen) + SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; ContextHMAC_MD5 *ctx; @@ -1719,6 +1735,7 @@ rtlDigestError SAL_CALL rtl_digest_initHMAC_MD5 ( */ rtlDigestError SAL_CALL rtl_digest_updateHMAC_MD5 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; ContextHMAC_MD5 *ctx; @@ -1740,6 +1757,7 @@ rtlDigestError SAL_CALL rtl_digest_updateHMAC_MD5 ( */ rtlDigestError SAL_CALL rtl_digest_getHMAC_MD5 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; ContextHMAC_MD5 *ctx; @@ -1772,7 +1790,7 @@ rtlDigestError SAL_CALL rtl_digest_getHMAC_MD5 ( /* * rtl_digest_destroyHMAC_MD5. */ -void SAL_CALL rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; if (pImpl) @@ -1791,17 +1809,17 @@ void SAL_CALL rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) *======================================================================*/ #define DIGEST_CBLOCK_HMAC_SHA1 64 -typedef struct _contextHMAC_SHA1_st +struct ContextHMAC_SHA1 { DigestSHA_Impl m_hash; sal_uInt8 m_opad[DIGEST_CBLOCK_HMAC_SHA1]; -} ContextHMAC_SHA1; +}; -typedef struct _digestHMAC_SHA1_impl_st +struct DigestHMAC_SHA1_Impl { Digest_Impl m_digest; ContextHMAC_SHA1 m_context; -} DigestHMAC_SHA1_Impl; +}; static void __rtl_digest_initHMAC_SHA1 (ContextHMAC_SHA1 * ctx); static void __rtl_digest_ipadHMAC_SHA1 (ContextHMAC_SHA1 * ctx); @@ -1871,7 +1889,7 @@ static void __rtl_digest_opadHMAC_SHA1 (ContextHMAC_SHA1 * ctx) rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1 ( const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl digest; rtlDigestError result; @@ -1893,7 +1911,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1 ( /* * rtl_digest_createHMAC_SHA1. */ -rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1 (void) +rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1() SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestHMAC_SHA1_Impl); @@ -1910,6 +1928,7 @@ rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1 (void) */ rtlDigestError SAL_CALL rtl_digest_initHMAC_SHA1 ( rtlDigest Digest, const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; ContextHMAC_SHA1 *ctx; @@ -1948,6 +1967,7 @@ rtlDigestError SAL_CALL rtl_digest_initHMAC_SHA1 ( */ rtlDigestError SAL_CALL rtl_digest_updateHMAC_SHA1 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; ContextHMAC_SHA1 *ctx; @@ -1969,6 +1989,7 @@ rtlDigestError SAL_CALL rtl_digest_updateHMAC_SHA1 ( */ rtlDigestError SAL_CALL rtl_digest_getHMAC_SHA1 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; ContextHMAC_SHA1 *ctx; @@ -2002,6 +2023,7 @@ rtlDigestError SAL_CALL rtl_digest_getHMAC_SHA1 ( * rtl_digest_destroyHMAC_SHA1. */ void SAL_CALL rtl_digest_destroyHMAC_SHA1 (rtlDigest Digest) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; if (pImpl) @@ -2067,7 +2089,7 @@ rtlDigestError SAL_CALL rtl_digest_PBKDF2 ( sal_uInt8 *pKeyData , sal_uInt32 nKeyLen, const sal_uInt8 *pPassData, sal_uInt32 nPassLen, const sal_uInt8 *pSaltData, sal_uInt32 nSaltLen, - sal_uInt32 nCount) + sal_uInt32 nCount) SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl digest; sal_uInt32 i = 1; diff --git a/sal/rtl/source/locale.c b/sal/rtl/source/locale.cxx index 2885b4cc4b68..3e58c4cbb791 100644 --- a/sal/rtl/source/locale.c +++ b/sal/rtl/source/locale.cxx @@ -32,27 +32,26 @@ #include "rtl/alloc.h" #include "internal/once.h" +#include "internal/rtl_locale_init.h" static sal_Int32 RTL_HASHTABLE_SIZE[] = { 7, 31, 127, 251, 509, 1021, 2039, 4093 }; -typedef struct rtl_hashentry RTL_HASHENTRY; - -struct rtl_hashentry +struct RTL_HASHENTRY { rtl_Locale* Entry; RTL_HASHENTRY* Next; }; -typedef struct rtl_hashtable +struct RTL_HASHTABLE { sal_Int8 iSize; sal_Int32 Size; sal_Int32 Elements; RTL_HASHENTRY** Table; -} RTL_HASHTABLE; +}; static RTL_HASHTABLE* g_pLocaleTable = NULL; @@ -60,7 +59,7 @@ static rtl_Locale* g_pDefaultLocale = NULL; /************************************************************************* */ -void rtl_hashentry_destroy(RTL_HASHENTRY* entry) +extern "C" void rtl_hashentry_destroy(RTL_HASHENTRY* entry) { rtl_uString_release(entry->Entry->Language); rtl_uString_release(entry->Entry->Country); @@ -72,7 +71,7 @@ void rtl_hashentry_destroy(RTL_HASHENTRY* entry) rtl_freeMemory(entry); } -void rtl_hashtable_destroy(RTL_HASHTABLE* table) +extern "C" void rtl_hashtable_destroy(RTL_HASHTABLE* table) { sal_Int32 size = 0; @@ -92,7 +91,7 @@ void rtl_hashtable_destroy(RTL_HASHTABLE* table) rtl_freeMemory(table); } -void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) +extern "C" void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) { sal_Int32 nSize = RTL_HASHTABLE_SIZE[sizeIndex]; @@ -113,14 +112,14 @@ void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) } } -sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key) +extern "C" sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key) { return ( (sal_uInt32) key % table->Size); } -sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table); +extern "C" sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table); -rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value) +extern "C" rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value) { sal_Int32 key = 0; @@ -201,7 +200,7 @@ sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table) return sal_True; } -sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** pValue) +extern "C" sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** pValue) { if (!table) return sal_False; @@ -226,7 +225,7 @@ sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hash /************************************************************************* * rtl_locale_init */ -void rtl_locale_init (void) +void rtl_locale_init() { OSL_ASSERT(g_pLocaleTable == 0); rtl_hashtable_init(&g_pLocaleTable, 1); @@ -235,7 +234,7 @@ void rtl_locale_init (void) /************************************************************************* * rtl_locale_fini */ -void rtl_locale_fini (void) +void rtl_locale_fini() { if (g_pLocaleTable != 0) { @@ -244,8 +243,6 @@ void rtl_locale_fini (void) } } -extern void ensureLocaleSingleton(); - /************************************************************************* * rtl_locale_register */ diff --git a/sal/rtl/source/memory.c b/sal/rtl/source/memory.cxx index 070b7898d413..857710dcc708 100644 --- a/sal/rtl/source/memory.c +++ b/sal/rtl/source/memory.cxx @@ -57,7 +57,7 @@ sal_Int32 SAL_CALL rtl_compareMemory(const void *MemA, const void *MemB, sal_Siz void* SAL_CALL rtl_findInMemory(const void *MemA, sal_uInt8 ch, sal_Size Bytes) { - return memchr(MemA, ch, Bytes); + return const_cast< void * >(memchr(MemA, ch, Bytes)); } diff --git a/sal/rtl/source/random.c b/sal/rtl/source/random.cxx index 101c7dffdbec..a8b452ac439b 100644 --- a/sal/rtl/source/random.c +++ b/sal/rtl/source/random.cxx @@ -58,12 +58,12 @@ /** RandomData_Impl. */ -typedef struct random_data_impl_st +struct RandomData_Impl { sal_Int16 m_nX; sal_Int16 m_nY; sal_Int16 m_nZ; -} RandomData_Impl; +}; /** __rtl_random_data. */ @@ -75,7 +75,7 @@ static double __rtl_random_data (RandomData_Impl *pImpl); #define RTL_RANDOM_SIZE_DIGEST RTL_DIGEST_LENGTH_MD5 #define RTL_RANDOM_SIZE_POOL 1023 -typedef struct random_pool_impl_st +struct RandomPool_Impl { rtlDigest m_hDigest; sal_uInt8 m_pDigest[RTL_RANDOM_SIZE_DIGEST]; @@ -83,7 +83,7 @@ typedef struct random_pool_impl_st sal_uInt32 m_nData; sal_uInt32 m_nIndex; sal_uInt32 m_nCount; -} RandomPool_Impl; +}; /** __rtl_random_initPool. */ @@ -277,7 +277,7 @@ static void __rtl_random_readPool ( /* * rtl_random_createPool. */ -rtlRandomPool SAL_CALL rtl_random_createPool (void) +rtlRandomPool SAL_CALL rtl_random_createPool() SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl*)NULL; pImpl = (RandomPool_Impl*)rtl_allocateZeroMemory (sizeof(RandomPool_Impl)); @@ -295,7 +295,7 @@ rtlRandomPool SAL_CALL rtl_random_createPool (void) /* * rtl_random_destroyPool. */ -void SAL_CALL rtl_random_destroyPool (rtlRandomPool Pool) +void SAL_CALL rtl_random_destroyPool (rtlRandomPool Pool) SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; if (pImpl) @@ -309,7 +309,7 @@ void SAL_CALL rtl_random_destroyPool (rtlRandomPool Pool) * rtl_random_addBytes. */ rtlRandomError SAL_CALL rtl_random_addBytes ( - rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) + rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; const sal_uInt8 *pBuffer = (const sal_uInt8 *)Buffer; @@ -325,7 +325,7 @@ rtlRandomError SAL_CALL rtl_random_addBytes ( * rtl_random_getBytes. */ rtlRandomError SAL_CALL rtl_random_getBytes ( - rtlRandomPool Pool, void *Buffer, sal_Size Bytes) + rtlRandomPool Pool, void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; sal_uInt8 *pBuffer = (sal_uInt8 *)Buffer; diff --git a/sal/rtl/source/uuid.cxx b/sal/rtl/source/uuid.cxx index 7be3847e6902..8b650cd6aa43 100644 --- a/sal/rtl/source/uuid.cxx +++ b/sal/rtl/source/uuid.cxx @@ -67,7 +67,7 @@ ( ( (sal_uInt32)p[3]) & 0xff);\ } -typedef struct _UUID +struct UUID { sal_uInt32 time_low; sal_uInt16 time_mid; @@ -75,7 +75,7 @@ typedef struct _UUID sal_uInt8 clock_seq_hi_and_reserved; sal_uInt8 clock_seq_low; sal_uInt8 node[6]; -} UUID; +}; static void write_v3( sal_uInt8 *pUuid ) { |