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/cdinsert_hashmap.h | |
parent | a2e78ec8dd5e935b6ef166154be7ee35bffc6d32 (diff) |
Enable -Wsuggest-override by default. (#1643)
Adds missing override keywords.
Diffstat (limited to 'src/context/cdinsert_hashmap.h')
-rw-r--r-- | src/context/cdinsert_hashmap.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/context/cdinsert_hashmap.h b/src/context/cdinsert_hashmap.h index db679c1f7..9211ff7da 100644 --- a/src/context/cdinsert_hashmap.h +++ b/src/context/cdinsert_hashmap.h @@ -221,7 +221,8 @@ private: * restored on a pop). The saved information is allocated using the * ContextMemoryManager. */ - ContextObj* save(ContextMemoryManager* pCMM) { + ContextObj* save(ContextMemoryManager* pCMM) override + { ContextObj* data = new(pCMM) CDInsertHashMap<Key, Data, HashFcn>(*this); Debug("CDInsertHashMap") << "save " << this << " at level " << this->getContext()->getLevel() @@ -237,23 +238,25 @@ protected: * of new pushFront calls have happened since saving. * The d_insertMap is untouched and d_pushFronts is also kept. */ - void restore(ContextObj* data) { - Debug("CDInsertHashMap") << "restore " << this - << " level " << this->getContext()->getLevel() - << " data == " << data - << " d_insertMap == " << this->d_insertMap << std::endl; - size_t oldSize = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_size; - size_t oldPushFronts = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_pushFronts; - Assert(oldPushFronts <= d_pushFronts); - - // The size to restore to. - size_t restoreSize = oldSize + (d_pushFronts - oldPushFronts); - d_insertMap->pop_to_size(restoreSize); - d_size = restoreSize; - Assert(d_insertMap->size() == d_size); - Debug("CDInsertHashMap") << "restore " << this - << " level " << this->getContext()->getLevel() - << " size back to " << this->d_size << std::endl; + void restore(ContextObj* data) override + { + Debug("CDInsertHashMap") + << "restore " << this << " level " << this->getContext()->getLevel() + << " data == " << data << " d_insertMap == " << this->d_insertMap + << std::endl; + size_t oldSize = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_size; + size_t oldPushFronts = + ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_pushFronts; + Assert(oldPushFronts <= d_pushFronts); + + // The size to restore to. + size_t restoreSize = oldSize + (d_pushFronts - oldPushFronts); + d_insertMap->pop_to_size(restoreSize); + d_size = restoreSize; + Assert(d_insertMap->size() == d_size); + Debug("CDInsertHashMap") + << "restore " << this << " level " << this->getContext()->getLevel() + << " size back to " << this->d_size << std::endl; } public: |