diff --git a/cagebreak.c b/cagebreak.c index aeddf84..ba359e5 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -10,11 +10,11 @@ #include "config.h" +#include #include +#include #include #include -#include -#include #include #include #include diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 8ce707b..316cf1e 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -1,10 +1,10 @@ /* This file is used by the fuzzer in order to prevent executing shell commands. */ #define _GNU_SOURCE -#include #include "../output.h" #include #include +#include #include int @@ -12,18 +12,18 @@ fork() { return 1; } -void wlr_texture_get_size(struct wlr_texture *texture, int *width, - int *height) { +void +wlr_texture_get_size(struct wlr_texture *texture, int *width, int *height) { if(width != NULL) { - *width=0; + *width = 0; } if(height != NULL) { - *height=0; + *height = 0; } } -cairo_surface_t* +cairo_surface_t * cairo_image_surface_create(cairo_format_t fmt, int width, int height) { return NULL; } diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 746e459..24b15cf 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -51,11 +51,11 @@ #include "keybinding.h" #include "message.h" #include "output.h" -#include "workspace.h" #include "parse.h" #include "seat.h" #include "server.h" #include "view.h" +#include "workspace.h" #include "xdg_shell.h" #if CG_HAS_XWAYLAND #include "xwayland.h" @@ -423,7 +423,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { (union keybinding_params){.c = NULL}); wl_display_flush_clients(server.wl_display); wl_display_destroy_clients(server.wl_display); - struct cg_output* output; + struct cg_output *output; wl_list_for_each(output, &server.outputs, link) { message_clear(output); struct cg_view *view; diff --git a/keybinding.c b/keybinding.c index 9bf5734..f6f5eaf 100644 --- a/keybinding.c +++ b/keybinding.c @@ -649,7 +649,7 @@ int keybinding_switch_ws(struct cg_server *server, uint32_t ws) { if(ws >= server->nws) { wlr_log(WLR_ERROR, - "Requested workspace %u, but only have %u workspaces.", ws+1, + "Requested workspace %u, but only have %u workspaces.", ws + 1, server->nws); return -1; } @@ -716,15 +716,19 @@ keybinding_set_nws(struct cg_server *server, int nws) { wl_list_for_each(output, &server->outputs, link) { for(unsigned int i = nws; i < server->nws; ++i) { struct cg_view *view, *tmp; - wl_list_for_each_safe(view,tmp, &output->workspaces[i]->views,link) { + wl_list_for_each_safe(view, tmp, &output->workspaces[i]->views, + link) { wl_list_remove(&view->link); - wl_list_insert(&output->workspaces[nws-1]->views,&view->link); - view->workspace = output->workspaces[nws-1]; + wl_list_insert(&output->workspaces[nws - 1]->views, + &view->link); + view->workspace = output->workspaces[nws - 1]; } - wl_list_for_each_safe(view,tmp,&output->workspaces[i]->unmanaged_views,link) { + wl_list_for_each_safe( + view, tmp, &output->workspaces[i]->unmanaged_views, link) { wl_list_remove(&view->link); - wl_list_insert(&output->workspaces[nws-1]->unmanaged_views,&view->link); - view->workspace = output->workspaces[nws-1]; + wl_list_insert(&output->workspaces[nws - 1]->unmanaged_views, + &view->link); + view->workspace = output->workspaces[nws - 1]; } workspace_free(output->workspaces[i]); } @@ -746,7 +750,10 @@ keybinding_set_nws(struct cg_server *server, int nws) { } } server->nws = nws; - seat_set_focus(server->seat,server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view); + seat_set_focus( + server->seat, + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->view); } void diff --git a/keybinding.h b/keybinding.h index 42ad114..24f8af2 100644 --- a/keybinding.h +++ b/keybinding.h @@ -44,10 +44,10 @@ enum keybinding_action { KEYBINDING_FOCUS_TOP, KEYBINDING_FOCUS_BOTTOM, - KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition - KEYBINDING_BACKGROUND, //data.color is the background color - KEYBINDING_DEFINEMODE, //data.c is the mode name - KEYBINDING_WORKSPACES, //data.i is the number of workspaces + KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition + KEYBINDING_BACKGROUND, // data.color is the background color + KEYBINDING_DEFINEMODE, // data.c is the mode name + KEYBINDING_WORKSPACES, // data.i is the number of workspaces }; union keybinding_params { @@ -56,7 +56,7 @@ union keybinding_params { int32_t i; bool b; float color[3]; - struct keybinding* kb; + struct keybinding *kb; }; struct keybinding { diff --git a/parse.c b/parse.c index 5b0ac6e..cb6abe3 100644 --- a/parse.c +++ b/parse.c @@ -262,7 +262,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - wlr_log(WLR_ERROR, "Workspace number must be a integer number larger or equal to 1. Got %ld", ws); + wlr_log(WLR_ERROR, + "Workspace number must be a integer number larger or equal " + "to 1. Got %ld", + ws); return -1; } keybinding->data.u = ws - 1; @@ -277,8 +280,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - wlr_log( - WLR_ERROR, "Workspace number must be an integer larger or equal to 1. Got %ld", ws); + wlr_log(WLR_ERROR, + "Workspace number must be an integer larger or equal to 1. " + "Got %ld", + ws); return -1; } keybinding->data.u = ws - 1;