Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/stackclass.hpp

    re138de ra67d19  
    7272    return true;
    7373  } else {
    74     eLog() << Verbose(0) << "ERROR: Stack is full, " << "Stack: CurrentLastEntry " << CurrentLastEntry<< "\tCurrentFirstEntry " << CurrentFirstEntry << "\tNextFreeField " << NextFreeField << "\tEntryCount " << EntryCount << "!" << endl;
     74    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is full, " << "Stack: CurrentLastEntry " << CurrentLastEntry<< "\tCurrentFirstEntry " << CurrentFirstEntry << "\tNextFreeField " << NextFreeField << "\tEntryCount " << EntryCount << "!" << endl);
    7575    return false;
    7676  }
     
    8787    Walker = StackList[CurrentFirstEntry];
    8888    if (Walker == NULL)
    89       eLog() << Verbose(0) << "ERROR: Stack's field is empty!" << endl;
     89      DoeLog(1) && (eLog()<< Verbose(1) << "Stack's field is empty!" << endl);
    9090    StackList[CurrentFirstEntry] = NULL;
    9191    if (CurrentFirstEntry != CurrentLastEntry) { // hasn't last item been popped as well?
     
    9696    }
    9797  } else
    98     eLog() << Verbose(0) << "ERROR: Stack is empty!" << endl;
     98    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is empty!" << endl);
    9999  return Walker;
    100100};
     
    111111    StackList[CurrentLastEntry] = NULL;
    112112    if (Walker == NULL)
    113       eLog() << Verbose(0) << "ERROR: Stack's field is empty!" << endl;
     113      DoeLog(1) && (eLog()<< Verbose(1) << "Stack's field is empty!" << endl);
    114114    NextFreeField = CurrentLastEntry;
    115115    if (CurrentLastEntry != CurrentFirstEntry)  // has there been more than one item on stack
    116116      CurrentLastEntry = (CurrentLastEntry + (EntryCount-1)) % EntryCount; // step back from current free field to last (modulo does not work in -1, thus go EntryCount-1 instead)
    117117  } else {
    118     eLog() << Verbose(0) << "ERROR: Stack is empty!" << endl;
     118    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is empty!" << endl);
    119119  }
    120120  return Walker;
     
    130130{
    131131  bool found = false;
    132   Log() << Verbose(5) << "First " << CurrentFirstEntry<< "\tLast " << CurrentLastEntry<< "\tNext " << NextFreeField<< "\tCount " << EntryCount<< "." << endl;
     132  DoLog(5) && (Log() << Verbose(5) << "First " << CurrentFirstEntry<< "\tLast " << CurrentLastEntry<< "\tNext " << NextFreeField<< "\tCount " << EntryCount<< "." << endl);
    133133  int i=CurrentFirstEntry;
    134134  if (!IsEmpty())
    135135    do {
    136136      if (StackList[i] == ptr) {  // if item found, remove
    137         Log() << Verbose(5) << "Item " << *ptr << " was number " << i << " on stack, removing it." << endl;
     137        DoLog(5) && (Log() << Verbose(5) << "Item " << *ptr << " was number " << i << " on stack, removing it." << endl);
    138138        found = true;
    139139        StackList[i] = NULL;
     
    141141      if ((found) && (StackList[i] != NULL)) {  // means we have to shift (and not the removed item)
    142142        if (i == 0) { // we are down to first item in stack, have to put onto last item
    143           Log() << Verbose(5) << "Shifting item 0 to place " << EntryCount-1 << "." << endl;
     143          DoLog(5) && (Log() << Verbose(5) << "Shifting item 0 to place " << EntryCount-1 << "." << endl);
    144144          StackList[EntryCount-1] = StackList[0];
    145145        } else {
    146           Log() << Verbose(5) << "Shifting item " << i << " to place " << i-1 << "." << endl;
     146          DoLog(5) && (Log() << Verbose(5) << "Shifting item " << i << " to place " << i-1 << "." << endl);
    147147          StackList[i-1] = StackList[i];
    148148        }
     
    151151    } while (i!=NextFreeField);
    152152  else
    153     eLog() << Verbose(0) << "ERROR: Stack is already empty!" << endl;
     153    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is already empty!" << endl);
    154154  if (found) {
    155155    NextFreeField = CurrentLastEntry;
Note: See TracChangeset for help on using the changeset viewer.