From 3d31caa30e094d337a4919b3d1e6ba9259e461b8 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Mon, 5 Mar 2018 15:36:50 -0800 Subject: Enable -Wsuggest-override by default. (#1643) Adds missing override keywords. --- src/context/cdinsert_hashmap.h | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'src/context/cdinsert_hashmap.h') 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(*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*)data)->d_size; - size_t oldPushFronts = ((CDInsertHashMap*)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*)data)->d_size; + size_t oldPushFronts = + ((CDInsertHashMap*)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: -- cgit v1.2.3