diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 07:45:01 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 06:52:56 +0000 |
commit | ccc5ea08d64c38a9ce925d448c3010aca19ed35c (patch) | |
tree | e50c45ee596185f9a030641465796394c71ad410 /onlineupdate | |
parent | 898aff0d190b09d16cce866909b64cf023cba43f (diff) |
cppcheck:variableScope
Change-Id: I037feb335499629300309851dcda3bb661f03d4f
Reviewed-on: https://gerrit.libreoffice.org/19316
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'onlineupdate')
-rw-r--r-- | onlineupdate/source/libmar/sign/mar_sign.c | 3 | ||||
-rw-r--r-- | onlineupdate/source/libmar/sign/nss_secutil.c | 2 | ||||
-rw-r--r-- | onlineupdate/source/libmar/src/mar_create.c | 3 | ||||
-rw-r--r-- | onlineupdate/source/update/src/mar_create.c | 3 | ||||
-rw-r--r-- | onlineupdate/source/update/updater/nsWindowsRestart.cxx | 2 |
5 files changed, 5 insertions, 8 deletions
diff --git a/onlineupdate/source/libmar/sign/mar_sign.c b/onlineupdate/source/libmar/sign/mar_sign.c index 4a5fe87fd402..3e7ef205d49c 100644 --- a/onlineupdate/source/libmar/sign/mar_sign.c +++ b/onlineupdate/source/libmar/sign/mar_sign.c @@ -159,13 +159,12 @@ WriteAndUpdateSignatures(FILE *fpDest, void *buffer, void AdjustIndexContentOffsets(char *indexBuf, uint32_t indexLength, uint32_t offsetAmount) { - uint32_t *offsetToContent; char *indexBufLoc = indexBuf; /* Consume the index and adjust each index by the specified amount */ while (indexBufLoc != (indexBuf + indexLength)) { /* Adjust the offset */ - offsetToContent = (uint32_t *)indexBufLoc; + uint32_t* offsetToContent = (uint32_t *)indexBufLoc; *offsetToContent = ntohl(*offsetToContent); *offsetToContent += offsetAmount; *offsetToContent = htonl(*offsetToContent); diff --git a/onlineupdate/source/libmar/sign/nss_secutil.c b/onlineupdate/source/libmar/sign/nss_secutil.c index 01aa5734e0a2..2fa53e7b81b8 100644 --- a/onlineupdate/source/libmar/sign/nss_secutil.c +++ b/onlineupdate/source/libmar/sign/nss_secutil.c @@ -25,7 +25,6 @@ static char consoleName[] = { #if defined(_WINDOWS) static char * quiet_fgets (char *buf, int length, FILE *input) { - int c; char *end = buf; /* fflush (input); */ @@ -37,6 +36,7 @@ static char * quiet_fgets (char *buf, int length, FILE *input) while (1) { + int c; #if defined (_WIN32_WCE) c = getchar(); /* gets a character from stdin */ #else diff --git a/onlineupdate/source/libmar/src/mar_create.c b/onlineupdate/source/libmar/src/mar_create.c index a87e937fe4a3..c874b44e96ec 100644 --- a/onlineupdate/source/libmar/src/mar_create.c +++ b/onlineupdate/source/libmar/src/mar_create.c @@ -198,7 +198,6 @@ refresh_product_info_block(const char *path, uint32_t numSignatures, additionalBlockSize, additionalBlockID, offsetAdditionalBlocks, numAdditionalBlocks, i; int additionalBlocks, hasSignatureBlock; - int64_t oldPos; rv = get_mar_file_info(path, &hasSignatureBlock, @@ -230,7 +229,7 @@ refresh_product_info_block(const char *path, for (i = 0; i < numAdditionalBlocks; ++i) { /* Get the position of the start of this block */ - oldPos = ftello(fp); + int64_t oldPos = ftello(fp); /* Read the additional block size */ if (fread(&additionalBlockSize, diff --git a/onlineupdate/source/update/src/mar_create.c b/onlineupdate/source/update/src/mar_create.c index a87e937fe4a3..c874b44e96ec 100644 --- a/onlineupdate/source/update/src/mar_create.c +++ b/onlineupdate/source/update/src/mar_create.c @@ -198,7 +198,6 @@ refresh_product_info_block(const char *path, uint32_t numSignatures, additionalBlockSize, additionalBlockID, offsetAdditionalBlocks, numAdditionalBlocks, i; int additionalBlocks, hasSignatureBlock; - int64_t oldPos; rv = get_mar_file_info(path, &hasSignatureBlock, @@ -230,7 +229,7 @@ refresh_product_info_block(const char *path, for (i = 0; i < numAdditionalBlocks; ++i) { /* Get the position of the start of this block */ - oldPos = ftello(fp); + int64_t oldPos = ftello(fp); /* Read the additional block size */ if (fread(&additionalBlockSize, diff --git a/onlineupdate/source/update/updater/nsWindowsRestart.cxx b/onlineupdate/source/update/updater/nsWindowsRestart.cxx index fbc9b863c475..27fe249e429f 100644 --- a/onlineupdate/source/update/updater/nsWindowsRestart.cxx +++ b/onlineupdate/source/update/updater/nsWindowsRestart.cxx @@ -304,7 +304,6 @@ private: */ 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 @@ -315,6 +314,7 @@ static int ArgStrLen(const wchar_t *s) } if (hasDoubleQuote) { + int backslashes = 0; while (*s) { if (*s == '\\') { ++backslashes; |