Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Enforce strict prototypes
Browse files Browse the repository at this point in the history
i3 will now compile with no warnings when -Wstrict-prototypes is used.
  • Loading branch information
orestisfl committed Oct 13, 2018
1 parent a15fff2 commit 2a9522d
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions i3-config-wizard/main.c
Expand Up @@ -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"

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion i3-input/main.c
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion i3bar/include/xcb.h
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions i3bar/src/xcb.c
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion include/configuration.h
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion include/libi3.h
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion libi3/is_debug_build.c
Expand Up @@ -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")".
Expand Down
2 changes: 1 addition & 1 deletion src/config.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/x.c
Expand Up @@ -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 {
Expand Down

0 comments on commit 2a9522d

Please sign in to comment.