From fd8517f91e9d7deacf5be1471e93571a69cea561 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 5 Jun 2012 13:33:02 +0000 Subject: [PATCH] fix some warnings detected with clang --- src/buffer.cc | 2 ++ src/commands.cc | 4 ++-- src/filters.cc | 2 +- src/main.cc | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 59ece2ae..c111a3b3 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -177,6 +177,7 @@ bool Buffer::undo() for (const Modification& modification : reversed(*m_history_cursor)) apply_modification(modification.inverse()); + return true; } bool Buffer::redo() @@ -188,6 +189,7 @@ bool Buffer::redo() apply_modification(modification); ++m_history_cursor; + return true; } void Buffer::check_invariant() const diff --git a/src/commands.cc b/src/commands.cc index 71043d28..347fa539 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -855,7 +855,7 @@ void register_commands() params[token_to_complete] : String(); if (token_to_complete == 1 and params[0] == "-group") return w.highlighters().complete_group_id(arg, pos_in_token); - else if (token_to_complete == 0 or token_to_complete == 2 and params[0] == "-group") + else if (token_to_complete == 0 or (token_to_complete == 2 and params[0] == "-group")) return HighlighterRegistry::instance().complete_highlighter(arg, pos_in_token); else return CandidateList(); @@ -883,7 +883,7 @@ void register_commands() params[token_to_complete] : String(); if (token_to_complete == 1 and params[0] == "-group") return w.filters().complete_group_id(arg, pos_in_token); - else if (token_to_complete == 0 or token_to_complete == 2 and params[0] == "-group") + else if (token_to_complete == 0 or (token_to_complete == 2 and params[0] == "-group")) return FilterRegistry::instance().complete_filter(arg, pos_in_token); else return CandidateList(); diff --git a/src/filters.cc b/src/filters.cc index 453f95e3..185dd1bf 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -27,7 +27,7 @@ void cleanup_whitespaces(Buffer& buffer, Modification& modification) modification.content[0] == '\n' and not modification.position.is_begin()) { BufferIterator position = modification.position-1; - while (*position == ' ' or *position == '\t' and not position.is_begin()) + while ((*position == ' ' or *position == '\t') and not position.is_begin()) --position; ++position; if (position != modification.position) diff --git a/src/main.cc b/src/main.cc index 36d45699..d068bf27 100644 --- a/src/main.cc +++ b/src/main.cc @@ -92,6 +92,8 @@ bool insert_char(IncrementalInserter& inserter, const Key& key) break; } break; + default: + break; } return true; }