From 6ba9f33dc9a2a2ad5cfb352ea7480872121aada2 Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Sun, 13 Apr 2014 22:45:51 +0000 Subject: [PATCH] fix compile warnings --- clang.c | 8 ++++---- script.c | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/clang.c b/clang.c index 0dfd577..da6d80b 100644 --- a/clang.c +++ b/clang.c @@ -724,7 +724,7 @@ static int ustr_match_mask(const unsigned int *buf, const char *str) static void do_c_forward_conditional(EditState *s, int dir) { unsigned int buf[COLORED_MAX_LINE_SIZE], *p; - int line_num, col_num, len, sharp, level; + int line_num, col_num, sharp, level; int offset, offset0, offset1; offset = offset0 = eb_goto_bol(s->b, s->offset); @@ -732,7 +732,7 @@ static void do_c_forward_conditional(EditState *s, int dir) level = 0; for (;;) { offset1 = offset; - len = s->get_colorized_line(s, buf, countof(buf), &offset1, line_num); + s->get_colorized_line(s, buf, countof(buf), &offset1, line_num); sharp = 0; for (p = buf; *p; p++) { int c = (*p & CHAR_MASK); @@ -783,7 +783,7 @@ static void do_c_forward_conditional(EditState *s, int dir) static void do_c_list_conditionals(EditState *s) { unsigned int buf[COLORED_MAX_LINE_SIZE], *p; - int line_num, col_num, len, sharp, level; + int line_num, col_num, sharp, level; int offset, offset1; EditBuffer *b; @@ -798,7 +798,7 @@ static void do_c_list_conditionals(EditState *s) line_num--; offset = eb_prev_line(s->b, offset); offset1 = offset; - len = s->get_colorized_line(s, buf, countof(buf), &offset1, line_num); + s->get_colorized_line(s, buf, countof(buf), &offset1, line_num); sharp = 0; for (p = buf; *p; p++) { int c = (*p & CHAR_MASK); diff --git a/script.c b/script.c index 518e09c..0144a5e 100644 --- a/script.c +++ b/script.c @@ -71,13 +71,14 @@ static void script_colorize_line(QEColorizeContext *cp, /* parse string const */ for (i++; i < n;) { c = str[i++]; - if (c == '\\' && str[i] == '"' && str[start] == '"') + if (c == '\\' && i < n && str[start] == '"') i++; + else if (c == str[start]) break; } SET_COLOR(str, start, i, style); - if (c == str[start]) + if (i < n) style = SCRIPT_STYLE_TEXT; continue; case ' ':