From 11d5ae27434a5e36f6500b60a785b86261da6554 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 4 Sep 2012 00:17:41 +0200 Subject: [PATCH] add override markers --- src/assert.hh | 2 +- src/exception.hh | 2 +- src/register_manager.cc | 8 ++++---- src/selection.hh | 6 ++++-- src/window.hh | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/assert.hh b/src/assert.hh index ceee28f2..975ddca1 100644 --- a/src/assert.hh +++ b/src/assert.hh @@ -9,7 +9,7 @@ namespace Kakoune struct assert_failed : logic_error { assert_failed(const String& message); - String description() const; + String description() const override; private: String m_message; diff --git a/src/exception.hh b/src/exception.hh index 5aab02f6..0b68d39e 100644 --- a/src/exception.hh +++ b/src/exception.hh @@ -17,7 +17,7 @@ struct runtime_error : exception runtime_error(const String& description) : m_description(description) {} - String description() const { return m_description; } + String description() const override { return m_description; } private: String m_description; diff --git a/src/register_manager.cc b/src/register_manager.cc index e77510a1..11bae66a 100644 --- a/src/register_manager.cc +++ b/src/register_manager.cc @@ -11,13 +11,13 @@ namespace Kakoune class StaticRegister : public Register { public: - Register& operator=(const memoryview& values) + Register& operator=(const memoryview& values) override { m_content = std::vector(values.begin(), values.end()); return *this; } - memoryview values(const Context&) + memoryview values(const Context&) override { if (m_content.empty()) return memoryview(ms_empty); @@ -40,12 +40,12 @@ public: DynamicRegister(RegisterRetriever function) : m_function(std::move(function)) {} - Register& operator=(const memoryview& values) + Register& operator=(const memoryview& values) override { throw runtime_error("this register is not assignable"); } - memoryview values(const Context& context) + memoryview values(const Context& context) override { m_content = m_function(context); return StaticRegister::values(context); diff --git a/src/selection.hh b/src/selection.hh index 7081e427..18e1dbab 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -31,8 +31,10 @@ struct Selection : public BufferChangeListener void merge_with(const Selection& selection); void avoid_eol(); - void on_insert(const BufferIterator& begin, const BufferIterator& end); - void on_erase(const BufferIterator& begin, const BufferIterator& end); + void on_insert(const BufferIterator& begin, + const BufferIterator& end) override; + void on_erase(const BufferIterator& begin, + const BufferIterator& end) override; private: BufferIterator m_first; diff --git a/src/window.hh b/src/window.hh index 119cf962..fd0598e4 100644 --- a/src/window.hh +++ b/src/window.hh @@ -49,8 +49,8 @@ private: Window(Buffer& buffer); Window(const Window&) = delete; - void on_incremental_insertion_end(); - void on_option_changed(const String& name, const Option& option); + void on_incremental_insertion_end() override; + void on_option_changed(const String& name, const Option& option) override; void scroll_to_keep_cursor_visible_ifn();