summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 18:58:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:17 +0100
commitc3fb36ed26a6c8dce0a8026ef8b75190955d2443 (patch)
tree45fa2dc122e76527b095f85eade049ea896b90d3 /basic
parent989f0ec5739ca00873d1c7b2b1617b1f354215f4 (diff)
Clean up C-style casts from pointers to void
Change-Id: I6dd7c7fbaf0d4b22abba0a7b1f5e37f0a46d0747
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/cppunit/basictest.hxx2
-rw-r--r--basic/source/basmgr/basmgr.cxx2
-rw-r--r--basic/source/classes/propacc.cxx12
-rw-r--r--basic/source/classes/sbunoobj.cxx18
-rw-r--r--basic/source/runtime/ddectrl.cxx2
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--basic/source/runtime/runtime.cxx8
7 files changed, 23 insertions, 23 deletions
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index ceff6de2fb44..684da80cdc90 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -75,7 +75,7 @@ class MacroSnippet
{
if(size == size_read)
{
- OUString sCode((sal_Char*)buffer, size, RTL_TEXTENCODING_UTF8);
+ OUString sCode(static_cast<sal_Char*>(buffer), size, RTL_TEXTENCODING_UTF8);
sSource = sCode;
}
}
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index dd8c324c0ea9..3472015dafc9 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -2041,7 +2041,7 @@ uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog )
sal_Size nLen = aMemStream.Tell();
uno::Sequence< sal_Int8 > aData( nLen );
sal_Int8* pDestData = aData.getArray();
- const sal_Int8* pSrcData = (const sal_Int8*)aMemStream.GetData();
+ const sal_Int8* pSrcData = static_cast<const sal_Int8*>(aMemStream.GetData());
memcpy( pDestData, pSrcData, nLen );
return aData;
}
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx
index 9254982137d4..c8da6ca52ebd 100644
--- a/basic/source/classes/propacc.cxx
+++ b/basic/source/classes/propacc.cxx
@@ -42,8 +42,8 @@ struct SbCompare_UString_PropertyValue_Impl
extern "C" int SAL_CALL SbCompare_UString_Property_Impl( const void *arg1, const void *arg2 )
{
- const OUString *pArg1 = (OUString*) arg1;
- const Property *pArg2 = (Property*) arg2;
+ const OUString *pArg1 = static_cast<OUString const *>(arg1);
+ const Property *pArg2 = static_cast<Property const *>(arg2);
return pArg1->compareTo( pArg2->Name );
}
@@ -197,10 +197,10 @@ PropertySetInfoImpl::PropertySetInfoImpl()
sal_Int32 PropertySetInfoImpl::GetIndex_Impl( const OUString &rPropName ) const
{
Property *pP;
- pP = (Property*)
+ pP = static_cast<Property*>(
bsearch( &rPropName, _aProps.getConstArray(), _aProps.getLength(),
sizeof( Property ),
- SbCompare_UString_Property_Impl );
+ SbCompare_UString_Property_Impl ));
return pP ? sal::static_int_cast<sal_Int32>( pP - _aProps.getConstArray() ) : -1;
}
@@ -287,8 +287,8 @@ void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, bool bWrite
// Set PropertyValues
Any aArgAsAny = sbxToUnoValue( rPar.Get(1),
getCppuType( (Sequence<PropertyValue>*)0 ) );
- Sequence<PropertyValue> *pArg =
- (Sequence<PropertyValue>*) aArgAsAny.getValue();
+ Sequence<PropertyValue> const *pArg =
+ static_cast<Sequence<PropertyValue> const *>(aArgAsAny.getValue());
Reference< XPropertyAccess > xPropAcc = Reference< XPropertyAccess >::query( xInterface );
xPropAcc->setPropertyValues( *pArg );
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 77bb0f3c42c7..7a73a45a65a1 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -808,10 +808,10 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
break;
- case TypeClass_BOOLEAN: pVar->PutBool( *(sal_Bool*)aValue.getValue() ); break;
+ case TypeClass_BOOLEAN: pVar->PutBool( *static_cast<sal_Bool const *>(aValue.getValue()) ); break;
case TypeClass_CHAR:
{
- pVar->PutChar( *(sal_Unicode*)aValue.getValue() );
+ pVar->PutChar( *static_cast<sal_Unicode const *>(aValue.getValue()) );
break;
}
case TypeClass_STRING: { OUString val; aValue >>= val; pVar->PutString( val ); } break;
@@ -1623,7 +1623,7 @@ OUString getDbgObjectNameImpl( SbUnoObject* pUnoObj )
TypeClass eType = aToInspectObj.getValueType().getTypeClass();
Reference< XInterface > xObj;
if( eType == TypeClass_INTERFACE )
- xObj = *(Reference< XInterface >*)aToInspectObj.getValue();
+ xObj = *static_cast<Reference< XInterface > const *>(aToInspectObj.getValue());
if( xObj.is() )
{
Reference< XServiceInfo > xServiceInfo( xObj, UNO_QUERY );
@@ -1675,7 +1675,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const OUString& rClass )
{
return false;
}
- const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue();
+ const Reference< XInterface > x = *static_cast<Reference< XInterface > const *>(aToInspectObj.getValue());
// Return true for XInvocation based objects as interface type names don't count then
Reference< XInvocation > xInvocation( x, UNO_QUERY );
@@ -1778,7 +1778,7 @@ OUString Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
else
{
// get the interface from the Any
- const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue();
+ const Reference< XInterface > x = *static_cast<Reference< XInterface > const *>(aToInspectObj.getValue());
Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY );
@@ -2348,7 +2348,7 @@ SbUnoObject::SbUnoObject( const OUString& aName_, const Any& aUnoObj_ )
if( eType == TypeClass_INTERFACE )
{
// get the interface from the Any
- x = *(Reference< XInterface >*)aUnoObj_.getValue();
+ x = *static_cast<Reference< XInterface > const *>(aUnoObj_.getValue());
if( !x.is() )
return;
}
@@ -3144,7 +3144,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
// get the interface out of the Any
- Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue();
+ Reference< XInterface > x = *static_cast<Reference< XInterface > const *>(aAny.getValue());
// get CoreReflection
Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
@@ -3471,7 +3471,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
// Interface located? Then it is a class
if( eType == TypeClass_INTERFACE )
{
- Reference< XInterface > xIface = *(Reference< XInterface >*)aValue.getValue();
+ Reference< XInterface > xIface = *static_cast<Reference< XInterface > const *>(aValue.getValue());
Reference< XIdlClass > xClass( xIface, UNO_QUERY );
if( xClass.is() )
{
@@ -4813,7 +4813,7 @@ OUString StructRefInfo::getTypeName() const
void* StructRefInfo::getInst()
{
- return ((char*)maAny.getValue() + mnPos );
+ return const_cast<char *>(static_cast<char const *>(maAny.getValue()) + mnPos);
}
TypeClass StructRefInfo::getTypeClass() const
diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx
index 3e9cb9fb7b4d..4f7e208d33c6 100644
--- a/basic/source/runtime/ddectrl.cxx
+++ b/basic/source/runtime/ddectrl.cxx
@@ -69,7 +69,7 @@ SbError SbiDdeControl::GetLastErr( DdeConnection* pConv )
IMPL_LINK_INLINE( SbiDdeControl,Data , DdeData*, pData,
{
- aData = OUString::createFromAscii( (const char*)(const void*)*pData );
+ aData = OUString::createFromAscii( static_cast<const char*>((const void*)*pData) );
return 1;
}
)
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 82da67828eca..c39731612797 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -490,7 +490,7 @@ sal_Size UCBStream::PutData(const void* pData, sal_Size nSize)
Reference< XOutputStream > xOSFromS;
if( xS.is() && (xOSFromS = xS->getOutputStream()).is() )
{
- Sequence<sal_Int8> aData( (const sal_Int8 *)pData, nSize );
+ Sequence<sal_Int8> aData( static_cast<const sal_Int8 *>(pData), nSize );
xOSFromS->writeBytes( aData );
return nSize;
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 39be30272de6..122b8fccaad8 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -3741,7 +3741,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
{
- Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue();
+ Reference< XInterface > x = *static_cast<Reference< XInterface > const *>(aAny.getValue());
Reference< XDefaultMethod > xDfltMethod( x, UNO_QUERY );
OUString sDefaultMethod;
@@ -3869,7 +3869,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
{
- Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue();
+ Reference< XInterface > x = *static_cast<Reference< XInterface > const *>(aAny.getValue());
Reference< XIndexAccess > xIndexAccess( x, UNO_QUERY );
if ( !bVBAEnabled )
{
@@ -3891,7 +3891,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
TypeClass eType = aAny2.getValueType().getTypeClass();
if( eType == TypeClass_INTERFACE )
{
- xRet = *(Reference< XInterface >*)aAny2.getValue();
+ xRet = *static_cast<Reference< XInterface > const *>(aAny2.getValue());
}
}
catch (const IndexOutOfBoundsException&)
@@ -3939,7 +3939,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
Any aUnoAny = pUnoObj->getUnoAny();
if( aUnoAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
- x = *(Reference< XInterface >*)aUnoAny.getValue();
+ x = *static_cast<Reference< XInterface > const *>(aUnoAny.getValue());
pElem = pDflt;
}
}