Silence some warnings: a false positive about no-value return, and
authorMichael Matz <matz@suse.de>
Tue, 1 Apr 2008 23:11:10 +0000 (23:11 +0000)
committerMichael Matz <matz@suse.de>
Tue, 1 Apr 2008 23:11:10 +0000 (23:11 +0000)
using the deprecated Dependencies class in the dump function for it
(which itself also is deprecated and then doesn't warn anymore).
The helixXML() function was completely unused, so removing that too.
And NVRAD inherits from Dependencies, hence also is deprecated
(unfortunately that doesn't silence the warning for its uses of
Dependencies).

zypp/Dependencies.h
zypp/NVRAD.h
zypp/Resolver.cc
zypp/solver/detail/Testcase.cc
zypp/solver/detail/Testcase.h

index b4577ad..37c2404 100644 (file)
@@ -42,7 +42,7 @@ namespace zypp
   ///////////////////////////////////////////////////////////////////
 
   /** \relates Dependencies Stream output */
-  std::ostream & operator<<( std::ostream & str, const Dependencies & obj );
+  std::ostream & operator<<( std::ostream & str, const Dependencies & obj ) ZYPP_DEPRECATED;
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
index 798aa76..5cd704c 100644 (file)
@@ -29,7 +29,7 @@ namespace zypp
    * \note Stream output and comaprison operators based on
    * \ref NVRA.
   */
-  struct NVRAD : public NVRA, public Dependencies
+  struct ZYPP_DEPRECATED NVRAD : public NVRA, public Dependencies
   {
     /** Default ctor */
     NVRAD()
@@ -69,7 +69,7 @@ namespace zypp
   ///////////////////////////////////////////////////////////////////
 
   /** \relates NVRAD Stream output */
-  std::ostream & operator<<( std::ostream & str, const NVRAD & obj );
+  std::ostream & operator<<( std::ostream & str, const NVRAD & obj ) ZYPP_DEPRECATED;
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
index 101501a..372513d 100644 (file)
@@ -84,6 +84,7 @@ namespace zypp
   bool Resolver::onlyRequires()
   {
       switch (_pimpl->onlyRequires()) {
+         default: // to silence compiler warnings about no-value returns
          case DEFAULT:
              return ZConfig::instance().solver_onlyRequires();
          case TRUE:
index 58eac7d..3f5ad64 100644 (file)
@@ -172,32 +172,6 @@ std::string helixXML( const CapabilitySet &caps )
     return str.str();
 }
 
-
-template<>
-std::string helixXML( const Dependencies &dep )
-{
-    stringstream str;
-    if ( dep[Dep::PROVIDES].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::PROVIDES]), "provides") << endl;
-    if ( dep[Dep::CONFLICTS].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::CONFLICTS]), "conflicts") << endl;
-    if ( dep[Dep::OBSOLETES].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::OBSOLETES]), "obsoletes") << endl;
-    if ( dep[Dep::FRESHENS].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::FRESHENS]), "freshens") << endl;
-    if ( dep[Dep::REQUIRES].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::REQUIRES]), "requires") << endl;
-    if ( dep[Dep::RECOMMENDS].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::RECOMMENDS]), "recommends") << endl;
-    if ( dep[Dep::ENHANCES].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::ENHANCES]), "enhances") << endl;
-    if ( dep[Dep::SUPPLEMENTS].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::SUPPLEMENTS]), "supplements") << endl;
-    if ( dep[Dep::SUGGESTS].size() > 0 )
-       str << TAB << xml_tag_enclose(helixXML(dep[Dep::SUGGESTS]), "suggests") << endl;
-    return str.str();
-}
-
 inline string helixXML( const Resolvable::constPtr &obj, Dep deptag_r )
 {
   stringstream out;
index 8176c64..ee20f56 100644 (file)
@@ -55,9 +55,6 @@ template<>
 std::string helixXML( const CapabilitySet &caps );
 
 template<> 
-std::string helixXML( const Dependencies &dep );
-       
-template<> 
 std::string helixXML( const PoolItem &item );