mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
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:
parent
685a5a11a9
commit
16e5e9541b
24 changed files with 66 additions and 123 deletions
|
|
@ -461,7 +461,7 @@ static void register_cb(struct capture_context *ctx) {
|
|||
&frame_listener, ctx);
|
||||
}
|
||||
|
||||
void *vid_encode_thread(void *arg) {
|
||||
static void *vid_encode_thread(void *arg) {
|
||||
int err = 0;
|
||||
struct capture_context *ctx = arg;
|
||||
|
||||
|
|
@ -686,7 +686,7 @@ static int init_encoding(struct capture_context *ctx) {
|
|||
|
||||
struct capture_context *q_ctx = NULL;
|
||||
|
||||
void on_quit_signal(int signo) {
|
||||
static void on_quit_signal(int signo) {
|
||||
printf("\r");
|
||||
av_log(q_ctx, AV_LOG_WARNING, "Quitting!\n");
|
||||
q_ctx->quit = true;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static const struct org_kde_kwin_idle_timeout_listener idle_timer_listener = {
|
|||
.resumed = handle_resume,
|
||||
};
|
||||
|
||||
int parse_args(int argc, char *argv[]) {
|
||||
static int parse_args(int argc, char *argv[]) {
|
||||
int c;
|
||||
while ((c = getopt(argc, argv, "c:hs:t:")) != -1) {
|
||||
switch(c)
|
||||
|
|
@ -81,7 +81,7 @@ int parse_args(int argc, char *argv[]) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void *simulate_activity(void *data) {
|
||||
static void *simulate_activity(void *data) {
|
||||
sleep(simulate_activity_timeout);
|
||||
fprintf(stdout, "simulate user activity\n");
|
||||
struct thread_args *arg = data;
|
||||
|
|
@ -90,7 +90,7 @@ void *simulate_activity(void *data) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void *close_program(void *data) {
|
||||
static void *close_program(void *data) {
|
||||
sleep(close_timeout);
|
||||
struct thread_args *arg = data;
|
||||
org_kde_kwin_idle_timeout_release(arg->timer);
|
||||
|
|
@ -100,7 +100,7 @@ void *close_program(void *data) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void *main_loop(void *data) {
|
||||
static void *main_loop(void *data) {
|
||||
struct wl_display *display = data;
|
||||
while (wl_display_dispatch(display) != -1) {
|
||||
;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ struct sample_keyboard {
|
|||
struct wl_listener destroy;
|
||||
};
|
||||
|
||||
void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device,
|
||||
static void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device,
|
||||
struct sample_state *sample) {
|
||||
struct sample_output *output;
|
||||
wlr_log(WLR_ERROR, "Configuring cursor %p for device %p", cursor, device);
|
||||
|
|
@ -88,7 +88,7 @@ void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device
|
|||
}
|
||||
}
|
||||
|
||||
void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
struct sample_output *output = wl_container_of(listener, output, frame);
|
||||
struct sample_state *sample = output->sample;
|
||||
struct wlr_output *wlr_output = output->output;
|
||||
|
|
@ -127,27 +127,7 @@ static void cursor_destroy(struct sample_cursor *cursor) {
|
|||
free(cursor);
|
||||
}
|
||||
|
||||
void input_remove_notify(struct wl_listener *listener, void *data) {
|
||||
struct wlr_input_device *device = data;
|
||||
struct sample_cursor *sample_cursor = wl_container_of(listener, sample_cursor, destroy);
|
||||
struct sample_state *sample = sample_cursor->sample;
|
||||
struct sample_cursor *cursor;
|
||||
wl_list_for_each(cursor, &sample->cursors, link) {
|
||||
if (cursor->device == device) {
|
||||
cursor_destroy(cursor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
struct sample_pointer *pointer;
|
||||
wl_list_for_each(pointer, &sample->pointers, link) {
|
||||
if (pointer->device == device) {
|
||||
free(pointer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
struct sample_state *sample = sample_output->sample;
|
||||
wl_list_remove(&sample_output->frame.link);
|
||||
|
|
@ -161,7 +141,7 @@ void output_remove_notify(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
||||
|
|
@ -193,7 +173,7 @@ void new_output_notify(struct wl_listener *listener, void *data) {
|
|||
wl_list_insert(&sample->outputs, &sample_output->link);
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
@ -209,14 +189,14 @@ 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);
|
||||
wl_list_remove(&keyboard->key.link);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ static void animate_cat(struct sample_state *sample,
|
|||
sample->ts_last = ts;
|
||||
}
|
||||
|
||||
void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
static void output_frame_notify(struct wl_listener *listener, void *data) {
|
||||
struct sample_output *output = wl_container_of(listener, output, frame);
|
||||
struct sample_state *sample = output->sample;
|
||||
struct timespec ts;
|
||||
|
|
@ -145,7 +145,7 @@ static void update_velocities(struct sample_state *sample,
|
|||
sample->y_vel += y_diff;
|
||||
}
|
||||
|
||||
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);
|
||||
struct sample_state *sample = sample_output->sample;
|
||||
wlr_output_layout_remove(sample->layout, sample_output->output);
|
||||
|
|
@ -154,7 +154,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);
|
||||
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
||||
|
|
@ -171,7 +171,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;
|
||||
|
|
@ -207,14 +207,14 @@ 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);
|
||||
wl_list_remove(&keyboard->key.link);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ static void warp_to_touch(struct sample_state *state,
|
|||
wlr_cursor_warp_absolute(state->cursor, dev, x, y);
|
||||
}
|
||||
|
||||
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 *state = sample_output->state;
|
||||
struct wlr_output *wlr_output = sample_output->output;
|
||||
|
|
@ -221,7 +221,7 @@ static void handle_tablet_tool_axis(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
}
|
||||
|
||||
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->state;
|
||||
struct wlr_event_keyboard_key *event = data;
|
||||
|
|
@ -237,7 +237,7 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
struct sample_state *sample = sample_output->state;
|
||||
wlr_output_layout_remove(sample->layout, sample_output->output);
|
||||
|
|
@ -246,7 +246,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);
|
||||
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
||||
|
|
@ -268,14 +268,14 @@ void new_output_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);
|
||||
wl_list_remove(&keyboard->key.link);
|
||||
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 *state = wl_container_of(listener, state, new_input);
|
||||
switch (device->type) {
|
||||
|
|
|
|||
|
|
@ -97,14 +97,14 @@ static void update_velocities(struct sample_state *sample,
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
wl_list_remove(&sample_output->frame.link);
|
||||
wl_list_remove(&sample_output->destroy.link);
|
||||
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);
|
||||
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
||||
|
|
@ -125,7 +125,7 @@ void new_output_notify(struct wl_listener *listener, void *data) {
|
|||
wl_list_insert(&sample->outputs, &sample_output->link);
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
@ -157,14 +157,14 @@ 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);
|
||||
wl_list_remove(&keyboard->key.link);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -227,14 +227,14 @@ static void tablet_pad_destroy_notify(struct wl_listener *listener, void *data)
|
|||
free(pstate);
|
||||
}
|
||||
|
||||
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);
|
||||
wl_list_remove(&sample_output->frame.link);
|
||||
wl_list_remove(&sample_output->destroy.link);
|
||||
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);
|
||||
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
||||
|
|
@ -250,7 +250,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;
|
||||
|
|
@ -266,14 +266,14 @@ 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);
|
||||
wl_list_remove(&keyboard->key.link);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -140,14 +140,14 @@ static void touch_destroy_notify(struct wl_listener *listener, void *data) {
|
|||
free(tstate);
|
||||
}
|
||||
|
||||
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);
|
||||
wl_list_remove(&sample_output->frame.link);
|
||||
wl_list_remove(&sample_output->destroy.link);
|
||||
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);
|
||||
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
||||
|
|
@ -163,7 +163,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;
|
||||
|
|
@ -179,14 +179,14 @@ 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);
|
||||
wl_list_remove(&keyboard->key.link);
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue