Fixed all reorder warnings

This commit is contained in:
Justin Frank 2019-02-08 20:41:09 -08:00
parent 29342836a6
commit 8178400f8d
11 changed files with 27 additions and 27 deletions

View File

@ -85,7 +85,7 @@ else
LDFLAGS += -rdynamic LDFLAGS += -rdynamic
endif endif
CXXFLAGS += -pedantic -std=c++17 -g -Wall -Wextra -Wno-unused-parameter -Wno-reorder -Wno-sign-compare -Wno-address CXXFLAGS += -pedantic -std=c++17 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address
all : kak all : kak

View File

@ -32,9 +32,9 @@ Client::Client(std::unique_ptr<UserInterface>&& ui,
: m_ui{std::move(ui)}, m_window{std::move(window)}, : m_ui{std::move(ui)}, m_window{std::move(window)},
m_pid{pid}, m_pid{pid},
m_on_exit{std::move(on_exit)}, m_on_exit{std::move(on_exit)},
m_env_vars(std::move(env_vars)),
m_input_handler{std::move(selections), Context::Flags::None, m_input_handler{std::move(selections), Context::Flags::None,
std::move(name)}, std::move(name)}
m_env_vars(std::move(env_vars))
{ {
m_window->set_client(this); m_window->set_client(this);

View File

@ -13,9 +13,9 @@ Context::~Context() = default;
Context::Context(InputHandler& input_handler, SelectionList selections, Context::Context(InputHandler& input_handler, SelectionList selections,
Flags flags, String name) Flags flags, String name)
: m_input_handler{&input_handler}, : m_flags(flags),
m_input_handler{&input_handler},
m_selections{std::move(selections)}, m_selections{std::move(selections)},
m_flags(flags),
m_name(std::move(name)) m_name(std::move(name))
{} {}

View File

@ -28,7 +28,7 @@ public:
: m_type(Range), m_buffer(&buffer), m_range{begin, end} {} : m_type(Range), m_buffer(&buffer), m_range{begin, end} {}
DisplayAtom(String str, Face face) DisplayAtom(String str, Face face)
: m_type(Text), m_text(std::move(str)), face(face) {} : face(face), m_type(Text), m_text(std::move(str)) {}
StringView content() const; StringView content() const;
ColumnCount length() const; ColumnCount length() const;

View File

@ -34,7 +34,7 @@ void FDWatcher::close_fd()
} }
Timer::Timer(TimePoint date, Callback callback, EventMode mode) Timer::Timer(TimePoint date, Callback callback, EventMode mode)
: m_date{date}, m_callback{std::move(callback)}, m_mode(mode) : m_date{date}, m_mode(mode), m_callback{std::move(callback)}
{ {
if (m_callback and EventManager::has_instance()) if (m_callback and EventManager::has_instance())
EventManager::instance().m_timers.push_back(this); EventManager::instance().m_timers.push_back(this);

View File

@ -633,8 +633,8 @@ std::unique_ptr<Highlighter> create_column_highlighter(HighlighterParameters par
struct WrapHighlighter : Highlighter struct WrapHighlighter : Highlighter
{ {
WrapHighlighter(ColumnCount max_width, bool word_wrap, bool preserve_indent, String marker) WrapHighlighter(ColumnCount max_width, bool word_wrap, bool preserve_indent, String marker)
: Highlighter{HighlightPass::Wrap}, m_max_width{max_width}, : Highlighter{HighlightPass::Wrap}, m_word_wrap{word_wrap},
m_word_wrap{word_wrap}, m_preserve_indent{preserve_indent}, m_preserve_indent{preserve_indent}, m_max_width{max_width},
m_marker{std::move(marker)} {} m_marker{std::move(marker)} {}
static constexpr StringView ms_id = "wrap"; static constexpr StringView ms_id = "wrap";

View File

@ -752,9 +752,10 @@ public:
Prompt(InputHandler& input_handler, StringView prompt, Prompt(InputHandler& input_handler, StringView prompt,
String initstr, String emptystr, Face face, PromptFlags flags, String initstr, String emptystr, Face face, PromptFlags flags,
PromptCompleter completer, PromptCallback callback) PromptCompleter completer, PromptCallback callback)
: InputMode(input_handler), m_prompt(prompt.str()), m_prompt_face(face), : InputMode(input_handler), m_callback(std::move(callback)), m_completer(std::move(completer)),
m_prompt(prompt.str()), m_prompt_face(face),
m_empty_text{std::move(emptystr)}, m_empty_text{std::move(emptystr)},
m_flags(flags), m_completer(std::move(completer)), m_callback(std::move(callback)), m_line_editor{context().faces()}, m_flags(flags),
m_auto_complete{context().options()["autocomplete"].get<AutoComplete>() & AutoComplete::Prompt}, m_auto_complete{context().options()["autocomplete"].get<AutoComplete>() & AutoComplete::Prompt},
m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Draft ? m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Draft ?
Timer::Callback{} : [this](Timer&) { Timer::Callback{} : [this](Timer&) {
@ -766,8 +767,7 @@ public:
m_line_changed = false; m_line_changed = false;
} }
context().hooks().run_hook(Hook::PromptIdle, "", context()); context().hooks().run_hook(Hook::PromptIdle, "", context());
}}, }}
m_line_editor{context().faces()}
{ {
m_history_it = ms_history[m_prompt].end(); m_history_it = ms_history[m_prompt].end();
m_line_editor.reset(std::move(initstr), m_empty_text); m_line_editor.reset(std::move(initstr), m_empty_text);
@ -1102,7 +1102,7 @@ class NextKey : public InputMode
{ {
public: public:
NextKey(InputHandler& input_handler, KeymapMode keymap_mode, KeyCallback callback) NextKey(InputHandler& input_handler, KeymapMode keymap_mode, KeyCallback callback)
: InputMode(input_handler), m_keymap_mode(keymap_mode), m_callback(std::move(callback)) {} : InputMode(input_handler), m_callback(std::move(callback)), m_keymap_mode(keymap_mode) {}
void on_key(Key key) override void on_key(Key key) override
{ {
@ -1132,16 +1132,16 @@ class Insert : public InputMode
public: public:
Insert(InputHandler& input_handler, InsertMode mode, int count) Insert(InputHandler& input_handler, InsertMode mode, int count)
: InputMode(input_handler), : InputMode(input_handler),
m_restore_cursor(mode == InsertMode::Append),
m_edition(context()), m_edition(context()),
m_completer(context()), m_completer(context()),
m_restore_cursor(mode == InsertMode::Append),
m_auto_complete{context().options()["autocomplete"].get<AutoComplete>() & AutoComplete::Insert}, m_auto_complete{context().options()["autocomplete"].get<AutoComplete>() & AutoComplete::Insert},
m_disable_hooks{context().hooks_disabled(), context().hooks_disabled()},
m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Draft ? m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Draft ?
Timer::Callback{} : [this](Timer&) { Timer::Callback{} : [this](Timer&) {
m_completer.update(m_auto_complete); m_completer.update(m_auto_complete);
context().hooks().run_hook(Hook::InsertIdle, "", context()); context().hooks().run_hook(Hook::InsertIdle, "", context());
}} }},
m_disable_hooks{context().hooks_disabled(), context().hooks_disabled()}
{ {
context().buffer().throw_if_read_only(); context().buffer().throw_if_read_only();

View File

@ -250,7 +250,9 @@ default_colors = {
}; };
NCursesUI::NCursesUI() NCursesUI::NCursesUI()
: m_stdin_watcher{0, FdEvents::Read, : m_colors{default_colors},
m_cursor{CursorMode::Buffer, {}},
m_stdin_watcher{0, FdEvents::Read,
[this](FDWatcher&, FdEvents, EventMode) { [this](FDWatcher&, FdEvents, EventMode) {
if (not m_on_key) if (not m_on_key)
return; return;
@ -258,9 +260,7 @@ NCursesUI::NCursesUI()
while (auto key = get_next_key()) while (auto key = get_next_key())
m_on_key(*key); m_on_key(*key);
}}, }},
m_assistant(assistant_clippy), m_assistant(assistant_clippy)
m_colors{default_colors},
m_cursor{CursorMode::Buffer, {}}
{ {
initscr(); initscr();
raw(); raw();

View File

@ -672,7 +672,7 @@ constexpr RegexParser::ControlEscape RegexParser::control_escapes[];
struct RegexCompiler struct RegexCompiler
{ {
RegexCompiler(ParsedRegex&& parsed_regex, RegexCompileFlags flags) RegexCompiler(ParsedRegex&& parsed_regex, RegexCompileFlags flags)
: m_parsed_regex{parsed_regex}, m_flags(flags) : m_flags(flags), m_parsed_regex{parsed_regex}
{ {
kak_assert(not (flags & RegexCompileFlags::NoForward) or flags & RegexCompileFlags::Backward); kak_assert(not (flags & RegexCompileFlags::NoForward) or flags & RegexCompileFlags::Backward);
// Approximation of the number of instructions generated // Approximation of the number of instructions generated

View File

@ -8,7 +8,7 @@ namespace Kakoune
{ {
SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp) SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp)
: m_buffer(&buffer), m_selections({ std::move(s) }), m_timestamp(timestamp) : m_selections({ std::move(s) }), m_buffer(&buffer), m_timestamp(timestamp)
{ {
check_invariant(); check_invariant();
} }
@ -17,7 +17,7 @@ SelectionList::SelectionList(Buffer& buffer, Selection s)
: SelectionList(buffer, std::move(s), buffer.timestamp()) {} : SelectionList(buffer, std::move(s), buffer.timestamp()) {}
SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list, size_t timestamp) SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list, size_t timestamp)
: m_buffer(&buffer), m_selections(std::move(list)), m_timestamp(timestamp) : m_selections(std::move(list)), m_buffer(&buffer), m_timestamp(timestamp)
{ {
kak_assert(size() > 0); kak_assert(size() > 0);
m_main = size() - 1; m_main = size() - 1;
@ -28,7 +28,7 @@ SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list)
: SelectionList(buffer, std::move(list), buffer.timestamp()) {} : SelectionList(buffer, std::move(list), buffer.timestamp()) {}
SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector<Selection> list, size_t timestamp, size_t main) SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector<Selection> list, size_t timestamp, size_t main)
: m_buffer(&buffer), m_selections(std::move(list)), m_timestamp(timestamp) : m_selections(std::move(list)), m_buffer(&buffer), m_timestamp(timestamp)
{ {
sort_and_merge_overlapping(); sort_and_merge_overlapping();
check_invariant(); check_invariant();

View File

@ -65,11 +65,11 @@ class OnScopeEnd
{ {
public: public:
[[gnu::always_inline]] [[gnu::always_inline]]
OnScopeEnd(T func) : m_func{std::move(func)}, m_valid{true} {} OnScopeEnd(T func) : m_valid{true}, m_func{std::move(func)} {}
[[gnu::always_inline]] [[gnu::always_inline]]
OnScopeEnd(OnScopeEnd&& other) OnScopeEnd(OnScopeEnd&& other)
: m_func{std::move(other.m_func)}, m_valid{other.m_valid} : m_valid{other.m_valid}, m_func{std::move(other.m_func)}
{ other.m_valid = false; } { other.m_valid = false; }
[[gnu::always_inline]] [[gnu::always_inline]]