diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-12-08 18:57:27 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-12-08 23:14:49 +0100 |
commit | 2ec698b43313c18522b45b28895cd5688a84a700 (patch) | |
tree | 13fe01cd548f8820e32435adbe1d346fd164ff34 /comphelper | |
parent | b45cbaa2ea50b2b6f28e78888bbae121deb8558c (diff) |
cppcheck: fix some reports
variableScope reports in comphelper/drawinglayer/editeng
+filter/framework/l10ntools
Change-Id: I4575428773e8b9b3efedabb44fdcd6d8175ac46a
Reviewed-on: https://gerrit.libreoffice.org/46116
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/backupfilehelper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/windows/windows_process.cxx | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index 614789a3bcbc..85d8b2052d44 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -1620,8 +1620,6 @@ namespace bool tryPop(oslFileHandle& rHandle) { - bool bRetval(false); - if (!maPackedFileEntryVector.empty()) { // already backups there, check if different from last entry @@ -1630,7 +1628,7 @@ namespace // here the uncompress flag has to be determined, true // means to add the file compressed, false means to add it // uncompressed - bRetval = aLastEntry.copy_content(rHandle, true); + bool bRetval = aLastEntry.copy_content(rHandle, true); if (bRetval) { diff --git a/comphelper/source/windows/windows_process.cxx b/comphelper/source/windows/windows_process.cxx index e71f28be545b..f334cfc4ffbe 100644 --- a/comphelper/source/windows/windows_process.cxx +++ b/comphelper/source/windows/windows_process.cxx @@ -21,7 +21,6 @@ */ static int ArgStrLen(const wchar_t *s) { - int backslashes = 0; int i = wcslen(s); BOOL hasDoubleQuote = wcschr(s, L'"') != nullptr; // Only add doublequotes if the string contains a space or a tab @@ -34,6 +33,7 @@ static int ArgStrLen(const wchar_t *s) if (hasDoubleQuote) { + int backslashes = 0; while (*s) { if (*s == '\\') @@ -69,7 +69,6 @@ static int ArgStrLen(const wchar_t *s) */ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) { - int backslashes = 0; BOOL hasDoubleQuote = wcschr(s, L'"') != nullptr; // Only add doublequotes if the string contains a space or a tab BOOL addDoubleQuotes = wcspbrk(s, L" \t") != nullptr; @@ -82,7 +81,7 @@ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) if (hasDoubleQuote) { - int i; + int backslashes = 0; while (*s) { if (*s == '\\') @@ -94,7 +93,7 @@ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) if (*s == '"') { // Escape the doublequote and all backslashes preceding the doublequote - for (i = 0; i <= backslashes; ++i) + for (int i = 0; i <= backslashes; ++i) { *d = '\\'; ++d; |