Fix coding style

This commit is contained in:
Johan Malm 2022-11-03 19:58:21 +00:00 committed by Consolatis
parent 6a242d5739
commit e45e2c7e60
16 changed files with 28 additions and 22 deletions

View 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");
}
}

View 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);

View 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;

View file

@ -15,10 +15,10 @@
#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",

View 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;
}

View 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;
}

View 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;

View 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);

View 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;
}

View 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;
}

View file

@ -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;

View 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);

View 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);
}