Kaydet (Commit) 71a6caf4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More loplugin:cstylecast: cppuhelper

auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I3966d302241a52014aaad41f72924a2095ea6621
üst f6e256c4
...@@ -115,8 +115,8 @@ namespace cppu_ifcontainer ...@@ -115,8 +115,8 @@ namespace cppu_ifcontainer
aElements = pContainer->getElements(); aElements = pContainer->getElements();
CPPUNIT_ASSERT_MESSAGE("query contents", CPPUNIT_ASSERT_MESSAGE("query contents",
bool((int)aElements.getLength() == nTests)); bool(static_cast<int>(aElements.getLength()) == nTests));
if ((int)aElements.getLength() == nTests) if (static_cast<int>(aElements.getLength()) == nTests)
{ {
for (i = 0; i < nTests; i++) for (i = 0; i < nTests; i++)
{ {
......
...@@ -373,7 +373,7 @@ Sequence< Type > OMultiTypeInterfaceContainerHelper::getContainedTypes() const ...@@ -373,7 +373,7 @@ Sequence< Type > OMultiTypeInterfaceContainerHelper::getContainedTypes() const
pArray[i++] = (*iter).first; pArray[i++] = (*iter).first;
++iter; ++iter;
} }
if( (t_type2ptr::size_type)i != nSize ) { if( static_cast<t_type2ptr::size_type>(i) != nSize ) {
// may be empty container, reduce the sequence to the right size // may be empty container, reduce the sequence to the right size
aInterfaceTypes = css::uno::Sequence< Type >( pArray, i ); aInterfaceTypes = css::uno::Sequence< Type >( pArray, i );
} }
...@@ -554,7 +554,7 @@ Sequence< sal_Int32 > OMultiTypeInterfaceContainerHelperInt32::getContainedTypes ...@@ -554,7 +554,7 @@ Sequence< sal_Int32 > OMultiTypeInterfaceContainerHelperInt32::getContainedTypes
pArray[i++] = (*iter).first; pArray[i++] = (*iter).first;
++iter; ++iter;
} }
if( (t_long2ptr::size_type)i != nSize ) { if( static_cast<t_long2ptr::size_type>(i) != nSize ) {
// may be empty container, reduce the sequence to the right size // may be empty container, reduce the sequence to the right size
aInterfaceTypes = css::uno::Sequence< sal_Int32 >( pArray, i ); aInterfaceTypes = css::uno::Sequence< sal_Int32 >( pArray, i );
} }
......
...@@ -1118,7 +1118,7 @@ sal_Int32 OPropertyArrayHelper::fillHandles( sal_Int32 * pHandles, const Sequenc ...@@ -1118,7 +1118,7 @@ sal_Int32 OPropertyArrayHelper::fillHandles( sal_Int32 * pHandles, const Sequenc
for( sal_Int32 i = 0; i < nReqLen; i++ ) for( sal_Int32 i = 0; i < nReqLen; i++ )
{ {
// Calculate logarithm // Calculate logarithm
sal_Int32 n = (sal_Int32)(pEnd - pCur); sal_Int32 n = static_cast<sal_Int32>(pEnd - pCur);
sal_Int32 nLog = 0; sal_Int32 nLog = 0;
while( n ) while( n )
{ {
......
...@@ -501,7 +501,7 @@ struct SAL_WARN_UNUSED OBroadcastHelperVar ...@@ -501,7 +501,7 @@ struct SAL_WARN_UNUSED OBroadcastHelperVar
struct hashType_Impl struct hashType_Impl
{ {
size_t operator()(const css::uno::Type & s) const size_t operator()(const css::uno::Type & s) const
{ return (size_t) s.getTypeName().hashCode(); } { return static_cast<size_t>(s.getTypeName().hashCode()); }
}; };
......
...@@ -88,7 +88,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int64 & i , const css::uno::Any ...@@ -88,7 +88,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int64 & i , const css::uno::Any
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
i = ( sal_Int64 ) c; i = static_cast<sal_Int64>(c);
break; break;
} }
default: default:
...@@ -109,7 +109,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt64 & i , const css::uno::Any ...@@ -109,7 +109,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt64 & i , const css::uno::Any
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
i = ( sal_uInt64 ) c; i = static_cast<sal_uInt64>(c);
break; break;
} }
default: default:
...@@ -129,7 +129,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int32 & i , const css::uno::Any ...@@ -129,7 +129,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int32 & i , const css::uno::Any
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
i = ( sal_Int32 ) c; i = static_cast<sal_Int32>(c);
break; break;
} }
default: default:
...@@ -149,7 +149,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt32 & i , const css::uno::Any ...@@ -149,7 +149,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt32 & i , const css::uno::Any
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
i = ( sal_uInt32 ) c; i = static_cast<sal_uInt32>(c);
break; break;
} }
default: default:
...@@ -169,7 +169,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int16 & i , const css::uno::Any ...@@ -169,7 +169,7 @@ inline void SAL_CALL convertPropertyValue( sal_Int16 & i , const css::uno::Any
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
i = ( sal_Int16 ) c; i = static_cast<sal_Int16>(c);
break; break;
} }
default: default:
...@@ -189,7 +189,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt16 & i , const css::uno::Any ...@@ -189,7 +189,7 @@ inline void SAL_CALL convertPropertyValue( sal_uInt16 & i , const css::uno::Any
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
i = ( sal_Int16 ) c; i = static_cast<sal_Int16>(c);
break; break;
} }
default: default:
...@@ -237,7 +237,7 @@ inline void SAL_CALL convertPropertyValue( float &f , const css::uno::Any &a ) ...@@ -237,7 +237,7 @@ inline void SAL_CALL convertPropertyValue( float &f , const css::uno::Any &a )
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
f = ( float ) c; f = static_cast<float>(c);
break; break;
} }
default: default:
...@@ -263,7 +263,7 @@ inline void SAL_CALL convertPropertyValue( double &d , const css::uno::Any &a ) ...@@ -263,7 +263,7 @@ inline void SAL_CALL convertPropertyValue( double &d , const css::uno::Any &a )
{ {
sal_Unicode c; sal_Unicode c;
c = *static_cast<sal_Unicode const *>(a.getValue()); c = *static_cast<sal_Unicode const *>(a.getValue());
d = (double) c; d = static_cast<double>(c);
break; break;
} }
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment