diff --git a/src/common/classes/Hash.h b/src/common/classes/Hash.h index 6543392180..cb446e5cdd 100644 --- a/src/common/classes/Hash.h +++ b/src/common/classes/Hash.h @@ -94,7 +94,8 @@ namespace Firebird { public: Entry() : previousElement(NULL) { } - virtual ~Entry() { + virtual ~Entry() + { unLink(); } @@ -128,7 +129,7 @@ namespace Firebird { } // ... and next pointer in previous element *previousElement = nextElement; - // finally mrk ourself not linked + // finally mark ourselves not linked previousElement = 0; } } @@ -143,7 +144,7 @@ namespace Firebird { return nextElement; } - virtual bool isEqual(const K&) = 0; + virtual bool isEqual(const K&) const = 0; virtual C* get() = 0; }; // class Entry @@ -261,7 +262,7 @@ namespace Firebird { iterator& operator++() { - if(hasData()) + if (hasData()) { current = current->next(); next(); diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index 4cf394c5af..7e818d977e 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -242,8 +242,8 @@ public: return dfw_next; } -// hash interface - bool isEqual(const DeferredWork& work) + // hash interface + bool isEqual(const DeferredWork& work) const { if (dfw_type == work.dfw_type && dfw_id == work.dfw_id && @@ -291,10 +291,10 @@ class DfwSavePoint : public DfwSavePointHash::Entry public: DfwHash hash; - DfwSavePoint(SLONG number) : dfw_sav_number(number) { } + explicit DfwSavePoint(SLONG number) : dfw_sav_number(number) { } -// hash interface - bool isEqual(const SLONG& number) + // hash interface + bool isEqual(const SLONG& number) const { if (dfw_sav_number == number) { @@ -596,9 +596,8 @@ void DFW_merge_work(jrd_tra* transaction, DfwSavePoint* newSp = job->hash.lookup(new_sav_number); -// Decrement the save point number in the deferred block -// i.e. merge with the previous level. - + // Decrement the save point number in the deferred block + // i.e. merge with the previous level. for (DfwHash::iterator itr(oldSp->hash); itr.hasData();) { @@ -753,7 +752,7 @@ void DFW_perform_work(jrd_tra* transaction) break; default: - delete work; + delete work; break; } } @@ -5734,7 +5733,7 @@ static Firebird::string get_string(const dsc* desc) // Find the actual length of the string, searching until the claimed // end of the string, or the terminating \0, whichever comes first - USHORT length = MOV_make_string(desc, ttype_metadata, &str, (vary*)temp, sizeof(temp)); + USHORT length = MOV_make_string(desc, ttype_metadata, &str, (vary*) temp, sizeof(temp)); const char* p = str; const char* const q = str + length; @@ -5743,7 +5742,7 @@ static Firebird::string get_string(const dsc* desc) ++p; } -// Trim trailing blanks (bug 3355) + // Trim trailing blanks (bug 3355) while (--p >= str && *p == ' ') ;