diff options
author | Tor Lillqvist <tml@iki.fi> | 2011-09-29 00:17:38 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2011-09-29 00:54:43 +0300 |
commit | 15759b8c9423c8f3fd0be97566698bf94535875a (patch) | |
tree | 0d20d145a0169a0267dc19a039ca2e9f29657c7f /fpicker/source/aqua/SalAquaPicker.cxx | |
parent | 7743899403177a53c782822e66d21aaf4043dd65 (diff) |
Avoid "jump to case label crosses initialization" errors with gcc 4.2.1
Reduce scope of variables declared inside a switch statement. OK, so
make those code snippets into blocks then, to reduce the scope of
those variables. Workaround for weird errors as reported by gcc 4.2.1
in the 10.6 SDK:
SalAquaPicker.cxx: In member function 'void SalAquaPicker::implInitialize()':
SalAquaPicker.cxx:134: error: jump to case label
SalAquaPicker.cxx:127: error: crosses initialization of 'NSNumber* pExtn'
SalAquaPicker.cxx:126: error: crosses initialization of 'NSUserDefaults* pDefaults'
SalAquaPicker.cxx:141: error: jump to case label
SalAquaPicker.cxx:127: error: crosses initialization of 'NSNumber* pExtn'
SalAquaPicker.cxx:126: error: crosses initialization of 'NSUserDefaults* pDefaults'
Diffstat (limited to 'fpicker/source/aqua/SalAquaPicker.cxx')
-rw-r--r-- | fpicker/source/aqua/SalAquaPicker.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx index 43962a30d3d5..07534a2f401a 100644 --- a/fpicker/source/aqua/SalAquaPicker.cxx +++ b/fpicker/source/aqua/SalAquaPicker.cxx @@ -123,11 +123,13 @@ void SAL_CALL SalAquaPicker::implInitialize() * So the only reliable way seems to be using the NSUserDefaults object because that is where that value is stored and * to just overwrite it if it has the wrong value. */ - NSUserDefaults *pDefaults = [NSUserDefaults standardUserDefaults]; - NSNumber *pExtn = [pDefaults objectForKey:kSetHideExtensionStateKey]; - if(pExtn == nil || [pExtn boolValue] == NO) { - OSL_TRACE("Hiding extension"); - [pDefaults setBool:YES forKey:kSetHideExtensionStateKey]; + { + NSUserDefaults *pDefaults = [NSUserDefaults standardUserDefaults]; + NSNumber *pExtn = [pDefaults objectForKey:kSetHideExtensionStateKey]; + if(pExtn == nil || [pExtn boolValue] == NO) { + OSL_TRACE("Hiding extension"); + [pDefaults setBool:YES forKey:kSetHideExtensionStateKey]; + } } break; |