summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPixel <>2001-03-21 10:58:51 +0000
committerPixel <>2001-03-21 10:58:51 +0000
commitb75cdf41d321bce00a3f7c0c980c1f6cdc6117a8 (patch)
tree6f9b4762b8c66ddae9c68b5fd69e3afa08b2b7df /lib
parent9bf8629e1420fb0bc09103e747f7d9b18aa7f10d (diff)
Bugfixes
Diffstat (limited to 'lib')
-rw-r--r--lib/BHeap.cc2
-rw-r--r--lib/BinHeap.cc5
-rw-r--r--lib/FHeap.cc2
-rw-r--r--lib/PCommon.cc4
-rw-r--r--lib/PLList.cc2
5 files changed, 7 insertions, 8 deletions
diff --git a/lib/BHeap.cc b/lib/BHeap.cc
index aaec87a..7d7caf5 100644
--- a/lib/BHeap.cc
+++ b/lib/BHeap.cc
@@ -323,7 +323,7 @@ PriorityList *BHeap::Union(PriorityList * P)
{
BHeap *x, *Before, *After;
- if ((P->GetType()) != (((PriorityList *) this)->GetType()))
+ if ((P->GetType()) != GetType())
return GenericUnion(P);
Merge((BHeap *) P);
diff --git a/lib/BinHeap.cc b/lib/BinHeap.cc
index b57a31d..bb58141 100644
--- a/lib/BinHeap.cc
+++ b/lib/BinHeap.cc
@@ -66,10 +66,11 @@ bool BinHeap::Lower_Key(Cell x, Key_t NKey)
return true;
}
-BinHeap::BinHeap(void):FP(new CList)
+BinHeap::BinHeap(void) : FP(new CList)
{
Key = 0;
Datas = NULL;
+ type = T_BINHEAP;
}
BinHeap::~BinHeap(void)
@@ -80,7 +81,6 @@ BinHeap::~BinHeap(void)
Key_t BinHeap::ReadKey(Cell C)
{
- cerr << "Lecture de " << C << endl;
return ((binheap_t *) FP->ReadDatas(C))->Key;
}
@@ -143,7 +143,6 @@ Cell BinHeap::Insert(Key_t IKey, Datas_t const &IDatas)
binheap[i - 1] = newcell;
r = binheap[i - 1].FP = FP->Insert(0, &(binheap[i - 1]));
- cerr << "Ajout de " << r << endl;
return r;
}
diff --git a/lib/FHeap.cc b/lib/FHeap.cc
index a10e089..17ed0b5 100644
--- a/lib/FHeap.cc
+++ b/lib/FHeap.cc
@@ -238,7 +238,7 @@ PriorityList *FHeap::Union(PriorityList * P)
{
FHeap *Temp, *T = ((FHeap *) P);
- if ((P->GetType()) != (((PriorityList *) P)->GetType()))
+ if (GetType() != (P->GetType()))
return GenericUnion(P);
/* Cette fonction ne suit pas du tout l'idée du Cormen. Elle va
diff --git a/lib/PCommon.cc b/lib/PCommon.cc
index 1dc3127..16a8a3f 100644
--- a/lib/PCommon.cc
+++ b/lib/PCommon.cc
@@ -8,7 +8,7 @@
* les files de priorités. Il s'agit de la classe "Père" dont héritent
* toutes les autres files de priorités. Nous ne trouverons ici que
* les constructeurs nécessaires pour la bonne opération sur les files,
- * ainsi que les deux routines génériques n est GenericUnion.
+ * ainsi que les deux routines génériques n et GenericUnion.
*
*/
@@ -45,7 +45,7 @@ PriorityList *PriorityList::GenericUnion(PriorityList * P)
{
Key_t IKey;
Datas_t IDatas;
-
+
while (!(P->IsEmpty())) {
IKey = P->Extract_Min(IDatas);
Insert(IKey, IDatas);
diff --git a/lib/PLList.cc b/lib/PLList.cc
index 77bf2e7..b74d7d3 100644
--- a/lib/PLList.cc
+++ b/lib/PLList.cc
@@ -22,7 +22,7 @@
PriorityList *PLList::Union(PriorityList * P)
{
- if ((P->GetType()) != (((PriorityList *) this)->GetType())) {
+ if ((P->GetType()) != GetType()) {
return GenericUnion(P);
} else {
CList *x, *y, *t;