diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-19 11:07:02 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-19 13:51:34 +0000 |
commit | 2ee336fb556ceb1d7e1ee8017c27539da7fe543b (patch) | |
tree | 7332ba839b28f112397104596a601c3506bd5973 /sal/rtl | |
parent | 5712983f18e7cdec16ea20a9b3d94a1586de543e (diff) |
fdo#39440 sal: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Id5f90757571e76a2c05a4cbd37020e1f6a6b2033
Reviewed-on: https://gerrit.libreoffice.org/13544
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/cipher.cxx | 6 | ||||
-rw-r--r-- | sal/rtl/ustring.cxx | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx index 236ac2fe6c0e..ba799ec846ca 100644 --- a/sal/rtl/cipher.cxx +++ b/sal/rtl/cipher.cxx @@ -1194,7 +1194,7 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( sal_uInt8 *pBuffer, sal_Size nBufLen) { unsigned int *S; - unsigned int x, y, t; + unsigned int t; sal_Size k; /* Check arguments. */ @@ -1209,8 +1209,8 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( for (k = 0; k < nDatLen; k++) { /* Update counters X and Y. */ - x = ctx->m_X; - y = ctx->m_Y; + unsigned int x = ctx->m_X; + unsigned int y = ctx->m_Y; x = (x + 1 ) % CIPHER_CBLOCK_ARCFOUR; y = (y + S[x]) % CIPHER_CBLOCK_ARCFOUR; ctx->m_X = x; diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx index 5f1c12a02061..b3eeac13226c 100644 --- a/sal/rtl/ustring.cxx +++ b/sal/rtl/ustring.cxx @@ -569,7 +569,6 @@ void SAL_CALL rtl_uString_newFromCodePoints( static int rtl_ImplGetFastUTF8UnicodeLen( const sal_Char* pStr, sal_Int32 nLen, bool * ascii ) { int n; - unsigned char c; const sal_Char* pEndStr; *ascii = true; @@ -577,7 +576,7 @@ static int rtl_ImplGetFastUTF8UnicodeLen( const sal_Char* pStr, sal_Int32 nLen, pEndStr = pStr+nLen; while ( pStr < pEndStr ) { - c = (unsigned char)*pStr; + unsigned char c = (unsigned char)*pStr; if ( !(c & 0x80) ) pStr++; |