diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-11-07 15:11:07 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-11-08 07:15:28 +0100 |
commit | c8eaebecd3af29c031c26142c9d3f7d7abf75b0d (patch) | |
tree | 52a57ba6ca5255e694b333663131c6a1efc03ff1 /include/rtl | |
parent | 1ec337b100755f7ad8cd5cb2c8acb072c6f18964 (diff) |
Avoid an explicit static_cast
...when shoehorning a std::size_t value into sal_Int32, to not suppress
potential warnings from tools like -fsanitize=implicit-signed-integer-truncation
and -fsanitize=implicit-integer-sign-change
Change-Id: I610410f7cd69769c3721b2019e16b4c9f214ad81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142407
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r-- | include/rtl/ustring.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index d7d529f55e3f..16ccecedd7a9 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -163,7 +163,7 @@ public: /** make it easier to pass to OUStringBuffer and similar without casting/converting */ - constexpr std::u16string_view asView() const { return {pData->buffer, static_cast<sal_uInt32>(pData->length)}; } + constexpr std::u16string_view asView() const { return std::u16string_view(pData->buffer, pData->length); } inline operator const OUString&() const; |