Reorder enum. Add enum constant for the size, fix a wrong condition in an assert.

git-svn-id: http://root.cern.ch/svn/root/trunk@49320 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Vassil Vassilev 2013-04-24 15:04:09 +00:00
parent fc0f602a9e
commit 343a649e42
2 changed files with 6 additions and 5 deletions

View File

@ -117,10 +117,11 @@ namespace cling {
enum State {
kCollecting,
kCompleted,
kCommitting,
kRolledBack,
kRolledBackWithErrors,
kCommitting,
kCommitted
kCommitted,
kNumStates
};
enum IssuedDiags {

View File

@ -74,7 +74,7 @@ namespace cling {
}
void Transaction::erase(size_t pos) {
assert(empty() && "Erasing from an empty transaction.");
assert(!empty() && "Erasing from an empty transaction.");
m_DeclQueue->erase(decls_begin() + pos);
}
@ -129,12 +129,12 @@ namespace cling {
}
void Transaction::printStructure(size_t nindent) const {
static const char* const stateNames[] = {
static const char* const stateNames[kNumStates] = {
"Collecting",
"kCompleted",
"Committing",
"RolledBack",
"RolledBackWithErrors",
"Committing",
"Committed"
};
std::string indent(nindent, ' ');