From: Orestis Floros Date: Fri, 20 Apr 2018 23:00:10 +0000 (+0300) Subject: Enforce strict prototypes X-Git-Tag: 4.16~14^2~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2a9522dda41ed05d5799180e2a00db5ec6373117;p=i3%2Fi3 Enforce strict prototypes i3 will now compile with no warnings when -Wstrict-prototypes is used. --- diff --git a/.travis.yml b/.travis.yml index 87c996fb..b7897a5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ install: script: - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-safe-wrappers.sh - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-formatting.sh - - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"' + - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Werror"' - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index 988654d2..4b556657 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -104,7 +104,7 @@ static struct xkb_keymap *xkb_keymap; static uint8_t xkb_base_event; static uint8_t xkb_base_error; -static void finish(); +static void finish(void); #include "GENERATED_config_enums.h" @@ -482,7 +482,7 @@ static void txt(int col, int row, char *text, color_t fg, color_t bg) { * Handles expose events, that is, draws the window contents. * */ -static int handle_expose() { +static int handle_expose(void) { const color_t black = draw_util_hex_to_color("#000000"); const color_t white = draw_util_hex_to_color("#FFFFFF"); const color_t green = draw_util_hex_to_color("#00FF00"); @@ -641,7 +641,7 @@ static void handle_button_press(xcb_button_press_event_t *event) { * Creates the config file and tells i3 to reload. * */ -static void finish() { +static void finish(void) { printf("creating \"%s\"...\n", config_path); struct xkb_context *xkb_context; diff --git a/i3-input/main.c b/i3-input/main.c index efb7b20c..d1a2efd7 100644 --- a/i3-input/main.c +++ b/i3-input/main.c @@ -156,7 +156,7 @@ static int handle_key_release(void *ignored, xcb_connection_t *conn, xcb_key_rel return 1; } -static void finish_input() { +static void finish_input(void) { char *command = (char *)concat_strings(glyphs_utf8, input_position); /* count the occurrences of %s in the string */ diff --git a/i3bar/include/xcb.h b/i3bar/include/xcb.h index 7783e877..760ebcdb 100644 --- a/i3bar/include/xcb.h +++ b/i3bar/include/xcb.h @@ -60,7 +60,7 @@ int separator_symbol_width; * depend on 'config'. * */ -char *init_xcb_early(); +char *init_xcb_early(void); /** * Initialization which depends on 'config' being usable. Called after the diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index f4509c26..66d2fca6 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -1185,7 +1185,7 @@ void xcb_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) { * depend on 'config'. * */ -char *init_xcb_early() { +char *init_xcb_early(void) { /* FIXME: xcb_connect leaks memory */ xcb_connection = xcb_connect(NULL, &screen); if (xcb_connection_has_error(xcb_connection)) { @@ -1248,7 +1248,7 @@ char *init_xcb_early() { * in xcb. * */ -void register_xkb_keyevents() { +void register_xkb_keyevents(void) { const xcb_query_extension_reply_t *extreply; extreply = xcb_get_extension_data(conn, &xcb_xkb_id); if (!extreply->present) { @@ -1272,7 +1272,7 @@ void register_xkb_keyevents() { * Deregister from xkb keyevents. * */ -void deregister_xkb_keyevents() { +void deregister_xkb_keyevents(void) { xcb_xkb_select_events(conn, XCB_XKB_ID_USE_CORE_KBD, 0, diff --git a/include/configuration.h b/include/configuration.h index 3eccca4c..d99d9fff 100644 --- a/include/configuration.h +++ b/include/configuration.h @@ -427,7 +427,7 @@ void ungrab_all_keys(xcb_connection_t *conn); * Sends the current bar configuration as an event to all barconfig_update listeners. * */ -void update_barconfig(); +void update_barconfig(void); /** * Kills the configerror i3-nagbar process, if any. diff --git a/include/libi3.h b/include/libi3.h index d27437ba..bcd2b7b1 100644 --- a/include/libi3.h +++ b/include/libi3.h @@ -472,7 +472,7 @@ xcb_visualtype_t *get_visualtype(xcb_screen_t *screen); * release version), based on the git version number. * */ -bool is_debug_build() __attribute__((const)); +bool is_debug_build(void) __attribute__((const)); /** * Returns the name of a temporary file with the specified prefix. diff --git a/libi3/is_debug_build.c b/libi3/is_debug_build.c index 4e583622..52187bda 100644 --- a/libi3/is_debug_build.c +++ b/libi3/is_debug_build.c @@ -15,7 +15,7 @@ * release version), based on the git version number. * */ -bool is_debug_build() { +bool is_debug_build(void) { /* i3_version contains either something like this: * "4.0.2 (2011-11-11, branch "release")". * or: "4.0.2-123-gCOFFEEBABE (2011-11-11, branch "next")". diff --git a/src/config.c b/src/config.c index 5be1fd52..74504bc1 100644 --- a/src/config.c +++ b/src/config.c @@ -32,7 +32,7 @@ void ungrab_all_keys(xcb_connection_t *conn) { * Sends the current bar configuration as an event to all barconfig_update listeners. * */ -void update_barconfig() { +void update_barconfig(void) { Barconfig *current; TAILQ_FOREACH(current, &barconfigs, configs) { ipc_send_barconfig_update_event(current); diff --git a/src/x.c b/src/x.c index 1f54db83..581ec512 100644 --- a/src/x.c +++ b/src/x.c @@ -1254,7 +1254,7 @@ void x_set_name(Con *con, const char *name) { * Set up the I3_SHMLOG_PATH atom. * */ -void update_shmlog_atom() { +void update_shmlog_atom(void) { if (*shmlogname == '\0') { xcb_delete_property(conn, root, A_I3_SHMLOG_PATH); } else {