aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-01-06 14:05:17 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-01-06 14:05:17 +0100
commitb84d93ce6db52805a8816412e4bf93d22f078e53 (patch)
tree8fcfe0e81812544929d63aaffa35f47c54368f70
parent4e75766e915d78cb47008aae805807a2ad038935 (diff)
downloadvis-b84d93ce6db52805a8816412e4bf93d22f078e53.tar.gz
vis-b84d93ce6db52805a8816412e4bf93d22f078e53.tar.xz
Fix some compiler warnings
-rw-r--r--config.def.h5
-rw-r--r--vis.c4
-rw-r--r--window.c2
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) {