From bd15a678474b2d9a98d8d9b81d6be1ae7fc7fef5 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Fri, 18 Apr 2008 15:46:12 +0000 Subject: [PATCH] cleanup in order to avoid namespace-conflicts with the SAT-solver --- zypp/solver/detail/SATResolver.cc | 2 +- zypp/solver/detail/SolverQueueItem.cc | 4 ++++ zypp/solver/detail/SolverQueueItem.h | 6 ++---- zypp/solver/detail/SolverQueueItemDelete.cc | 10 ++++++++-- zypp/solver/detail/SolverQueueItemDelete.h | 2 +- zypp/solver/detail/SolverQueueItemInstall.cc | 11 +++++++++-- zypp/solver/detail/SolverQueueItemInstall.h | 2 +- zypp/solver/detail/SolverQueueItemInstallOneOf.cc | 7 ++++++- zypp/solver/detail/SolverQueueItemInstallOneOf.h | 2 +- zypp/solver/detail/SolverQueueItemLock.cc | 9 +++++++-- zypp/solver/detail/SolverQueueItemLock.h | 2 +- zypp/solver/detail/SolverQueueItemUpdate.cc | 9 +++++++-- zypp/solver/detail/SolverQueueItemUpdate.h | 2 +- 13 files changed, 49 insertions(+), 19 deletions(-) diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc index 071010876..472efd996 100644 --- a/zypp/solver/detail/SATResolver.cc +++ b/zypp/solver/detail/SATResolver.cc @@ -708,7 +708,7 @@ SATResolver::resolveQueue(const SolverQueueItemList &requestQueue) // generate solver queue for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) { - (*iter)->addRule(_jobQueue,_SATPool); + (*iter)->addRule(_jobQueue); } // solving diff --git a/zypp/solver/detail/SolverQueueItem.cc b/zypp/solver/detail/SolverQueueItem.cc index f3e53344c..3b55a6349 100644 --- a/zypp/solver/detail/SolverQueueItem.cc +++ b/zypp/solver/detail/SolverQueueItem.cc @@ -21,6 +21,10 @@ #include "zypp/base/Logger.h" #include "zypp/solver/detail/SolverQueueItem.h" +extern "C" { + #include "satsolver/solver.h" + #include "satsolver/pool.h" +} ///////////////////////////////////////////////////////////////////////// namespace zypp diff --git a/zypp/solver/detail/SolverQueueItem.h b/zypp/solver/detail/SolverQueueItem.h index 2fdf7adf7..05db856f6 100644 --- a/zypp/solver/detail/SolverQueueItem.h +++ b/zypp/solver/detail/SolverQueueItem.h @@ -32,9 +32,7 @@ #include "zypp/ResPool.h" extern "C" { - struct Queue; -//#include "satsolver/solver.h" -//#include "satsolver/pool.h" + struct _Queue; } @@ -105,7 +103,7 @@ class SolverQueueItem : public base::ReferenceCounted, private base::NonCopyable virtual SolverQueueItem_Ptr copy (void) const = 0; - virtual bool addRule (Queue & q, Pool *SATPool) =0 ; + virtual bool addRule (_Queue & q) =0 ; virtual int cmp (SolverQueueItem_constPtr item) const = 0; int compare (SolverQueueItem_constPtr item) const { return CMP(_type, item->_type); } diff --git a/zypp/solver/detail/SolverQueueItemDelete.cc b/zypp/solver/detail/SolverQueueItemDelete.cc index 9ea6f7cc0..a9f4764bb 100644 --- a/zypp/solver/detail/SolverQueueItemDelete.cc +++ b/zypp/solver/detail/SolverQueueItemDelete.cc @@ -19,8 +19,14 @@ */ #include "zypp/base/Logger.h" +#include "zypp/IdString.h" #include "zypp/solver/detail/SolverQueueItemDelete.h" +extern "C" { + #include "satsolver/solver.h" + #include "satsolver/pool.h" +} + ///////////////////////////////////////////////////////////////////////// namespace zypp { /////////////////////////////////////////////////////////////////////// @@ -62,9 +68,9 @@ SolverQueueItemDelete::~SolverQueueItemDelete() //--------------------------------------------------------------------------- -bool SolverQueueItemDelete::addRule (Queue & q, Pool *SATPool) +bool SolverQueueItemDelete::addRule (_Queue & q) { - Id id = str2id( SATPool, _name.c_str(), 0 ); + ::Id id = IdString(_name).id(); if (_soft) { queue_push( &(q), SOLVER_ERASE_SOLVABLE_NAME | SOLVER_WEAK); } else { diff --git a/zypp/solver/detail/SolverQueueItemDelete.h b/zypp/solver/detail/SolverQueueItemDelete.h index dd26eead2..3770adab4 100644 --- a/zypp/solver/detail/SolverQueueItemDelete.h +++ b/zypp/solver/detail/SolverQueueItemDelete.h @@ -67,7 +67,7 @@ class SolverQueueItemDelete : public SolverQueueItem { // ---------------------------------- methods - virtual bool addRule (Queue & q, Pool *SATPool); + virtual bool addRule (_Queue & q); virtual SolverQueueItem_Ptr copy (void) const; virtual int cmp (SolverQueueItem_constPtr item) const; }; diff --git a/zypp/solver/detail/SolverQueueItemInstall.cc b/zypp/solver/detail/SolverQueueItemInstall.cc index de2366bc1..4963787f4 100644 --- a/zypp/solver/detail/SolverQueueItemInstall.cc +++ b/zypp/solver/detail/SolverQueueItemInstall.cc @@ -19,8 +19,15 @@ */ #include "zypp/base/Logger.h" +#include "zypp/IdString.h" +#include "zypp/IdStringType.h" #include "zypp/solver/detail/SolverQueueItemInstall.h" +extern "C" { + #include "satsolver/solver.h" + #include "satsolver/pool.h" +} + ///////////////////////////////////////////////////////////////////////// namespace zypp { /////////////////////////////////////////////////////////////////////// @@ -63,9 +70,9 @@ SolverQueueItemInstall::~SolverQueueItemInstall() //--------------------------------------------------------------------------- -bool SolverQueueItemInstall::addRule (Queue & q, Pool *SATPool) +bool SolverQueueItemInstall::addRule (_Queue & q) { - Id id = str2id( SATPool, _name.c_str(), 0 ); + ::Id id = IdString(_name).id(); if (_soft) { queue_push( &(q), SOLVER_INSTALL_SOLVABLE_NAME | SOLVER_WEAK ); } else { diff --git a/zypp/solver/detail/SolverQueueItemInstall.h b/zypp/solver/detail/SolverQueueItemInstall.h index d9994b1d6..9d5df4f6c 100644 --- a/zypp/solver/detail/SolverQueueItemInstall.h +++ b/zypp/solver/detail/SolverQueueItemInstall.h @@ -66,7 +66,7 @@ class SolverQueueItemInstall : public SolverQueueItem { // ---------------------------------- methods - virtual bool addRule (Queue & q, Pool *SATPool); + virtual bool addRule (_Queue & q); virtual SolverQueueItem_Ptr copy (void) const; virtual int cmp (SolverQueueItem_constPtr item) const; }; diff --git a/zypp/solver/detail/SolverQueueItemInstallOneOf.cc b/zypp/solver/detail/SolverQueueItemInstallOneOf.cc index 855983e01..120a33cbf 100644 --- a/zypp/solver/detail/SolverQueueItemInstallOneOf.cc +++ b/zypp/solver/detail/SolverQueueItemInstallOneOf.cc @@ -21,6 +21,11 @@ #include "zypp/base/Logger.h" #include "zypp/solver/detail/SolverQueueItemInstallOneOf.h" +extern "C" { + #include "satsolver/solver.h" + #include "satsolver/pool.h" +} + ///////////////////////////////////////////////////////////////////////// namespace zypp { /////////////////////////////////////////////////////////////////////// @@ -65,7 +70,7 @@ SolverQueueItemInstallOneOf::~SolverQueueItemInstallOneOf() //--------------------------------------------------------------------------- -bool SolverQueueItemInstallOneOf::addRule (Queue & q, Pool *SATPool) +bool SolverQueueItemInstallOneOf::addRule (_Queue & q) { bool ret = true; MIL << "Install one of: " << endl; diff --git a/zypp/solver/detail/SolverQueueItemInstallOneOf.h b/zypp/solver/detail/SolverQueueItemInstallOneOf.h index 3bdf09495..b94fcddcf 100644 --- a/zypp/solver/detail/SolverQueueItemInstallOneOf.h +++ b/zypp/solver/detail/SolverQueueItemInstallOneOf.h @@ -63,7 +63,7 @@ class SolverQueueItemInstallOneOf : public SolverQueueItem { // ---------------------------------- methods - virtual bool addRule (Queue & q, Pool *SATPool); + virtual bool addRule (_Queue & q); virtual SolverQueueItem_Ptr copy (void) const; virtual int cmp (SolverQueueItem_constPtr item) const; }; diff --git a/zypp/solver/detail/SolverQueueItemLock.cc b/zypp/solver/detail/SolverQueueItemLock.cc index 506e20f64..44a81af84 100644 --- a/zypp/solver/detail/SolverQueueItemLock.cc +++ b/zypp/solver/detail/SolverQueueItemLock.cc @@ -21,6 +21,11 @@ #include "zypp/base/Logger.h" #include "zypp/solver/detail/SolverQueueItemLock.h" +extern "C" { + #include "satsolver/solver.h" + #include "satsolver/pool.h" +} + ///////////////////////////////////////////////////////////////////////// namespace zypp { /////////////////////////////////////////////////////////////////////// @@ -63,9 +68,9 @@ SolverQueueItemLock::~SolverQueueItemLock() //--------------------------------------------------------------------------- -bool SolverQueueItemLock::addRule (Queue & q, Pool *SATPool) +bool SolverQueueItemLock::addRule (_Queue & q) { - Id id = _item.satSolvable().id(); + ::Id id = _item.satSolvable().id(); if (id == ID_NULL) { ERR << "Lock : " << _item << " not found" << endl; return false; diff --git a/zypp/solver/detail/SolverQueueItemLock.h b/zypp/solver/detail/SolverQueueItemLock.h index eb5fe97e5..55f5104d1 100644 --- a/zypp/solver/detail/SolverQueueItemLock.h +++ b/zypp/solver/detail/SolverQueueItemLock.h @@ -66,7 +66,7 @@ class SolverQueueItemLock : public SolverQueueItem { // ---------------------------------- methods - virtual bool addRule (Queue & q, Pool *SATPool); + virtual bool addRule (_Queue & q); virtual SolverQueueItem_Ptr copy (void) const; virtual int cmp (SolverQueueItem_constPtr item) const; }; diff --git a/zypp/solver/detail/SolverQueueItemUpdate.cc b/zypp/solver/detail/SolverQueueItemUpdate.cc index e82357b9d..2ed908cb4 100644 --- a/zypp/solver/detail/SolverQueueItemUpdate.cc +++ b/zypp/solver/detail/SolverQueueItemUpdate.cc @@ -21,6 +21,11 @@ #include "zypp/base/Logger.h" #include "zypp/solver/detail/SolverQueueItemUpdate.h" +extern "C" { + #include "satsolver/solver.h" + #include "satsolver/pool.h" +} + ///////////////////////////////////////////////////////////////////////// namespace zypp { /////////////////////////////////////////////////////////////////////// @@ -63,9 +68,9 @@ SolverQueueItemUpdate::~SolverQueueItemUpdate() //--------------------------------------------------------------------------- -bool SolverQueueItemUpdate::addRule (Queue & q, Pool *SATPool) +bool SolverQueueItemUpdate::addRule (_Queue & q) { - Id id = _item.satSolvable().id(); + ::Id id = _item.satSolvable().id(); if (id == ID_NULL) { ERR << "Update explicit: " << _item << " not found" << endl; return false; diff --git a/zypp/solver/detail/SolverQueueItemUpdate.h b/zypp/solver/detail/SolverQueueItemUpdate.h index 8bc524e8a..ff003067e 100644 --- a/zypp/solver/detail/SolverQueueItemUpdate.h +++ b/zypp/solver/detail/SolverQueueItemUpdate.h @@ -66,7 +66,7 @@ class SolverQueueItemUpdate : public SolverQueueItem { // ---------------------------------- methods - virtual bool addRule (Queue & q, Pool *SATPool); + virtual bool addRule (_Queue & q); virtual SolverQueueItem_Ptr copy (void) const; virtual int cmp (SolverQueueItem_constPtr item) const; }; -- 2.34.1