vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 40192f1452344df10bac4eb2c1116c1e38b38699 parent 35daacfef99180260f71ee99160db17e92ef601d Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 13 Jan 2016 12:25:09 +0100 Add -pedantic to debug CFLAGS and fix resulting warnings Diffstat:
| M | config.def.h | | | 24 | ++++++++++++------------ |
| M | config.mk | | | 2 | +- |
| M | text-regex.h | | | 3 | +-- |
| M | view.h | | | 6 | +++++- |
| M | vis-cmds.c | | | 2 | +- |
| M | vis-lua.h | | | 3 | +-- |
6 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/config.def.h b/config.def.h @@ -54,7 +54,7 @@ static KeyBinding basic_movement[] = { { "<S-PageDown>", ACTION(WINDOW_HALFPAGE_DOWN) }, { "<Home>", ACTION(CURSOR_LINE_BEGIN) }, { "<End>", ACTION(CURSOR_LINE_END) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_movements[] = { @@ -116,7 +116,7 @@ static KeyBinding vis_movements[] = { { "?", ACTION(PROMPT_SEARCH_BACKWARD) }, { "`", ACTION(MARK_GOTO) }, { "'", ACTION(MARK_GOTO_LINE) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_textobjs[] = { @@ -160,7 +160,7 @@ static KeyBinding vis_textobjs[] = { { "ie", ACTION(TEXT_OBJECT_ENTIRE_INNER) }, { "if", ACTION(TEXT_OBJECT_FUNCTION_INNER) }, { "il", ACTION(TEXT_OBJECT_LINE_INNER) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_operators[] = { @@ -190,13 +190,13 @@ static KeyBinding vis_operators[] = { { "!", ACTION(OPERATOR_FILTER) }, { "=", ACTION(OPERATOR_FILTER_FMT) }, { "\"", ACTION(REGISTER) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_operator_options[] = { { "v", ACTION(MOTION_CHARWISE) }, { "V", ACTION(MOTION_LINEWISE) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_normal[] = { @@ -268,7 +268,7 @@ static KeyBinding vis_mode_normal[] = { { "m", ACTION(MARK_SET) }, { "<F1>", ALIAS(":help<Enter>") }, { "ga", ACTION(UNICODE_INFO) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_visual[] = { @@ -290,13 +290,13 @@ static KeyBinding vis_mode_visual[] = { { "s", ALIAS("c") }, { "J", ACTION(JOIN_LINES) }, { "o", ACTION(SELECTION_FLIP) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_visual_line[] = { { "v", ACTION(MODE_VISUAL) }, { "V", ACTION(MODE_NORMAL) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_readline[] = { @@ -309,7 +309,7 @@ static KeyBinding vis_mode_readline[] = { { "<C-w>", ACTION(DELETE_WORD_PREV) }, { "<C-u>", ACTION(DELETE_LINE_BEGIN) }, { "<C-v>", ACTION(INSERT_VERBATIM) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_prompt[] = { @@ -318,7 +318,7 @@ static KeyBinding vis_mode_prompt[] = { { "<Enter>", ACTION(PROMPT_ENTER) }, { "<C-j>", ALIAS("<Enter>") }, { "<Tab>", ACTION(NOP) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_insert[] = { @@ -335,9 +335,9 @@ static KeyBinding vis_mode_insert[] = { { "<C-x><C-y>", ACTION(WINDOW_SLIDE_DOWN) }, { "<Tab>", ACTION(INSERT_TAB) }, { "<C-r>", ACTION(INSERT_REGISTER) }, - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; static KeyBinding vis_mode_replace[] = { - { /* empty last element, array terminator */ }, + { 0 /* empty last element, array terminator */ }, }; diff --git a/config.mk b/config.mk @@ -57,7 +57,7 @@ LDFLAGS_LIBS = $(LDFLAGS_LUA) $(LDFLAGS_TERMKEY) $(LDFLAGS_CURSES) $(LIBS) CFLAGS_VIS = $(CFLAGS_LIBS) -std=c99 -Os -DVERSION=\"${VERSION}\" -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_ALL LDFLAGS_VIS = $(LDFLAGS_LIBS) -DEBUG_CFLAGS_VIS = ${CFLAGS_VIS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter +DEBUG_CFLAGS_VIS = ${CFLAGS_VIS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -pedantic -Wno-missing-field-initializers -Wno-unused-parameter CC ?= cc STRIP ?= strip diff --git a/text-regex.h b/text-regex.h @@ -12,4 +12,4 @@ void text_regex_free(Regex *r); int text_search_range_forward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags); int text_search_range_backward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags); -#endif -\ No newline at end of file +#endif diff --git a/view.h b/view.h @@ -3,6 +3,11 @@ #include <stddef.h> #include <stdbool.h> +#if CONFIG_LUA +#include <lua.h> +#else +typedef struct lua_State lua_State; +#endif #include "register.h" #include "text.h" #include "ui.h" @@ -10,7 +15,6 @@ typedef struct View View; typedef struct Cursor Cursor; typedef struct Selection Selection; -typedef struct lua_State lua_State; typedef struct { int width; /* display width i.e. number of columns ocupied by this character */ diff --git a/vis-cmds.c b/vis-cmds.c @@ -103,7 +103,7 @@ static Command cmds[] = { { { "earlier" }, cmd_earlier_later, CMD_OPT_NONE }, { { "later" }, cmd_earlier_later, CMD_OPT_NONE }, { { "!", }, cmd_filter, CMD_OPT_NONE }, - { /* array terminator */ }, + { { NULL, }, NULL, CMD_OPT_NONE }, }; diff --git a/vis-lua.h b/vis-lua.h @@ -19,4 +19,4 @@ void vis_lua_file_close(Vis*, File*); void vis_lua_win_open(Vis*, Win*); void vis_lua_win_close(Vis*, Win*); -#endif -\ No newline at end of file +#endif