Enforce strict prototypes
i3 will now compile with no warnings when -Wstrict-prototypes is used.
This commit is contained in:
parent
a15fff2370
commit
2a9522dda4
|
@ -35,7 +35,7 @@ install:
|
||||||
script:
|
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-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 ${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 ${BASENAME} ./travis/check-spelling.pl
|
||||||
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh
|
- 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
|
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST
|
||||||
|
|
|
@ -104,7 +104,7 @@ static struct xkb_keymap *xkb_keymap;
|
||||||
static uint8_t xkb_base_event;
|
static uint8_t xkb_base_event;
|
||||||
static uint8_t xkb_base_error;
|
static uint8_t xkb_base_error;
|
||||||
|
|
||||||
static void finish();
|
static void finish(void);
|
||||||
|
|
||||||
#include "GENERATED_config_enums.h"
|
#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.
|
* 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 black = draw_util_hex_to_color("#000000");
|
||||||
const color_t white = draw_util_hex_to_color("#FFFFFF");
|
const color_t white = draw_util_hex_to_color("#FFFFFF");
|
||||||
const color_t green = draw_util_hex_to_color("#00FF00");
|
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.
|
* Creates the config file and tells i3 to reload.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void finish() {
|
static void finish(void) {
|
||||||
printf("creating \"%s\"...\n", config_path);
|
printf("creating \"%s\"...\n", config_path);
|
||||||
|
|
||||||
struct xkb_context *xkb_context;
|
struct xkb_context *xkb_context;
|
||||||
|
|
|
@ -156,7 +156,7 @@ static int handle_key_release(void *ignored, xcb_connection_t *conn, xcb_key_rel
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void finish_input() {
|
static void finish_input(void) {
|
||||||
char *command = (char *)concat_strings(glyphs_utf8, input_position);
|
char *command = (char *)concat_strings(glyphs_utf8, input_position);
|
||||||
|
|
||||||
/* count the occurrences of %s in the string */
|
/* count the occurrences of %s in the string */
|
||||||
|
|
|
@ -60,7 +60,7 @@ int separator_symbol_width;
|
||||||
* depend on 'config'.
|
* depend on 'config'.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *init_xcb_early();
|
char *init_xcb_early(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization which depends on 'config' being usable. Called after the
|
* Initialization which depends on 'config' being usable. Called after the
|
||||||
|
|
|
@ -1185,7 +1185,7 @@ void xcb_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) {
|
||||||
* depend on 'config'.
|
* depend on 'config'.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *init_xcb_early() {
|
char *init_xcb_early(void) {
|
||||||
/* FIXME: xcb_connect leaks memory */
|
/* FIXME: xcb_connect leaks memory */
|
||||||
xcb_connection = xcb_connect(NULL, &screen);
|
xcb_connection = xcb_connect(NULL, &screen);
|
||||||
if (xcb_connection_has_error(xcb_connection)) {
|
if (xcb_connection_has_error(xcb_connection)) {
|
||||||
|
@ -1248,7 +1248,7 @@ char *init_xcb_early() {
|
||||||
* in xcb.
|
* in xcb.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void register_xkb_keyevents() {
|
void register_xkb_keyevents(void) {
|
||||||
const xcb_query_extension_reply_t *extreply;
|
const xcb_query_extension_reply_t *extreply;
|
||||||
extreply = xcb_get_extension_data(conn, &xcb_xkb_id);
|
extreply = xcb_get_extension_data(conn, &xcb_xkb_id);
|
||||||
if (!extreply->present) {
|
if (!extreply->present) {
|
||||||
|
@ -1272,7 +1272,7 @@ void register_xkb_keyevents() {
|
||||||
* Deregister from xkb keyevents.
|
* Deregister from xkb keyevents.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void deregister_xkb_keyevents() {
|
void deregister_xkb_keyevents(void) {
|
||||||
xcb_xkb_select_events(conn,
|
xcb_xkb_select_events(conn,
|
||||||
XCB_XKB_ID_USE_CORE_KBD,
|
XCB_XKB_ID_USE_CORE_KBD,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -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.
|
* 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.
|
* Kills the configerror i3-nagbar process, if any.
|
||||||
|
|
|
@ -472,7 +472,7 @@ xcb_visualtype_t *get_visualtype(xcb_screen_t *screen);
|
||||||
* release version), based on the git version number.
|
* 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.
|
* Returns the name of a temporary file with the specified prefix.
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* release version), based on the git version number.
|
* release version), based on the git version number.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool is_debug_build() {
|
bool is_debug_build(void) {
|
||||||
/* i3_version contains either something like this:
|
/* i3_version contains either something like this:
|
||||||
* "4.0.2 (2011-11-11, branch "release")".
|
* "4.0.2 (2011-11-11, branch "release")".
|
||||||
* or: "4.0.2-123-gCOFFEEBABE (2011-11-11, branch "next")".
|
* or: "4.0.2-123-gCOFFEEBABE (2011-11-11, branch "next")".
|
||||||
|
|
|
@ -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.
|
* Sends the current bar configuration as an event to all barconfig_update listeners.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void update_barconfig() {
|
void update_barconfig(void) {
|
||||||
Barconfig *current;
|
Barconfig *current;
|
||||||
TAILQ_FOREACH(current, &barconfigs, configs) {
|
TAILQ_FOREACH(current, &barconfigs, configs) {
|
||||||
ipc_send_barconfig_update_event(current);
|
ipc_send_barconfig_update_event(current);
|
||||||
|
|
2
src/x.c
2
src/x.c
|
@ -1254,7 +1254,7 @@ void x_set_name(Con *con, const char *name) {
|
||||||
* Set up the I3_SHMLOG_PATH atom.
|
* Set up the I3_SHMLOG_PATH atom.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void update_shmlog_atom() {
|
void update_shmlog_atom(void) {
|
||||||
if (*shmlogname == '\0') {
|
if (*shmlogname == '\0') {
|
||||||
xcb_delete_property(conn, root, A_I3_SHMLOG_PATH);
|
xcb_delete_property(conn, root, A_I3_SHMLOG_PATH);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue