diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:05:35 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:23 +0100 |
commit | d963fd84256081ce6a2e0ab1e9c0516cfb0b38b9 (patch) | |
tree | 09334eb0c4e69c3d0ee0ea939fe1669415540d57 /registry/source | |
parent | 8375ac018628a7619c6719dd6fb5761a007e069e (diff) |
Clean up C-style casts from pointers to void
Change-Id: I192bc9653d8492a850a5e259e15782bd3bb24922
Diffstat (limited to 'registry/source')
-rw-r--r-- | registry/source/keyimpl.cxx | 54 | ||||
-rw-r--r-- | registry/source/reflread.cxx | 70 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 6 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 30 | ||||
-rw-r--r-- | registry/source/registry.cxx | 24 | ||||
-rw-r--r-- | registry/source/regkey.cxx | 8 |
6 files changed, 96 insertions, 96 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index e8c1a67160fa..4f6c770ddd5b 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -99,7 +99,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK *pnSubKeys = nSubKeys; ORegKey** pSubKeys; - pSubKeys = (ORegKey**)rtl_allocateZeroMemory(nSubKeys * sizeof(ORegKey*)); + pSubKeys = static_cast<ORegKey**>(rtl_allocateZeroMemory(nSubKeys * sizeof(ORegKey*))); OStoreDirectory::iterator iter; OStoreDirectory rStoreDir(pKey->getStoreDir()); @@ -163,7 +163,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, *pnSubKeys = nSubKeys; rtl_uString** pSubKeys = 0; - pSubKeys = (rtl_uString**)rtl_allocateZeroMemory(nSubKeys * sizeof(rtl_uString*)); + pSubKeys = static_cast<rtl_uString**>(rtl_allocateZeroMemory(nSubKeys * sizeof(rtl_uString*))); OStoreDirectory::iterator iter; OStoreDirectory rStoreDir(pKey->getStoreDir()); @@ -243,7 +243,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) @@ -270,7 +270,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy if (*pValueType > 4) { rtl_freeMemory(pBuffer); - pBuffer = (sal_uInt8*)rtl_allocateMemory(4); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(4)); rValue.readAt(VALUE_HEADEROFFSET, pBuffer, 4, readBytes); readUINT32(pBuffer, size); @@ -315,7 +315,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal sal_uInt32 size = vSize; sal_uInt8 type = (sal_uInt8)vType; - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size)); memcpy(pBuffer, &type, 1); writeUINT32(pBuffer+VALUE_TYPEOFFSET, size); @@ -326,13 +326,13 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal memcpy(pBuffer+VALUE_HEADEROFFSET, value, size); break; case RG_VALUETYPE_LONG: - writeINT32(pBuffer+VALUE_HEADEROFFSET, *((sal_Int32*)value)); + writeINT32(pBuffer+VALUE_HEADEROFFSET, *static_cast<sal_Int32*>(value)); break; case RG_VALUETYPE_STRING: - writeUtf8(pBuffer+VALUE_HEADEROFFSET, (const sal_Char*)value); + writeUtf8(pBuffer+VALUE_HEADEROFFSET, static_cast<const sal_Char*>(value)); break; case RG_VALUETYPE_UNICODE: - writeString(pBuffer+VALUE_HEADEROFFSET, (const sal_Unicode*)value); + writeString(pBuffer+VALUE_HEADEROFFSET, static_cast<const sal_Unicode*>(value)); break; case RG_VALUETYPE_BINARY: memcpy(pBuffer+VALUE_HEADEROFFSET, value, size); @@ -387,7 +387,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL size += len * 4; sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_LONGLIST; - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size)); memcpy(pBuffer, &type, 1); writeUINT32(pBuffer+VALUE_TYPEOFFSET, size); @@ -450,7 +450,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu } sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_STRINGLIST; - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size)); memcpy(pBuffer, &type, 1); writeUINT32(pBuffer+VALUE_TYPEOFFSET, size); @@ -518,7 +518,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p } sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_UNICODELIST; - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size)); memcpy(pBuffer, &type, 1); writeUINT32(pBuffer+VALUE_TYPEOFFSET, size); @@ -580,7 +580,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) @@ -605,7 +605,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const return REG_INVALID_VALUE; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(valueSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize)); if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { @@ -624,13 +624,13 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const memcpy(value, pBuffer, valueSize); break; case RG_VALUETYPE_LONG: - readINT32(pBuffer, *((sal_Int32*)value)); + readINT32(pBuffer, *static_cast<sal_Int32*>(value)); break; case RG_VALUETYPE_STRING: - readUtf8(pBuffer, (sal_Char*)value, valueSize); + readUtf8(pBuffer, static_cast<sal_Char*>(value), valueSize); break; case RG_VALUETYPE_UNICODE: - readString(pBuffer, (sal_Unicode*)value, valueSize); + readString(pBuffer, static_cast<sal_Unicode*>(value), valueSize); break; case RG_VALUETYPE_BINARY: memcpy(value, pBuffer, valueSize); @@ -676,7 +676,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) @@ -718,7 +718,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue rtl_freeMemory(pBuffer); return REG_INVALID_VALUE; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(valueSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize)); if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { @@ -747,7 +747,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue return REG_INVALID_VALUE; } *pLen = len; - sal_Int32* pVList = (sal_Int32*)rtl_allocateZeroMemory(len * sizeof(sal_Int32)); + sal_Int32* pVList = static_cast<sal_Int32*>(rtl_allocateZeroMemory(len * sizeof(sal_Int32))); sal_uInt32 offset = 4; // initial 4 bytes for the size of the array; @@ -790,7 +790,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) @@ -823,7 +823,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal rtl_freeMemory(pBuffer); - pBuffer = (sal_uInt8*)rtl_allocateMemory(valueSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize)); if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { @@ -844,7 +844,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal readUINT32(pBuffer, len); *pLen = len; - sal_Char** pVList = (sal_Char**)rtl_allocateZeroMemory(len * sizeof(sal_Char*)); + sal_Char** pVList = static_cast<sal_Char**>(rtl_allocateZeroMemory(len * sizeof(sal_Char*))); sal_uInt32 offset = 4; // initial 4 bytes for the size of the array; sal_uInt32 sLen = 0; @@ -856,7 +856,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal offset += 4; - pValue = (sal_Char*)rtl_allocateMemory(sLen); + pValue = static_cast<sal_Char*>(rtl_allocateMemory(sLen)); readUtf8(pBuffer+offset, pValue, sLen); pVList[i] = pValue; @@ -896,7 +896,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) @@ -929,7 +929,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** rtl_freeMemory(pBuffer); - pBuffer = (sal_uInt8*)rtl_allocateMemory(valueSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize)); if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { @@ -950,7 +950,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** readUINT32(pBuffer, len); *pLen = len; - sal_Unicode** pVList = (sal_Unicode**)rtl_allocateZeroMemory(len * sizeof(sal_Unicode*)); + sal_Unicode** pVList = static_cast<sal_Unicode**>(rtl_allocateZeroMemory(len * sizeof(sal_Unicode*))); sal_uInt32 offset = 4; // initial 4 bytes for the size of the array; sal_uInt32 sLen = 0; @@ -962,7 +962,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** offset += 4; - pValue = (sal_Unicode*)rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)); + pValue = static_cast<sal_Unicode*>(rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode))); readString(pBuffer+offset, pValue, sLen); pVList[i] = pValue; diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index 532b75f05129..15a9d0f4c25c 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -1299,7 +1299,7 @@ static TypeReaderImpl TYPEREG_CALLTYPE createEntry(const sal_uInt8* buffer, sal_ void TYPEREG_CALLTYPE typereg_reader_acquire(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != NULL) pEntry->m_refCount++; @@ -1307,7 +1307,7 @@ void TYPEREG_CALLTYPE typereg_reader_acquire(void * hEntry) SAL_THROW_EXTERN_C() void TYPEREG_CALLTYPE typereg_reader_release(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != NULL) { @@ -1329,7 +1329,7 @@ typereg_Version TYPEREG_CALLTYPE typereg_reader_getVersion(void * handle) SAL_TH static sal_uInt16 TYPEREG_CALLTYPE getMinorVersion(TypeReaderImpl hEntry) { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { return pEntry->readUINT16(OFFSET_MINOR_VERSION); @@ -1342,7 +1342,7 @@ static sal_uInt16 TYPEREG_CALLTYPE getMinorVersion(TypeReaderImpl hEntry) static sal_uInt16 TYPEREG_CALLTYPE getMajorVersion(TypeReaderImpl hEntry) { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { return pEntry->readUINT16(OFFSET_MAJOR_VERSION); @@ -1355,7 +1355,7 @@ static sal_uInt16 TYPEREG_CALLTYPE getMajorVersion(TypeReaderImpl hEntry) RTTypeClass TYPEREG_CALLTYPE typereg_reader_getTypeClass(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { return (RTTypeClass) @@ -1383,7 +1383,7 @@ sal_Bool TYPEREG_CALLTYPE typereg_reader_isPublished(void * hEntry) SAL_THROW_EX void TYPEREG_CALLTYPE typereg_reader_getTypeName(void * hEntry, rtl_uString** pTypeName) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(OFFSET_THIS_TYPE)); @@ -1401,7 +1401,7 @@ void TYPEREG_CALLTYPE typereg_reader_getTypeName(void * hEntry, rtl_uString** pT static void TYPEREG_CALLTYPE getSuperTypeName(TypeReaderImpl hEntry, rtl_uString** pSuperTypeName) { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr && pEntry->m_nSuperTypes != 0) { try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(pEntry->m_offset_SUPERTYPES )); //+ (index * sizeof(sal_uInt16)))); @@ -1418,7 +1418,7 @@ static void TYPEREG_CALLTYPE getSuperTypeName(TypeReaderImpl hEntry, rtl_uString static void TYPEREG_CALLTYPE getUik(TypeReaderImpl hEntry, RTUik* uik) { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != NULL) { @@ -1433,7 +1433,7 @@ static void TYPEREG_CALLTYPE getUik(TypeReaderImpl hEntry, RTUik* uik) void TYPEREG_CALLTYPE typereg_reader_getDocumentation(void * hEntry, rtl_uString** pDoku) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(OFFSET_DOKU)); @@ -1451,7 +1451,7 @@ void TYPEREG_CALLTYPE typereg_reader_getDocumentation(void * hEntry, rtl_uString void TYPEREG_CALLTYPE typereg_reader_getFileName(void * hEntry, rtl_uString** pFileName) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(OFFSET_FILENAME)); @@ -1469,7 +1469,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFileName(void * hEntry, rtl_uString** pF sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getFieldCount(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return 0; @@ -1484,7 +1484,7 @@ static sal_uInt32 TYPEREG_CALLTYPE getFieldCount(TypeReaderImpl hEntry) void TYPEREG_CALLTYPE typereg_reader_getFieldName(void * hEntry, rtl_uString** pFieldName, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1500,7 +1500,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldName(void * hEntry, rtl_uString** p void TYPEREG_CALLTYPE typereg_reader_getFieldTypeName(void * hEntry, rtl_uString** pFieldType, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1517,7 +1517,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldTypeName(void * hEntry, rtl_uString RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getFieldFlags(void * hEntry, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return RT_ACCESS_INVALID; @@ -1529,7 +1529,7 @@ sal_Bool TYPEREG_CALLTYPE typereg_reader_getFieldValue( RTConstValueUnion * value) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { *type = RT_TYPE_NONE; @@ -1554,7 +1554,7 @@ static RTValueType TYPEREG_CALLTYPE getFieldConstValue(TypeReaderImpl hEntry, sa void TYPEREG_CALLTYPE typereg_reader_getFieldDocumentation(void * hEntry, rtl_uString** pDoku, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1571,7 +1571,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldDocumentation(void * hEntry, rtl_uS void TYPEREG_CALLTYPE typereg_reader_getFieldFileName(void * hEntry, rtl_uString** pFieldFileName, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1588,7 +1588,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldFileName(void * hEntry, rtl_uString sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodCount(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return 0; @@ -1603,7 +1603,7 @@ static sal_uInt32 TYPEREG_CALLTYPE getMethodCount(TypeReaderImpl hEntry) void TYPEREG_CALLTYPE typereg_reader_getMethodName(void * hEntry, rtl_uString** pMethodName, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1620,7 +1620,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodName(void * hEntry, rtl_uString** sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodParameterCount( void * hEntry, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return 0; @@ -1635,7 +1635,7 @@ static sal_uInt32 TYPEREG_CALLTYPE getMethodParamCount(TypeReaderImpl hEntry, sa void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void * hEntry, rtl_uString** pMethodParamType, sal_uInt16 index, sal_uInt16 paramIndex) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1652,7 +1652,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void * hEntry, r void TYPEREG_CALLTYPE typereg_reader_getMethodParameterName(void * hEntry, rtl_uString** pMethodParamName, sal_uInt16 index, sal_uInt16 paramIndex) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1669,7 +1669,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodParameterName(void * hEntry, rtl_u RTParamMode TYPEREG_CALLTYPE typereg_reader_getMethodParameterFlags(void * hEntry, sal_uInt16 index, sal_uInt16 paramIndex) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return RT_PARAM_INVALID; @@ -1679,7 +1679,7 @@ RTParamMode TYPEREG_CALLTYPE typereg_reader_getMethodParameterFlags(void * hEntr sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodExceptionCount( void * hEntry, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return 0; @@ -1694,7 +1694,7 @@ static sal_uInt32 TYPEREG_CALLTYPE getMethodExcCount(TypeReaderImpl hEntry, sal_ void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void * hEntry, rtl_uString** pMethodExcpType, sal_uInt16 index, sal_uInt16 excIndex) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1711,7 +1711,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void * hEntry, r void TYPEREG_CALLTYPE typereg_reader_getMethodReturnTypeName(void * hEntry, rtl_uString** pMethodReturnType, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1728,7 +1728,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodReturnTypeName(void * hEntry, rtl_ RTMethodMode TYPEREG_CALLTYPE typereg_reader_getMethodFlags(void * hEntry, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return RT_MODE_INVALID; @@ -1738,7 +1738,7 @@ RTMethodMode TYPEREG_CALLTYPE typereg_reader_getMethodFlags(void * hEntry, sal_u void TYPEREG_CALLTYPE typereg_reader_getMethodDocumentation(void * hEntry, rtl_uString** pMethodDoku, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1754,7 +1754,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodDocumentation(void * hEntry, rtl_u sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getReferenceCount(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return 0; @@ -1769,7 +1769,7 @@ static sal_uInt32 TYPEREG_CALLTYPE getReferenceCount(TypeReaderImpl hEntry) void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void * hEntry, rtl_uString** pReferenceName, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1786,7 +1786,7 @@ void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void * hEntry, rtl_uSt RTReferenceType TYPEREG_CALLTYPE typereg_reader_getReferenceSort(void * hEntry, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return RT_REF_INVALID; @@ -1796,7 +1796,7 @@ RTReferenceType TYPEREG_CALLTYPE typereg_reader_getReferenceSort(void * hEntry, void TYPEREG_CALLTYPE typereg_reader_getReferenceDocumentation(void * hEntry, rtl_uString** pReferenceDoku, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) { @@ -1813,7 +1813,7 @@ void TYPEREG_CALLTYPE typereg_reader_getReferenceDocumentation(void * hEntry, rt RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getReferenceFlags(void * hEntry, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return RT_ACCESS_INVALID; @@ -1823,7 +1823,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getReferenceFlags(void * hEntry, s sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getSuperTypeCount(void * hEntry) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry == NULL) return 0; @@ -1834,7 +1834,7 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName( void * hEntry, rtl_uString ** pSuperTypeName, sal_uInt16 index) SAL_THROW_EXTERN_C() { - TypeRegistryEntry* pEntry = (TypeRegistryEntry*) hEntry; + TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); if (pEntry != nullptr) { try { OSL_ASSERT(index < pEntry->m_nSuperTypes); diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 7bc706dc3d67..49beeb0d325c 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -1170,7 +1170,7 @@ extern "C" { static void TYPEREG_CALLTYPE acquire(TypeWriterImpl hEntry) { - TypeWriter* pEntry = (TypeWriter*) hEntry; + TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry); if (pEntry != NULL) pEntry->m_refCount++; @@ -1178,7 +1178,7 @@ static void TYPEREG_CALLTYPE acquire(TypeWriterImpl hEntry) static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry) { - TypeWriter* pEntry = (TypeWriter*) hEntry; + TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry); if (pEntry != NULL) { @@ -1189,7 +1189,7 @@ static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry) static void TYPEREG_CALLTYPE setUik(TypeWriterImpl hEntry, const RTUik* uik) { - TypeWriter* pEntry = (TypeWriter*) hEntry; + TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry); if (pEntry != NULL) { diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 90c1ceed4284..6c0bba1fac47 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -647,7 +647,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, REG_GUARD(m_mutex); if (hKey) - pKey = (ORegKey*)hKey; + pKey = static_cast<ORegKey*>(hKey); else pKey = m_openKeyTable[ROOT]; @@ -656,8 +656,8 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, if (m_openKeyTable.count(sFullKeyName) > 0) { *phNewKey = m_openKeyTable[sFullKeyName]; - ((ORegKey*)*phNewKey)->acquire(); - ((ORegKey*)*phNewKey)->setDeleted(false); + static_cast<ORegKey*>(*phNewKey)->acquire(); + static_cast<ORegKey*>(*phNewKey)->setDeleted(false); return REG_NO_ERROR; } @@ -710,7 +710,7 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, REG_GUARD(m_mutex); if (hKey) - pKey = (ORegKey*)hKey; + pKey = static_cast<ORegKey*>(hKey); else pKey = m_openKeyTable[ROOT]; @@ -1040,7 +1040,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 rwBytes; if (rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes)) @@ -1061,7 +1061,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, rtl_freeMemory(pBuffer); nSize = VALUE_HEADERSIZE + valueSize; - pBuffer = (sal_uInt8*)rtl_allocateMemory(nSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(nSize)); if (rValue.readAt(0, pBuffer, nSize, rwBytes)) { @@ -1139,7 +1139,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue, return REG_INVALID_VALUE; } - sal_uInt8* pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + sal_uInt8* pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); RegValueType valueType; sal_uInt32 valueSize; sal_uInt32 rwBytes; @@ -1155,7 +1155,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue, if (valueType == RG_VALUETYPE_BINARY) { - pBuffer = (sal_uInt8*)rtl_allocateMemory(valueSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize)); if (!rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, rwBytes) && (rwBytes == valueSize)) { @@ -1304,7 +1304,7 @@ RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue, sal_uInt32 aBlopSize = writer.getBlopSize(); sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_BINARY; - sal_uInt8* pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + aBlopSize); + sal_uInt8* pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + aBlopSize)); memcpy(pBuffer, &type, 1); writeUINT32(pBuffer+VALUE_TYPEOFFSET, aBlopSize); @@ -1413,7 +1413,7 @@ ORegKey* ORegistry::getRootKey() RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const { - ORegKey *pKey = (ORegKey*)hKey; + ORegKey *pKey = static_cast<ORegKey*>(hKey); OUString sName; RegError _ret = REG_NO_ERROR; OStoreDirectory::iterator iter; @@ -1476,7 +1476,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ return REG_VALUE_NOT_EXISTS; } - pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE)); sal_uInt32 rwBytes; if (rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes)) @@ -1494,7 +1494,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ valueType = (RegValueType)type; readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize); - pBuffer = (sal_uInt8*)rtl_allocateMemory(valueSize); + pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize)); if (rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, rwBytes)) { rtl_freeMemory(pBuffer); @@ -1527,7 +1527,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ break; case 2: { - sal_Char* value = (sal_Char*)rtl_allocateMemory(valueSize); + sal_Char* value = static_cast<sal_Char*>(rtl_allocateMemory(valueSize)); readUtf8(pBuffer, value, valueSize); fprintf(stdout, "%sValue: Type = RG_VALUETYPE_STRING\n", indent); fprintf( @@ -1622,7 +1622,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ offset += 4; // 4 Bytes (sal_uInt32) fuer die Groesse des strings in Bytes - sal_Char *pValue = (sal_Char*)rtl_allocateMemory(sLen); + sal_Char *pValue = static_cast<sal_Char*>(rtl_allocateMemory(sLen)); readUtf8(pBuffer+offset, pValue, sLen); if (offset > 8) @@ -1660,7 +1660,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ offset += 4; // 4 Bytes (sal_uInt32) fuer die Groesse des strings in Bytes - sal_Unicode *pValue = (sal_Unicode*)rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)); + sal_Unicode *pValue = static_cast<sal_Unicode*>(rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode))); readString(pBuffer+offset, pValue, sLen); if (offset > 8) diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index 3862ce5623dd..163d9a35693b 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -44,7 +44,7 @@ extern "C" { static void REGISTRY_CALLTYPE acquire(RegHandle hReg) { - ORegistry* pReg = (ORegistry*) hReg; + ORegistry* pReg = static_cast<ORegistry*>(hReg); if (pReg != NULL) pReg->acquire(); @@ -56,7 +56,7 @@ static void REGISTRY_CALLTYPE acquire(RegHandle hReg) static void REGISTRY_CALLTYPE release(RegHandle hReg) { - ORegistry* pReg = (ORegistry*) hReg; + ORegistry* pReg = static_cast<ORegistry*>(hReg); if (pReg) { @@ -76,7 +76,7 @@ static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString** pName) { if (hReg) { - ORegistry* pReg = (ORegistry*)hReg; + ORegistry* pReg = static_cast<ORegistry*>(hReg); if ( pReg->isOpen() ) { rtl_uString_assign(pName, pReg->getName().pData); @@ -99,7 +99,7 @@ static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString** pName) static sal_Bool REGISTRY_CALLTYPE isReadOnly(RegHandle hReg) { if (hReg) - return ((ORegistry*)hReg)->isReadOnly(); + return static_cast<ORegistry*>(hReg)->isReadOnly(); else return sal_False; } @@ -136,7 +136,7 @@ static RegError REGISTRY_CALLTYPE openRootKey(RegHandle hReg, if (hReg) { - pReg = (ORegistry*)hReg; + pReg = static_cast<ORegistry*>(hReg); if (!pReg->isOpen()) return REG_REGISTRY_NOT_OPEN; } else @@ -183,7 +183,7 @@ static RegError REGISTRY_CALLTYPE closeRegistry(RegHandle hReg) if (hReg) { - pReg = (ORegistry*)hReg; + pReg = static_cast<ORegistry*>(hReg); if (!pReg->isOpen()) return REG_REGISTRY_NOT_OPEN; @@ -214,7 +214,7 @@ static RegError REGISTRY_CALLTYPE destroyRegistry(RegHandle hReg, if (hReg) { - pReg = (ORegistry*)hReg; + pReg = static_cast<ORegistry*>(hReg); if (!pReg->isOpen()) return REG_INVALID_REGISTRY; @@ -456,7 +456,7 @@ RegError REGISTRY_CALLTYPE reg_loadKey(RegKeyHandle hKey, ORegKey *pKey; if (hKey) - pKey = (ORegKey*)hKey; + pKey = static_cast<ORegKey*>(hKey); else return REG_INVALID_KEY; @@ -473,7 +473,7 @@ RegError REGISTRY_CALLTYPE reg_saveKey(RegKeyHandle hKey, ORegKey *pKey; if (hKey) - pKey = (ORegKey*)hKey; + pKey = static_cast<ORegKey*>(hKey); else return REG_INVALID_KEY; @@ -492,7 +492,7 @@ RegError REGISTRY_CALLTYPE reg_mergeKey(RegKeyHandle hKey, ORegKey *pKey; if (hKey) - pKey = (ORegKey*)hKey; + pKey = static_cast<ORegKey*>(hKey); else return REG_INVALID_KEY; @@ -577,7 +577,7 @@ RegError REGISTRY_CALLTYPE reg_closeRegistry(RegHandle hRegistry) { if (hRegistry) { - ORegistry* pReg = (ORegistry*)hRegistry; + ORegistry* pReg = static_cast<ORegistry*>(hRegistry); delete(pReg); return REG_NO_ERROR; } else @@ -605,7 +605,7 @@ RegError REGISTRY_CALLTYPE reg_dumpRegistry(RegKeyHandle hKey) ORegKey *pKey; if (hKey) - pKey = (ORegKey*)hKey; + pKey = static_cast<ORegKey*>(hKey); else return REG_INVALID_KEY; diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx index 7792bf7fad9e..2307e2e12a51 100644 --- a/registry/source/regkey.cxx +++ b/registry/source/regkey.cxx @@ -154,7 +154,7 @@ RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle* phSubKeys, if (phSubKeys == 0 || nSubKeys == 0) return REG_INVALID_KEY; - ORegistry* pReg = ((ORegKey*)(phSubKeys[0]))->getRegistry(); + ORegistry* pReg = static_cast<ORegKey*>(phSubKeys[0])->getRegistry(); for (sal_uInt32 i = 0; i < nSubKeys; i++) { (void) pReg->closeKey(phSubKeys[i]); @@ -583,7 +583,7 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType, break; case 6: { - sal_Char** pVList = (sal_Char**)pValueList; + sal_Char** pVList = static_cast<sal_Char**>(pValueList); for (sal_uInt32 i=0; i < len; i++) { rtl_freeMemory(pVList[i]); @@ -594,7 +594,7 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType, break; case 7: { - sal_Unicode** pVList = (sal_Unicode**)pValueList; + sal_Unicode** pVList = static_cast<sal_Unicode**>(pValueList); for (sal_uInt32 i=0; i < len; i++) { rtl_freeMemory(pVList[i]); @@ -771,7 +771,7 @@ RegError REGISTRY_CALLTYPE reg_getKeyName(RegKeyHandle hKey, rtl_uString** pKeyN { if (hKey) { - rtl_uString_assign( pKeyName, ((ORegKey*)hKey)->getName().pData ); + rtl_uString_assign( pKeyName, static_cast<ORegKey*>(hKey)->getName().pData ); return REG_NO_ERROR; } else { |