diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-10-24 22:04:45 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-10-24 22:04:45 +0200 |
commit | 8be8bcf76de7fcc5c91480583a79a565c7693733 (patch) | |
tree | d2eb3d3717fc26fd9ecdafecbf3603691c275533 | |
parent | f260c656da4457c5d87c161bdd43ad3023d07472 (diff) |
desktop: try to cope with MSVC being silly with C4702 and C4715
Change-Id: I9812079bd9987c841dd1856573de768d7192873b
-rw-r--r-- | desktop/source/deployment/dp_persmap.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index fb7aecad00ba..047ad5331e6c 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -122,6 +122,14 @@ bool PersistentMap::has( OString const & key ) const return get( 0, key ); } +// for 3 functions here MSVC gives C4702 "unreachable code" if optimization +// is enabled and return is there and C4715 "not all control paths return +// a value" if optimization disabled and no return... +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable: 4702 ) +#endif + //______________________________________________________________________________ bool PersistentMap::get( OString * value, OString const & key ) const { @@ -144,9 +152,7 @@ bool PersistentMap::get( OString * value, OString const & key ) const catch (DbException & exc) { throw_rtexc( exc.get_errno(), exc.what() ); } -#ifndef _MSC_VER return false; // avoiding warning -#endif } //______________________________________________________________________________ @@ -194,9 +200,7 @@ bool PersistentMap::erase( OString const & key, bool flush_immediately ) catch (DbException & exc) { throw_rtexc( exc.get_errno(), exc.what() ); } -#ifndef _MSC_VER return false; // avoiding warning -#endif } //______________________________________________________________________________ @@ -235,11 +239,13 @@ t_string2string_map PersistentMap::getEntries() const catch (DbException & exc) { throw_rtexc( exc.get_errno(), exc.what() ); } -#ifndef _MSC_VER return t_string2string_map(); // avoiding warning -#endif } +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |