Enforce strict prototypes

i3 will now compile with no warnings when -Wstrict-prototypes is used.
This commit is contained in:
Orestis Floros 2018-04-21 02:00:10 +03:00
parent a15fff2370
commit 2a9522dda4
No known key found for this signature in database
GPG Key ID: E9AD9F32E401E38F
10 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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

View File

@ -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,

View File

@ -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.

View File

@ -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.

View File

@ -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")".

View File

@ -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);

View File

@ -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 {