diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2018-03-05 15:36:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-05 15:36:50 -0800 |
commit | 3d31caa30e094d337a4919b3d1e6ba9259e461b8 (patch) | |
tree | e99bc99c2ce450f7d0c4fa8c0938b24e886af996 /src/context/cdtrail_hashmap.h | |
parent | a2e78ec8dd5e935b6ef166154be7ee35bffc6d32 (diff) |
Enable -Wsuggest-override by default. (#1643)
Adds missing override keywords.
Diffstat (limited to 'src/context/cdtrail_hashmap.h')
-rw-r--r-- | src/context/cdtrail_hashmap.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/context/cdtrail_hashmap.h b/src/context/cdtrail_hashmap.h index bbd71f8cd..771cea960 100644 --- a/src/context/cdtrail_hashmap.h +++ b/src/context/cdtrail_hashmap.h @@ -394,7 +394,8 @@ private: * the current sizes to a copy using the copy constructor, * The saved information is allocated using the ContextMemoryManager. */ - ContextObj* save(ContextMemoryManager* pCMM) { + ContextObj* save(ContextMemoryManager* pCMM) override + { ContextObj* data = new(pCMM) CDTrailHashMap<Key, Data, HashFcn>(*this); Debug("CDTrailHashMap") << "save " << this << " at level " << this->getContext()->getLevel() @@ -409,20 +410,23 @@ protected: * restores the previous size. Note that the list pointer and the * allocated size are not changed. */ - void restore(ContextObj* data) { - Debug("CDTrailHashMap") << "restore " << this - << " level " << this->getContext()->getLevel() - << " data == " << data - << " d_trailMap == " << this->d_trailMap << std::endl; - size_t oldSize = ((CDTrailHashMap<Key, Data, HashFcn>*)data)->d_trailSize; - d_trailMap->pop_to_size(oldSize); - d_trailSize = oldSize; - Assert(d_trailMap->trailSize() == d_trailSize); - - d_prevTrailSize = ((CDTrailHashMap<Key, Data, HashFcn>*)data)->d_prevTrailSize; - Debug("CDTrailHashMap") << "restore " << this - << " level " << this->getContext()->getLevel() - << " size back to " << this->d_trailSize << std::endl; + void restore(ContextObj* data) override + { + Debug("CDTrailHashMap") << "restore " << this << " level " + << this->getContext()->getLevel() + << " data == " << data + << " d_trailMap == " << this->d_trailMap + << std::endl; + size_t oldSize = ((CDTrailHashMap<Key, Data, HashFcn>*)data)->d_trailSize; + d_trailMap->pop_to_size(oldSize); + d_trailSize = oldSize; + Assert(d_trailMap->trailSize() == d_trailSize); + + d_prevTrailSize = + ((CDTrailHashMap<Key, Data, HashFcn>*)data)->d_prevTrailSize; + Debug("CDTrailHashMap") << "restore " << this << " level " + << this->getContext()->getLevel() << " size back to " + << this->d_trailSize << std::endl; } /** |