diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2015-08-22 11:58:11 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-08-22 13:02:08 +0000 |
commit | 25accda781bc0bc79ca2e887c54ca981068bf407 (patch) | |
tree | 0f551b4f516dd289df523d71bff08a26de2c3622 /onlineupdate/source | |
parent | 159bace378aefa5e48967f1e5089acef9a7f2378 (diff) |
tdf#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I6ab170c4426494ab9fc53017f88e47fbfdbd9aad
Reviewed-on: https://gerrit.libreoffice.org/17920
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'onlineupdate/source')
-rw-r--r-- | onlineupdate/source/update/updater/archivereader.cxx | 4 | ||||
-rw-r--r-- | onlineupdate/source/update/updater/nsWindowsRestart.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/onlineupdate/source/update/updater/archivereader.cxx b/onlineupdate/source/update/updater/archivereader.cxx index 4629d330e5cc..a7884df2d8de 100644 --- a/onlineupdate/source/update/updater/archivereader.cxx +++ b/onlineupdate/source/update/updater/archivereader.cxx @@ -273,7 +273,7 @@ ArchiveReader::ExtractItemToStream(const MarItem *item, FILE *fp) /* decompress the data chunk by chunk */ bz_stream strm; - int offset, inlen, outlen, ret = OK; + int offset, inlen, ret = OK; memset(&strm, 0, sizeof(strm)); if (BZ2_bzDecompressInit(&strm, 0, 0) != BZ_OK) @@ -304,7 +304,7 @@ ArchiveReader::ExtractItemToStream(const MarItem *item, FILE *fp) break; } - outlen = outbuf_size - strm.avail_out; + int outlen = outbuf_size - strm.avail_out; if (outlen) { if (fwrite(outbuf, outlen, 1, fp) != 1) { ret = WRITE_ERROR_EXTRACT; diff --git a/onlineupdate/source/update/updater/nsWindowsRestart.cxx b/onlineupdate/source/update/updater/nsWindowsRestart.cxx index 5ecf70e2aac8..fbc9b863c475 100644 --- a/onlineupdate/source/update/updater/nsWindowsRestart.cxx +++ b/onlineupdate/source/update/updater/nsWindowsRestart.cxx @@ -345,7 +345,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; @@ -356,6 +355,7 @@ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) } if (hasDoubleQuote) { + int backslashes = 0; int i; while (*s) { if (*s == '\\') { |