Add -Wmissing-prototypes

This requires functions without a prototype definition to be static.
This allows to detect dead code, export less symbols and put shared
functions in headers.
This commit is contained in:
Simon Ser 2019-11-20 00:45:19 +01:00 committed by Scott Anderson
parent 685a5a11a9
commit 16e5e9541b
24 changed files with 66 additions and 123 deletions

View file

@ -36,7 +36,7 @@ struct sample_keyboard {
struct wl_listener destroy;
};
void output_frame_notify(struct wl_listener *listener, void *data) {
static void output_frame_notify(struct wl_listener *listener, void *data) {
struct sample_output *sample_output =
wl_container_of(listener, sample_output, frame);
struct sample_state *sample = sample_output->sample;
@ -65,7 +65,7 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
sample->last_frame = now;
}
void output_remove_notify(struct wl_listener *listener, void *data) {
static void output_remove_notify(struct wl_listener *listener, void *data) {
struct sample_output *sample_output =
wl_container_of(listener, sample_output, destroy);
wlr_log(WLR_DEBUG, "Output removed");
@ -74,7 +74,7 @@ void output_remove_notify(struct wl_listener *listener, void *data) {
free(sample_output);
}
void new_output_notify(struct wl_listener *listener, void *data) {
static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output *output = data;
struct sample_state *sample =
wl_container_of(listener, sample, new_output);
@ -93,7 +93,7 @@ void new_output_notify(struct wl_listener *listener, void *data) {
sample_output->destroy.notify = output_remove_notify;
}
void keyboard_key_notify(struct wl_listener *listener, void *data) {
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key);
struct sample_state *sample = keyboard->sample;
struct wlr_event_keyboard_key *event = data;
@ -109,7 +109,7 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) {
}
}
void keyboard_destroy_notify(struct wl_listener *listener, void *data) {
static void keyboard_destroy_notify(struct wl_listener *listener, void *data) {
struct sample_keyboard *keyboard =
wl_container_of(listener, keyboard, destroy);
wl_list_remove(&keyboard->destroy.link);
@ -117,7 +117,7 @@ void keyboard_destroy_notify(struct wl_listener *listener, void *data) {
free(keyboard);
}
void new_input_notify(struct wl_listener *listener, void *data) {
static void new_input_notify(struct wl_listener *listener, void *data) {
struct wlr_input_device *device = data;
struct sample_state *sample = wl_container_of(listener, sample, new_input);
switch (device->type) {