Skip to content

Commit

Permalink
Add -pedantic to debug CFLAGS and fix resulting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jan 13, 2016
1 parent 8ab73e6 commit 24bf7a5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
24 changes: 12 additions & 12 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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[] = {
Expand All @@ -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[] = {
Expand All @@ -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[] = {
Expand All @@ -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[] = {
Expand All @@ -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 */ },
};
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion text-regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
#endif
6 changes: 5 additions & 1 deletion view.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@

#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"

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 */
Expand Down
2 changes: 1 addition & 1 deletion vis-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};


Expand Down
2 changes: 1 addition & 1 deletion vis-lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
#endif

0 comments on commit 24bf7a5

Please sign in to comment.