From d424514e24bbee1c32b19c9192a065c18c9e7fe5 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sat, 17 Sep 2022 12:31:07 +0100 Subject: [PATCH] Fix minor coding-style violations ...based on https://github.com/johanmalm/checkpatch.pl --- include/common/scaled_scene_buffer.h | 1 - include/workspaces.h | 3 +-- src/common/fd_util.c | 8 +++++--- src/common/graphic-helpers.c | 1 - src/common/scaled_scene_buffer.c | 8 ++++---- src/config/rcxml.c | 2 -- src/debug.c | 4 ++-- src/desktop.c | 10 +++++++--- src/interactive.c | 2 +- src/osd.c | 3 ++- src/output.c | 4 ++-- src/server.c | 6 +++--- src/view.c | 1 + src/workspaces.c | 4 +--- 14 files changed, 29 insertions(+), 28 deletions(-) diff --git a/include/common/scaled_scene_buffer.h b/include/common/scaled_scene_buffer.h index fa2cb91f..2057ab24 100644 --- a/include/common/scaled_scene_buffer.h +++ b/include/common/scaled_scene_buffer.h @@ -59,7 +59,6 @@ struct scaled_scene_buffer *scaled_scene_buffer_create( /* Clear the cache of existing buffers, useful in case the content changes */ void scaled_scene_buffer_invalidate_cache(struct scaled_scene_buffer *self); - /* Private */ struct scaled_scene_buffer_cache_entry { struct wl_list link; /* struct scaled_scene_buffer.cache */ diff --git a/include/workspaces.h b/include/workspaces.h index 8b16bd05..8f77339b 100644 --- a/include/workspaces.h +++ b/include/workspaces.h @@ -17,12 +17,11 @@ struct workspace { struct wlr_scene_tree *tree; }; - void workspaces_init(struct server *server); void workspaces_switch_to(struct workspace *target); void workspaces_send_to(struct view *view, struct workspace *target); void workspaces_destroy(struct server *server); void workspaces_osd_hide(struct seat *seat); -struct workspace * workspaces_find(struct workspace *anchor, const char *name); +struct workspace *workspaces_find(struct workspace *anchor, const char *name); #endif /* __LABWC_WORKSPACES_H */ diff --git a/src/common/fd_util.c b/src/common/fd_util.c index f45cad83..e935f02c 100644 --- a/src/common/fd_util.c +++ b/src/common/fd_util.c @@ -12,17 +12,19 @@ void increase_nofile_limit(void) { if (getrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) { - wlr_log_errno(WLR_ERROR, "Failed to bump max open files limit: getrlimit(NOFILE) failed"); + wlr_log_errno(WLR_ERROR, + "Failed to bump max open files limit: getrlimit(NOFILE) failed"); return; } struct rlimit new_rlimit = original_nofile_rlimit; new_rlimit.rlim_cur = new_rlimit.rlim_max; if (setrlimit(RLIMIT_NOFILE, &new_rlimit) != 0) { - wlr_log_errno(WLR_ERROR, "Failed to bump max open files limit: setrlimit(NOFILE) failed"); + wlr_log_errno(WLR_ERROR, + "Failed to bump max open files limit: setrlimit(NOFILE) failed"); wlr_log(WLR_INFO, "Running with %d max open files", - (int)original_nofile_rlimit.rlim_cur); + (int)original_nofile_rlimit.rlim_cur); } } diff --git a/src/common/graphic-helpers.c b/src/common/graphic-helpers.c index 65cd4d7b..a42502b3 100644 --- a/src/common/graphic-helpers.c +++ b/src/common/graphic-helpers.c @@ -42,7 +42,6 @@ multi_rect_set_size(struct multi_rect *rect, int width, int height) int line_width = rect->line_width; for (size_t i = 0; i < 3; i++) { - /* Reposition, top and left don't ever change */ wlr_scene_node_set_position(&rect->right[i]->node, width - (i + 1) * line_width, i * line_width); diff --git a/src/common/scaled_scene_buffer.c b/src/common/scaled_scene_buffer.c index 85638e6f..299c76ff 100644 --- a/src/common/scaled_scene_buffer.c +++ b/src/common/scaled_scene_buffer.c @@ -112,8 +112,8 @@ _handle_node_destroy(struct wl_listener *listener, void *data) static void _handle_output_enter(struct wl_listener *listener, void *data) { - struct scaled_scene_buffer *self - = wl_container_of(listener, self, output_enter); + struct scaled_scene_buffer *self = + wl_container_of(listener, self, output_enter); /* primary_output is the output most of the node area is in */ struct wlr_scene_output *primary = self->scene_buffer->primary_output; /* scene_output is the output we just entered */ @@ -132,8 +132,8 @@ _handle_output_enter(struct wl_listener *listener, void *data) static void _handle_output_leave(struct wl_listener *listener, void *data) { - struct scaled_scene_buffer *self - = wl_container_of(listener, self, output_leave); + struct scaled_scene_buffer *self = + wl_container_of(listener, self, output_leave); /* primary_output is the output most of the node area is in */ struct wlr_scene_output *primary = self->scene_buffer->primary_output; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index b844fb07..8cd93537 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -608,7 +608,6 @@ load_default_mouse_bindings(void) || strcmp(current->context, mouse_combos[i - 1].context) || strcmp(current->button, mouse_combos[i - 1].button) || strcmp(current->event, mouse_combos[i - 1].event)) { - /* Create new mousebind */ m = mousebind_create(current->context); m->button = mousebind_button_from_str(current->button, @@ -640,7 +639,6 @@ merge_mouse_bindings(void) if (existing->context == current->context && existing->button == current->button && existing->mouse_event == current->mouse_event) { - wl_list_remove(&existing->link); action_list_free(&existing->actions); free(existing); diff --git a/src/debug.c b/src/debug.c index 8c336ec4..815748d1 100644 --- a/src/debug.c +++ b/src/debug.c @@ -124,10 +124,10 @@ get_special(struct server *server, struct wlr_scene_node *node, struct wlr_scene_tree *grand_parent = node->parent ? node->parent->node.parent : NULL; if (grand_parent == server->view_tree) { - *last_view = node_view_from_node(node); + *last_view = node_view_from_node(node); } if (node->parent == server->view_tree_always_on_top) { - *last_view = node_view_from_node(node); + *last_view = node_view_from_node(node); } const char *view_part = get_view_part(*last_view, node); if (view_part) { diff --git a/src/desktop.c b/src/desktop.c index a867c1f0..d261e7f7 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -225,7 +225,7 @@ desktop_cycle_view(struct server *server, struct view *start_view, assert(node->parent); struct wl_list *list_head = &node->parent->children; struct wl_list *list_item = &node->link; - struct wl_list *(*iter)(struct wl_list *); + struct wl_list *(*iter)(struct wl_list *list); /* Scene nodes are ordered like last node == displayed topmost */ iter = dir == LAB_CYCLE_DIR_FORWARD ? get_prev_item : get_next_item; @@ -336,8 +336,12 @@ get_cursor_context(struct server *server) } return ret; case LAB_NODE_DESC_SSD_BUTTON: { - /* Always return the top scene node for SSD buttons */ - struct ssd_button *button = node_ssd_button_from_node(node); + /* + * Always return the top scene node for SSD + * buttons + */ + struct ssd_button *button = + node_ssd_button_from_node(node); ret.node = node; ret.type = button->type; ret.view = button->view; diff --git a/src/interactive.c b/src/interactive.c index de47d09d..99622fc1 100644 --- a/src/interactive.c +++ b/src/interactive.c @@ -24,7 +24,7 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges) * If you think there is a good reason to allow it * feel free to open an issue explaining your use-case. */ - return; + return; } if (mode == LAB_INPUT_STATE_RESIZE && (view->fullscreen || view->maximized)) { diff --git a/src/osd.c b/src/osd.c index 9b419f51..26b946cb 100644 --- a/src/osd.c +++ b/src/osd.c @@ -328,7 +328,8 @@ osd_update(struct server *server) PangoWeight weight = pango_font_description_get_weight(desc); pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD); pango_layout_set_font_description(layout, desc); - pango_layout_set_text(layout, server->workspace_current->name, -1); + pango_layout_set_text(layout, + server->workspace_current->name, -1); pango_cairo_show_layout(cairo, layout); pango_font_description_set_weight(desc, weight); pango_layout_set_font_description(layout, desc); diff --git a/src/output.c b/src/output.c index 542559e9..b1723daa 100644 --- a/src/output.c +++ b/src/output.c @@ -278,7 +278,8 @@ output_config_apply(struct server *server, /* Only do Layout specific actions if the commit went trough */ if (need_to_add) { wlr_output_layout_add_auto(server->output_layout, o); - output->scene_output = wlr_scene_get_scene_output(server->scene, o); + output->scene_output = + wlr_scene_get_scene_output(server->scene, o); assert(output->scene_output); } @@ -291,7 +292,6 @@ output_config_apply(struct server *server, wlr_output_layout_remove(server->output_layout, o); output->scene_output = NULL; } - } server->pending_output_layout_change--; diff --git a/src/server.c b/src/server.c index c2532a5b..008d3297 100644 --- a/src/server.c +++ b/src/server.c @@ -158,7 +158,7 @@ handle_drm_lease_request(struct wl_listener *listener, void *data) return; } - for(size_t i = 0; i < req->n_connectors; ++i) { + for (size_t i = 0; i < req->n_connectors; ++i) { struct output *output = req->connectors[i]->output->data; if (!output) { continue; @@ -167,7 +167,8 @@ handle_drm_lease_request(struct wl_listener *listener, void *data) wlr_output_enable(output->wlr_output, false); wlr_output_commit(output->wlr_output); - wlr_output_layout_remove(output->server->output_layout, output->wlr_output); + wlr_output_layout_remove(output->server->output_layout, + output->wlr_output); output->scene_output = NULL; output->leased = true; @@ -470,7 +471,6 @@ server_start(struct server *server) void server_finish(struct server *server) { - #if HAVE_XWAYLAND wlr_xwayland_destroy(server->xwayland); #endif diff --git a/src/view.c b/src/view.c index 615b91d7..d6c92de9 100644 --- a/src/view.c +++ b/src/view.c @@ -304,6 +304,7 @@ set_fallback_geometry(struct view *view) &view->natural_geometry.x, &view->natural_geometry.y); } + #undef LAB_FALLBACK_WIDTH #undef LAB_FALLBACK_HEIGHT diff --git a/src/workspaces.c b/src/workspaces.c index 87ccc428..71dfabf7 100644 --- a/src/workspaces.c +++ b/src/workspaces.c @@ -49,7 +49,6 @@ parse_workspace_index(const char *name) static void _osd_update(struct server *server) { - struct theme *theme = server->theme; /* Settings */ @@ -138,7 +137,7 @@ _osd_update(struct server *server) + (output->usable_area.width - width) / 2 + output_box.x; int ly = output->usable_area.y - + (output->usable_area.height - height ) / 2 + + (output->usable_area.height - height) / 2 + output_box.y; wlr_scene_node_set_position(&output->workspace_osd->node, lx, ly); wlr_scene_buffer_set_buffer(output->workspace_osd, &buffer->base); @@ -281,7 +280,6 @@ workspaces_send_to(struct view *view, struct workspace *target) view->workspace = target; } - void workspaces_osd_hide(struct seat *seat) { -- 2.52.0