]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Fix coding style
authorJohan Malm <jgm323@gmail.com>
Thu, 3 Nov 2022 19:58:21 +0000 (19:58 +0000)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Thu, 3 Nov 2022 22:01:52 +0000 (23:01 +0100)
16 files changed:
include/action.h
include/common/mem.h
include/workspaces.h
src/common/fd_util.c
src/common/graphic-helpers.c
src/common/scaled_font_buffer.c
src/cursor.c
src/desktop.c
src/keyboard.c
src/layers.c
src/menu/menu.c
src/output.c
src/server.c
src/xdg.c
src/xwayland-unmanaged.c
src/xwayland.c

index e55060331aae28dde0b4d72dd5fa52658b46f2ed..126e5b541c1fbe92e58a3345fd2cac1a27b45543 100644 (file)
@@ -7,9 +7,11 @@ struct server;
 struct wl_list;
 
 struct action {
-       struct wl_list link;  /* struct keybinding.actions,
-                              * struct mousebinding.actions,
-                              * struct menuitem.actions */
+       struct wl_list link; /*
+                             * struct keybinding.actions
+                             * struct mousebinding.actions
+                             * struct menuitem.actions
+                             */
 
        uint32_t type;        /* enum action_type */
        struct wl_list args;  /* struct action_arg.link */
index a38f7fdec3e8dead901e18b51a82bf21b843b936..fa9607d63cb4138fa2fbec40cf32e1f329a898c3 100644 (file)
@@ -49,7 +49,7 @@ char *xstrdup(const char *str);
  * Does nothing if <ptr> is already NULL.
  */
 #define zfree(ptr) do { \
-        free(ptr); (ptr) = NULL; \
+       free(ptr); (ptr) = NULL; \
 } while (0)
 
 #endif /* __LABWC_MEM_H */
index 8f77339be0b8784e80d86652d0ffd1acb72a7ef8..53dc4da31e2a23a6add0bdd3c569894ce0bb3223 100644 (file)
@@ -9,8 +9,10 @@ struct wl_list;
 
 /* Double use: as config in config/rcxml.c and as instance in workspaces.c */
 struct workspace {
-       struct wl_list link; /* struct server.workspaces
-                               struct rcxml.workspace_config.workspaces */
+       struct wl_list link; /*
+                             * struct server.workspaces
+                             * struct rcxml.workspace_config.workspaces
+                             */
        struct server *server;
 
        char *name;
index e935f02ca2fc37ae8c72439a6940ef57e97cfb0f..d4f92561baeca9480a16af7b3c64d0af5ff0b31f 100644 (file)
@@ -36,6 +36,7 @@ restore_nofile_limit(void)
        }
 
        if (setrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) {
-               wlr_log_errno(WLR_ERROR, "Failed to restore max open files limit: setrlimit(NOFILE) failed");
+               wlr_log_errno(WLR_ERROR,
+                       "Failed to restore max open files limit: setrlimit(NOFILE) failed");
        }
 }
index a42502b34895b76f962e8bc8ab851d6436fcad55..add14a91565897e25f2f549d8ce98c9b31de25cb 100644 (file)
@@ -68,7 +68,8 @@ draw_cairo_border(cairo_t *cairo, double width, double height, double line_width
 
        double x, y, w, h;
        /* The anchor point of a line is in the center */
-       x = y = line_width / 2;
+       x = line_width / 2;
+       y = x;
        w = width - line_width;
        h = height - line_width;
        cairo_set_line_width(cairo, line_width);
index 61c98ff267344182ae97b25f9db1d694b0d551ac..ec4c61610f73d26b8b874ed5c4977f0ca6b04362 100644 (file)
@@ -47,8 +47,8 @@ scaled_font_buffer_create(struct wlr_scene_tree *parent)
 {
        assert(parent);
        struct scaled_font_buffer *self = znew(*self);
-       struct scaled_scene_buffer *scaled_buffer
-               scaled_scene_buffer_create(parent, &impl);
+       struct scaled_scene_buffer *scaled_buffer =
+               scaled_scene_buffer_create(parent, &impl);
        if (!scaled_buffer) {
                free(self);
                return NULL;
index 57952cb30fcf92a5e7859b7730d373e31dd12981..db3940465c44900a4b043f7a55950eacb8d82190 100644 (file)
 #include "resistance.h"
 #include "ssd.h"
 
-static const char **cursor_names = NULL;
+static const char * const *cursor_names = NULL;
 
 /* Usual cursor names */
-static const char *cursors_xdg[] = {
+static const char * const cursors_xdg[] = {
        NULL,
        "default",
        "grab",
@@ -33,7 +33,7 @@ static const char *cursors_xdg[] = {
 };
 
 /* XCursor fallbacks */
-static const char *cursors_x11[] = {
+static const char * const cursors_x11[] = {
        NULL,
        "left_ptr",
        "grabbing",
index aaa719d168f6cc307dfe7eaa160247b4f098b75c..52054fbdc0341b5464c5a9bb4bd77b4283faca4d 100644 (file)
@@ -273,7 +273,7 @@ desktop_focused_view(struct server *server)
                return NULL;
        }
        struct view *view;
-       wl_list_for_each (view, &server->views, link) {
+       wl_list_for_each(view, &server->views, link) {
                if (view->surface == focused_surface) {
                        return view;
                }
index 63bc7016b8d4e22641886b09f73c846aefc20839..373bf2b548e0e15188b5b04486ac35be54bbc131 100644 (file)
@@ -77,7 +77,7 @@ static bool
 handle_keybinding(struct server *server, uint32_t modifiers, xkb_keysym_t sym)
 {
        struct keybind *keybind;
-       wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
+       wl_list_for_each_reverse(keybind, &rc.keybinds, link) {
                if (modifiers ^ keybind->modifiers) {
                        continue;
                }
index b1145c90eb6577927e3f09865ce40cd3e7de091b..7bd12f13cb9de8c322bcdaf77e60be34820c7ada 100644 (file)
@@ -80,7 +80,7 @@ layers_arrange(struct output *output)
                / sizeof(layers_above_shell[0]);
        struct lab_layer_surface *layer, *topmost = NULL;
        for (size_t i = 0; i < nlayers; ++i) {
-               wl_list_for_each_reverse (layer,
+               wl_list_for_each_reverse(layer,
                                &output->layers[layers_above_shell[i]], link) {
                        struct wlr_layer_surface_v1 *layer_surface =
                                layer->scene_layer_surface->layer_surface;
index 0721a5527125734a95ee337304b14e84fcdab93e..d0ad02c6956b1a47b44c6c9b1ee8bcf3dc69e0f8 100644 (file)
@@ -684,7 +684,7 @@ static void
 close_all_submenus(struct menu *menu)
 {
        struct menuitem *item;
-       wl_list_for_each (item, &menu->menuitems, link) {
+       wl_list_for_each(item, &menu->menuitems, link) {
                if (item->submenu) {
                        wlr_scene_node_set_enabled(
                                &item->submenu->scene_tree->node, false);
index b1723daaef9821bf3d02e474507f131b6f8d4201..d61518b08791ee7cf8d8e1ed9371ba3e02f88b04 100644 (file)
@@ -417,7 +417,7 @@ struct output *
 output_from_wlr_output(struct server *server, struct wlr_output *wlr_output)
 {
        struct output *output;
-       wl_list_for_each (output, &server->outputs, link) {
+       wl_list_for_each(output, &server->outputs, link) {
                if (output->wlr_output == wlr_output) {
                        return output;
                }
index db54286580b4460565b10da4fb5b4b3c1807d800..7195d7d5e59ec24de703d5bbfa8d0ba7e5fa4300 100644 (file)
@@ -38,7 +38,7 @@ reload_config_and_theme(void)
        theme_init(g_server->theme, rc.theme_name);
 
        struct view *view;
-       wl_list_for_each (view, &g_server->views, link) {
+       wl_list_for_each(view, &g_server->views, link) {
                if (!view->mapped || !view->ssd.enabled) {
                        continue;
                }
index a055ca9b9200823624f7b1f8d4f0d55d33cf8194..487a7b6942cfc99c5d7fa72db2add6e349c9def2 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -240,7 +240,7 @@ static struct view *
 parent_of(struct view *view)
 {
        struct view *p;
-       wl_list_for_each (p, &view->server->views, link) {
+       wl_list_for_each(p, &view->server->views, link) {
                if (p->xdg_surface->toplevel
                                == view->xdg_surface->toplevel->parent) {
                        return p;
index 5979ba20ebda65b8964b782307a5460da82468e8..5a6fb12a57b9fd74124b8bcc0e563ded9d948010 100644 (file)
@@ -73,7 +73,7 @@ focus_next_surface(struct server *server, struct wlr_xwayland_surface *xsurface)
        /* Try to focus on last created unmanaged xwayland surface */
        struct xwayland_unmanaged *u;
        struct wl_list *list = &server->unmanaged_surfaces;
-       wl_list_for_each_reverse (u, list, link) {
+       wl_list_for_each_reverse(u, list, link) {
                struct wlr_xwayland_surface *prev = u->xwayland_surface;
                if (wlr_xwayland_or_surface_wants_focus(prev)) {
                        seat_focus_surface(&server->seat, prev->surface);
index baa264776e03ab58956662eee6c073c70c6382f7..4dc33444438f4bfeee001da26616598e474b67a9 100644 (file)
@@ -442,7 +442,7 @@ set_activated(struct view *view, bool activated)
                /* Restack unmanaged surfaces on top */
                struct xwayland_unmanaged *u;
                struct wl_list *list = &view->server->unmanaged_surfaces;
-               wl_list_for_each (u, list, link) {
+               wl_list_for_each(u, list, link) {
                        wlr_xwayland_surface_restack(u->xwayland_surface, NULL,
                                                     XCB_STACK_MODE_ABOVE);
                }