summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 18:58:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:18 +0100
commit962b77340f03f89ae22b7a1e84e856e8d589c8b6 (patch)
tree263dd868a6039cf1dce877953fe1141c14804529 /comphelper
parentfb09b1f3c6e57cb8e679af982f88b96660c14a4c (diff)
Clean up C-style casts from pointers to void
Change-Id: Icdb619101a992a740c71545e669e138cb5dc63a6
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/container.cxx4
-rw-r--r--comphelper/source/eventattachermgr/eventattachermgr.cxx18
-rw-r--r--comphelper/source/misc/syntaxhighlight.cxx2
-rw-r--r--comphelper/source/misc/types.cxx4
4 files changed, 14 insertions, 14 deletions
diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx
index dffc2a36d30c..43a50cccd192 100644
--- a/comphelper/source/container/container.cxx
+++ b/comphelper/source/container/container.cxx
@@ -66,7 +66,7 @@ IndexAccessIterator::~IndexAccessIterator() {}
if (xContainerAccess.is() && xContainerAccess->getCount() && ShouldStepInto(xContainerAccess))
{
::com::sun::star::uno::Any aElement(xContainerAccess->getByIndex(0));
- xSearchLoop = *(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*)aElement.getValue();
+ xSearchLoop = *static_cast<css::uno::Reference< ::com::sun::star::uno::XInterface> const *>(aElement.getValue());
bCheckingStartingPoint = false;
m_arrChildIndizies.push_back((sal_Int32)0);
@@ -91,7 +91,7 @@ IndexAccessIterator::~IndexAccessIterator() {}
++nOldSearchChildIndex;
// and check the next child
::com::sun::star::uno::Any aElement(xContainerAccess->getByIndex(nOldSearchChildIndex));
- xSearchLoop = *(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*) aElement.getValue();
+ xSearchLoop = *static_cast<css::uno::Reference< ::com::sun::star::uno::XInterface> const *>(aElement.getValue());
bCheckingStartingPoint = false;
// and update its position in the list.
m_arrChildIndizies.push_back((sal_Int32)nOldSearchChildIndex);
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index 212af0cc2a16..ebf404f0db30 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -290,24 +290,24 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even
case TypeClass_BOOLEAN:
// FALSE -> Return
- if( !(*(sal_Bool*)aRet.getValue()) )
+ if( !(*static_cast<sal_Bool const *>(aRet.getValue())) )
return aRet;
break;
case TypeClass_STRING:
// none empty string -> return
- if( !((OUString*)aRet.getValue())->isEmpty() )
+ if( !(static_cast<OUString const *>(aRet.getValue()))->isEmpty() )
return aRet;
break;
// none zero number -> return
- case TypeClass_FLOAT: if( *((float*)aRet.getValue()) ) return aRet; break;
- case TypeClass_DOUBLE: if( *((double*)aRet.getValue()) ) return aRet; break;
- case TypeClass_BYTE: if( *((sal_uInt8*)aRet.getValue()) ) return aRet; break;
- case TypeClass_SHORT: if( *((sal_Int16*)aRet.getValue()) ) return aRet; break;
- case TypeClass_LONG: if( *((sal_Int32*)aRet.getValue()) ) return aRet; break;
- case TypeClass_UNSIGNED_SHORT: if( *((sal_uInt16*)aRet.getValue()) ) return aRet; break;
- case TypeClass_UNSIGNED_LONG: if( *((sal_uInt32*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_FLOAT: if( *static_cast<float const *>(aRet.getValue()) ) return aRet; break;
+ case TypeClass_DOUBLE: if( *static_cast<double const *>(aRet.getValue()) ) return aRet; break;
+ case TypeClass_BYTE: if( *static_cast<sal_uInt8 const *>(aRet.getValue()) ) return aRet; break;
+ case TypeClass_SHORT: if( *static_cast<sal_Int16 const *>(aRet.getValue()) ) return aRet; break;
+ case TypeClass_LONG: if( *static_cast<sal_Int32 const *>(aRet.getValue()) ) return aRet; break;
+ case TypeClass_UNSIGNED_SHORT: if( *static_cast<sal_uInt16 const *>(aRet.getValue()) ) return aRet; break;
+ case TypeClass_UNSIGNED_LONG: if( *static_cast<sal_uInt32 const *>(aRet.getValue()) ) return aRet; break;
default:
OSL_ASSERT(false);
diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx
index b7a0186afb4b..11ec7231fa52 100644
--- a/comphelper/source/misc/syntaxhighlight.cxx
+++ b/comphelper/source/misc/syntaxhighlight.cxx
@@ -241,7 +241,7 @@ static const char* strListSqlKeyWords[] = {
extern "C" int compare_strings( const void *arg1, const void *arg2 )
{
- return strcmp( (char *)arg1, *(char **)arg2 );
+ return strcmp( static_cast<char const *>(arg1), *static_cast<char * const *>(arg2) );
}
diff --git a/comphelper/source/misc/types.cxx b/comphelper/source/misc/types.cxx
index 8bee20711804..bb060c4ea912 100644
--- a/comphelper/source/misc/types.cxx
+++ b/comphelper/source/misc/types.cxx
@@ -123,7 +123,7 @@ bool getBOOL(const Any& _rAny)
{
bool nReturn = false;
if (_rAny.getValueType() == ::getCppuBooleanType())
- nReturn = *(sal_Bool*)_rAny.getValue();
+ nReturn = *static_cast<sal_Bool const *>(_rAny.getValue());
else
OSL_FAIL("comphelper::getBOOL : invalid argument !");
return nReturn;
@@ -295,7 +295,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue)
bConversionSuccess = _rValue >>= aTemp;
if (bConversionSuccess)
{
- bRes = *(FontDescriptor*)pData == aTemp;
+ bRes = *static_cast<FontDescriptor const *>(pData) == aTemp;
}
else
bRes = false;