From f4b6cee77e1725837f9a6044fec0b561c7049c3b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 3 Jun 2022 10:22:43 +0200 Subject: Use o3tl::make_unsigned, OString::getLength() is guaranteed to be non-negative Change-Id: Ibddd4f2b3d8680c94fd0ab45f6ed6204215c6009 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- desktop/source/deployment/dp_persmap.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index 652e5d2ea5ff..8b032fffb96e 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -243,13 +244,13 @@ void PersistentMap::flush() const OString aKeyString = encodeString( entry.first); const sal_Int32 nKeyLen = aKeyString.getLength(); m_MapFile.write( aKeyString.getStr(), nKeyLen, nBytesWritten); - OSL_ASSERT( nKeyLen == static_cast(nBytesWritten)); + OSL_ASSERT( o3tl::make_unsigned(nKeyLen) == nBytesWritten); m_MapFile.write( "\n", 1, nBytesWritten); // write line for value const OString& rValString = encodeString( entry.second); const sal_Int32 nValLen = rValString.getLength(); m_MapFile.write( rValString.getStr(), nValLen, nBytesWritten); - OSL_ASSERT( nValLen == static_cast(nBytesWritten)); + OSL_ASSERT( o3tl::make_unsigned(nValLen) == nBytesWritten); m_MapFile.write( "\n", 1, nBytesWritten); } -- cgit