From b84d93ce6db52805a8816412e4bf93d22f078e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 6 Jan 2015 14:05:17 +0100 Subject: Fix some compiler warnings --- config.def.h | 5 +++-- vis.c | 4 ++-- window.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h index 370fb1b..54d6d7c 100644 --- a/config.def.h +++ b/config.def.h @@ -22,8 +22,6 @@ * if no binding is found, mode->input(...) is called and the user entered * keys are passed as argument. this is used to change the document content. */ -static Mode vis_modes[]; - enum { VIS_MODE_BASIC, VIS_MODE_MARK, @@ -43,8 +41,11 @@ enum { VIS_MODE_INSERT_REGISTER, VIS_MODE_INSERT, VIS_MODE_REPLACE, + VIS_MODE_LAST, }; +static Mode vis_modes[VIS_MODE_LAST]; + /* command recognized at the ':'-prompt. tested top to bottom, first match wins. */ static Command cmds[] = { { "^bd(elete)?!?$", cmd_bdelete, false }, diff --git a/vis.c b/vis.c index 793e9a4..5436a62 100644 --- a/vis.c +++ b/vis.c @@ -1110,7 +1110,7 @@ static void insert(const Arg *arg) { } static void insert_tab(const Arg *arg) { - return insert(&(const Arg){ .s = expand_tab() }); + insert(&(const Arg){ .s = expand_tab() }); } static void copy_indent_from_previous_line(Win *win, Text *text) { @@ -1946,7 +1946,7 @@ static Key getkey(void) { int len = 1; unsigned char keychar = keycode; if (ISASCII(keychar)) len = 1; - else if (keychar == '\e' || keychar >= 0xFC) len = 6; + else if (keychar == 0x1B || keychar >= 0xFC) len = 6; else if (keychar >= 0xF8) len = 5; else if (keychar >= 0xF0) len = 4; else if (keychar >= 0xE0) len = 3; diff --git a/window.c b/window.c index 0bceef5..dcd6560 100644 --- a/window.c +++ b/window.c @@ -194,8 +194,8 @@ static bool window_addch(Win *win, Char *c) { if (!win->line) return false; - Cell empty = {}; int width; + Cell empty = { .len = 0, .data = '\0' }; size_t lineno = win->line->lineno; switch (c->wchar) { -- cgit v1.2.3