From bdff0bb77b57def835fcaed3bded7519e69dc896 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 26 Apr 2022 15:08:36 +0200 Subject: Use o3tl::make_unsigned in some places ...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- unotools/source/i18n/localedatawrapper.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'unotools') diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index fa30ceb9b5a1..9c4c5badabe3 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -376,7 +377,7 @@ const OUString& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const const OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const { - if ( nWord < 0 || nWord >= static_cast(aReservedWords.size()) ) + if ( nWord < 0 || o3tl::make_unsigned(nWord) >= aReservedWords.size() ) { SAL_WARN( "unotools.i18n", "getOneReservedWord: bounds" ); static const OUString EMPTY; -- cgit