[Libreoffice-commits] core.git: sal/osl

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 26 11:55:34 UTC 2020


 sal/osl/unx/file_url.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit a2f768f417f133fb2564ed5fe351662742dde274
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Jan 26 10:08:31 2020 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sun Jan 26 12:54:55 2020 +0100

    cppcheck: shadowFunction in sal/file_url
    
    Change-Id: I7454640278f4af0f71f429b45c9f1e40f7be0545
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87433
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 207bb907feaf..513b8661d406 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -138,10 +138,10 @@ namespace {
 
 bool convert(OUStringBuffer const & in, OStringBuffer * append) {
     assert(append != nullptr);
-    for (sal_Size convert = in.getLength();;) {
+    for (sal_Size nConvert = in.getLength();;) {
         auto const oldLen = append->getLength();
         auto n = std::min(
-            std::max(convert, sal_Size(PATH_MAX)),
+            std::max(nConvert, sal_Size(PATH_MAX)),
             sal_Size(std::numeric_limits<sal_Int32>::max() - oldLen));
             // approximation of required converted size
         auto s = append->appendUninitialized(n);
@@ -149,7 +149,7 @@ bool convert(OUStringBuffer const & in, OStringBuffer * append) {
         sal_Size converted;
         //TODO: context, for reliable treatment of DESTBUFFERTOSMALL:
         n = UnicodeToTextConverter_Impl::getInstance().convert(
-            in.getStr() + in.getLength() - convert, convert, s, n,
+            in.getStr() + in.getLength() - nConvert, nConvert, s, n,
             (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
              | RTL_UNICODETOTEXT_FLAGS_FLUSH),
             &info, &converted);
@@ -157,9 +157,9 @@ bool convert(OUStringBuffer const & in, OStringBuffer * append) {
             return false;
         }
         append->setLength(oldLen + n);
-        assert(converted <= convert);
-        convert -= converted;
-        assert((convert == 0) == ((info & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL) == 0));
+        assert(converted <= nConvert);
+        nConvert -= converted;
+        assert((nConvert == 0) == ((info & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL) == 0));
         if ((info & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL) == 0) {
             break;
         }


More information about the Libreoffice-commits mailing list