Kaydet (Commit) 5e3a76a8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More loplugin:cstylecast: xmlhelp

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: Ieee6d6e7246ac03e06a10455c8ad0aaf7caa48a9
üst 55f07d4d
...@@ -90,7 +90,7 @@ XInputStream_impl::readBytes( ...@@ -90,7 +90,7 @@ XInputStream_impl::readBytes(
// if any code relies on this, so be conservative---SB): // if any code relies on this, so be conservative---SB):
if (nBytesRead != sal::static_int_cast<sal_uInt64>(nBytesToRead) ) if (nBytesRead != sal::static_int_cast<sal_uInt64>(nBytesToRead) )
aData.realloc(sal_Int32(nBytesRead)); aData.realloc(sal_Int32(nBytesRead));
return ( sal_Int32 ) nBytesRead; return static_cast<sal_Int32>(nBytesRead);
} }
sal_Int32 SAL_CALL sal_Int32 SAL_CALL
......
...@@ -45,7 +45,7 @@ namespace chelp { ...@@ -45,7 +45,7 @@ namespace chelp {
{ {
if( m_ptr ) if( m_ptr )
{ {
sal_Int32 sizeOfFile = ( sal_Int32 ) m_ptr[0]; sal_Int32 sizeOfFile = static_cast<sal_Int32>(m_ptr[0]);
OUString Hash( m_ptr+1,sizeOfFile,RTL_TEXTENCODING_UTF8 ); OUString Hash( m_ptr+1,sizeOfFile,RTL_TEXTENCODING_UTF8 );
sal_Int32 idx; sal_Int32 idx;
if( ( idx = Hash.indexOf( u'#' ) ) != -1 ) if( ( idx = Hash.indexOf( u'#' ) ) != -1 )
...@@ -60,7 +60,7 @@ namespace chelp { ...@@ -60,7 +60,7 @@ namespace chelp {
if( ! m_ptr ) if( ! m_ptr )
return OUString(); return OUString();
sal_Int32 sizeOfFile = ( sal_Int32 ) m_ptr[0]; sal_Int32 sizeOfFile = static_cast<sal_Int32>(m_ptr[0]);
OUString File( m_ptr+1,sizeOfFile,RTL_TEXTENCODING_UTF8 ); OUString File( m_ptr+1,sizeOfFile,RTL_TEXTENCODING_UTF8 );
sal_Int32 idx; sal_Int32 idx;
if( ( idx = File.indexOf( u'#' ) ) != -1 ) if( ( idx = File.indexOf( u'#' ) ) != -1 )
...@@ -75,8 +75,8 @@ namespace chelp { ...@@ -75,8 +75,8 @@ namespace chelp {
if( ! m_ptr ) if( ! m_ptr )
return OUString(); return OUString();
sal_Int32 sizeOfDatabase = ( int ) m_ptr[ 1+ ( sal_Int32 ) m_ptr[0] ]; sal_Int32 sizeOfDatabase = static_cast<int>(m_ptr[ 1+ static_cast<sal_Int32>(m_ptr[0]) ]);
return OUString( m_ptr + 2 + ( sal_Int32 ) m_ptr[0],sizeOfDatabase,RTL_TEXTENCODING_UTF8 ); return OUString( m_ptr + 2 + static_cast<sal_Int32>(m_ptr[0]),sizeOfDatabase,RTL_TEXTENCODING_UTF8 );
} }
...@@ -91,7 +91,7 @@ namespace chelp { ...@@ -91,7 +91,7 @@ namespace chelp {
//than 127 defaults to a negative value, casting it would allow up //than 127 defaults to a negative value, casting it would allow up
//to 255 but instead make use of the null termination to avoid //to 255 but instead make use of the null termination to avoid
//running into a later problem with strings >= 255 //running into a later problem with strings >= 255
const sal_Char* pTitle = m_ptr + 3 + m_ptr[0] + ( sal_Int32 ) m_ptr[ 1+ ( sal_Int32 ) m_ptr[0] ]; const sal_Char* pTitle = m_ptr + 3 + m_ptr[0] + static_cast<sal_Int32>(m_ptr[ 1+ static_cast<sal_Int32>(m_ptr[0]) ]);
return OUString(pTitle, rtl_str_getLength(pTitle), RTL_TEXTENCODING_UTF8); return OUString(pTitle, rtl_str_getLength(pTitle), RTL_TEXTENCODING_UTF8);
} }
......
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