diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:10:13 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:10:13 +0100 |
commit | 115d39a27d29019640a7feb8e8d7da08509892b6 (patch) | |
tree | 4e01efab93cac71dac48f9322d1ef9f9083193a1 /writerperfect | |
parent | dec5264878903ee010e9a6296357750f6c69c844 (diff) |
More loplugin:cstylecast: writerperfect
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: I4698e9413b00e9bfe472393bf368f6aca0fd98c0
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/source/common/DocumentHandler.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/common/WPXSvInputStream.cxx | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx index 414491bdecc0..cba9a983aae9 100644 --- a/writerperfect/source/common/DocumentHandler.cxx +++ b/writerperfect/source/common/DocumentHandler.cxx @@ -154,7 +154,7 @@ void DocumentHandler::startElement(const char *psName, const librevenge::RVNGPro if (keyLength==listEncodedLength[j] && strncmp(i.key(), listEncoded[j], keyLength)==0) { librevenge::RVNGString decodedValue(""); - unescapeXML(i()->getStr().cstr(), (unsigned long) strlen(i()->getStr().cstr()), decodedValue); + unescapeXML(i()->getStr().cstr(), static_cast<unsigned long>(strlen(i()->getStr().cstr())), decodedValue); sValue=OUString(decodedValue.cstr(), strlen(decodedValue.cstr()), RTL_TEXTENCODING_UTF8); break; } diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index d65c057e5beb..c44175e5f485 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -513,7 +513,7 @@ long WPXSvInputStreamImpl::tell() const sal_Int64 tmpPosition = mxSeekable->getPosition(); if ((tmpPosition < 0) || (tmpPosition > LONG_MAX)) return -1; - return (long)tmpPosition; + return static_cast<long>(tmpPosition); } } @@ -732,7 +732,7 @@ void WPXSvInputStreamImpl::invalidateReadBuffer() { if (mpReadBuffer) { - seek(tell() + (long)mnReadBufferPos - (long)mnReadBufferLength); + seek(tell() + static_cast<long>(mnReadBufferPos) - static_cast<long>(mnReadBufferLength)); mpReadBuffer = nullptr; mnReadBufferPos = 0; mnReadBufferLength = 0; @@ -848,12 +848,12 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon mpImpl->invalidateReadBuffer(); } - unsigned long curpos = (unsigned long) mpImpl->tell(); - if (curpos == (unsigned long)-1) // returned ERROR + unsigned long curpos = static_cast<unsigned long>(mpImpl->tell()); + if (curpos == static_cast<unsigned long>(-1)) // returned ERROR return nullptr; if ((curpos + numBytes < curpos) /*overflow*/ || - (curpos + numBytes >= (sal_uInt64)mpImpl->mnLength)) /*reading more than available*/ + (curpos + numBytes >= static_cast<sal_uInt64>(mpImpl->mnLength))) /*reading more than available*/ { numBytes = mpImpl->mnLength - curpos; } @@ -886,7 +886,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon long WPXSvInputStream::tell() { long retVal = mpImpl->tell(); - return retVal - (long)mpImpl->mnReadBufferLength + (long)mpImpl->mnReadBufferPos; + return retVal - static_cast<long>(mpImpl->mnReadBufferLength) + static_cast<long>(mpImpl->mnReadBufferPos); } int WPXSvInputStream::seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) @@ -909,9 +909,9 @@ int WPXSvInputStream::seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) retVal = -1; } - if (tmpOffset < mpImpl->tell() && (unsigned long)tmpOffset >= (unsigned long)mpImpl->tell() - mpImpl->mnReadBufferLength) + if (tmpOffset < mpImpl->tell() && static_cast<unsigned long>(tmpOffset) >= static_cast<unsigned long>(mpImpl->tell()) - mpImpl->mnReadBufferLength) { - mpImpl->mnReadBufferPos = (unsigned long)(tmpOffset + (long) mpImpl->mnReadBufferLength - mpImpl->tell()); + mpImpl->mnReadBufferPos = static_cast<unsigned long>(tmpOffset + static_cast<long>(mpImpl->mnReadBufferLength) - mpImpl->tell()); return retVal; } |