summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-10-12 07:45:01 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-12 06:52:56 +0000
commitccc5ea08d64c38a9ce925d448c3010aca19ed35c (patch)
treee50c45ee596185f9a030641465796394c71ad410 /sal
parent898aff0d190b09d16cce866909b64cf023cba43f (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 'sal')
-rw-r--r--sal/osl/unx/nlsupport.cxx3
-rw-r--r--sal/qa/osl/file/osl_File.cxx40
2 files changed, 21 insertions, 22 deletions
diff --git a/sal/osl/unx/nlsupport.cxx b/sal/osl/unx/nlsupport.cxx
index 0f6d28c2f8c7..6a322d8ec708 100644
--- a/sal/osl/unx/nlsupport.cxx
+++ b/sal/osl/unx/nlsupport.cxx
@@ -789,7 +789,6 @@ rtl_TextEncoding osl_getTextEncodingFromLocale( rtl_Locale * pLocale )
{
const _pair *language = 0;
char locale_buf[64] = "";
- char *cp;
/* default to process locale if pLocale == NULL */
if( NULL == pLocale )
@@ -808,7 +807,7 @@ rtl_TextEncoding osl_getTextEncodingFromLocale( rtl_Locale * pLocale )
* e.g. de.ISO8859-15 or de.ISO8859-15@euro which strongly indicates what
* charset to use
*/
- cp = strrchr( locale_buf, '.' );
+ char* cp = strrchr( locale_buf, '.' );
if( NULL != cp )
{
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index a99cc15b82fe..90b976591933 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -1566,32 +1566,32 @@ namespace osl_FileStatus
void check_FileType(osl::FileStatus const& _rFileStatus )
{
- bool bOK = false;
- if ( _rFileStatus.isValid(osl_FileStatus_Mask_FileName))
+ if ( _rFileStatus.isValid(osl_FileStatus_Mask_FileName))
+ {
+ rtl::OUString suFilename = _rFileStatus.getFileName();
+
+ if ( _rFileStatus.isValid(osl_FileStatus_Mask_Type))
{
- rtl::OUString suFilename = _rFileStatus.getFileName();
+ osl::FileStatus::Type eType = _rFileStatus.getFileType();
+ bool bOK = false;
- if ( _rFileStatus.isValid(osl_FileStatus_Mask_Type))
+ if ( compareFileName( suFilename, aTmpName2) )
{
- osl::FileStatus::Type eType = _rFileStatus.getFileType();
-
- if ( compareFileName( suFilename, aTmpName2) )
- {
- // regular
- bOK = ( eType == osl::FileStatus::Regular );
- }
- if ( compareFileName( suFilename, aTmpName1) )
- {
- // directory
- bOK = ( eType == ::osl::FileStatus::Directory );
- }
+ // regular
+ bOK = ( eType == osl::FileStatus::Regular );
+ }
+ if ( compareFileName( suFilename, aTmpName1) )
+ {
+ // directory
+ bOK = ( eType == ::osl::FileStatus::Directory );
+ }
- CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: ",
- bOK );
- }
+ CPPUNIT_ASSERT_MESSAGE( "test for getFileType function: ",
+ bOK );
}
- // LLA: it's not a bug, if a FileStatus not exist, so no else
}
+ // LLA: it's not a bug, if a FileStatus not exist, so no else
+ }
void getFileType_002()
{