diff --git a/src/Makefile b/src/Makefile index e2e182dc..a0d86379 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ sources := $(wildcard *.cc) objects := $(sources:.cc=.o) deps := $(addprefix ., $(sources:.cc=.d)) -CXXFLAGS += -std=c++0x -g +CXXFLAGS += -std=c++0x -g -Wall -Wno-reorder -Wno-sign-compare LDFLAGS += -lmenu -lncurses -lboost_regex kak : $(objects) diff --git a/src/buffer.cc b/src/buffer.cc index 1fb9ab7e..91e5f405 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -344,17 +344,15 @@ void Buffer::apply_modification(const Modification& modification) { case Modification::Insert: { - BufferIterator pos = modification.position < end() ? - modification.position : end(); - do_insert(pos, modification.content); + do_insert(pos < end() ? pos : end(), content); break; } case Modification::Erase: { - ByteCount count = modification.content.length(); - BufferIterator end = modification.position + count; - assert(string(modification.position, end) == modification.content); - do_erase(modification.position, end); + ByteCount count = content.length(); + BufferIterator end = pos + count; + assert(string(pos, end) == content); + do_erase(pos, end); break; } default: diff --git a/src/client.cc b/src/client.cc index 9802f623..27c85f19 100644 --- a/src/client.cc +++ b/src/client.cc @@ -486,6 +486,8 @@ public: break; } break; + default: + break; } if (reset_completer) m_completer.reset(context); diff --git a/src/color_registry.cc b/src/color_registry.cc index 360e08f4..f380c4fa 100644 --- a/src/color_registry.cc +++ b/src/color_registry.cc @@ -32,7 +32,7 @@ const ColorPair& ColorRegistry::operator[](const String& colordesc) parse_color(String(it+1, colordesc.end())) : Color::Default }; - m_aliases[colordesc] = colpair; + return (m_aliases[colordesc] = colpair); } void ColorRegistry::register_alias(const String& name, const String& colordesc, diff --git a/src/display_buffer.hh b/src/display_buffer.hh index aa54f1f6..884d45b0 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -54,6 +54,8 @@ public: case ReplacedBufferRange: return m_text; } + assert(false); + return 0; } CharCount length() const @@ -66,6 +68,8 @@ public: case ReplacedBufferRange: return m_text.char_length(); } + assert(false); + return 0; } const BufferIterator& begin() const diff --git a/src/selectors.cc b/src/selectors.cc index 0a80f58d..24e552c9 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -170,9 +170,9 @@ SelectionAndCaptures select_line(const Selection& selection) SelectionAndCaptures select_matching(const Selection& selection) { - std::vector matching_pairs = { '(', ')', '{', '}', '[', ']', '<', '>' }; + std::vector matching_pairs = { '(', ')', '{', '}', '[', ']', '<', '>' }; Utf8Iterator it = selection.last(); - std::vector::iterator match = matching_pairs.end(); + std::vector::iterator match = matching_pairs.end(); while (not is_eol(*it)) { match = std::find(matching_pairs.begin(), matching_pairs.end(), *it); @@ -188,8 +188,8 @@ SelectionAndCaptures select_matching(const Selection& selection) if (((match - matching_pairs.begin()) % 2) == 0) { int level = 0; - const char opening = *match; - const char closing = *(match+1); + const Codepoint opening = *match; + const Codepoint closing = *(match+1); while (not is_end(it)) { if (*it == opening) @@ -203,8 +203,8 @@ SelectionAndCaptures select_matching(const Selection& selection) else { int level = 0; - const char opening = *(match-1); - const char closing = *match; + const Codepoint opening = *(match-1); + const Codepoint closing = *match; while (not is_begin(it)) { if (*it == closing)