diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp index d2e9856c6..7f8df7cab 100644 --- a/src/fish_indent.cpp +++ b/src/fish_indent.cpp @@ -84,7 +84,9 @@ static void dump_node(indent_t node_indent, const parse_node_t &node, const wcst wcstring source_txt = L""; if (node.source_start != SOURCE_OFFSET_INVALID && node.source_length != SOURCE_OFFSET_INVALID) { int nextc_idx = node.source_start + node.source_length; - if (nextc_idx < source.size()) nextc = source[node.source_start + node.source_length]; + if ((size_t)nextc_idx < source.size()) { + nextc = source[node.source_start + node.source_length]; + } if (node.source_start > 0) prevc = source[node.source_start - 1]; source_txt = source.substr(node.source_start, node.source_length); } diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index 7771a6309..c2deb5076 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -54,7 +54,7 @@ static bool should_exit(wchar_t wc) { } /// Return the name if the recent sequence of characters matches a known terminfo sequence. -static char *const sequence_name(wchar_t wc) { +static char *sequence_name(wchar_t wc) { unsigned char c = wc < 0x80 ? wc : 0; static char recent_chars[8] = {0}; @@ -157,7 +157,7 @@ static void add_char_to_bind_command(wchar_t wc, std::vector &bind_char static void output_bind_command(std::vector &bind_chars) { if (bind_chars.size()) { fputs("bind ", stdout); - for (int i = 0; i < bind_chars.size(); i++) { + for (size_t i = 0; i < bind_chars.size(); i++) { fputs(char_to_symbol(bind_chars[i], true), stdout); } fputs(" 'do something'\n", stdout);