From dcc743047b903af8ba409ed25745f891234dc323 Mon Sep 17 00:00:00 2001 From: Johannes Schramm Date: Sun, 21 Jan 2018 16:28:21 +0100 Subject: style: include brackets for if/while/for, even if it's a single statement --- backend/session/logind.c | 4 +++- backend/session/session.c | 3 ++- backend/wayland/backend.c | 24 ++++++++++++++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'backend') diff --git a/backend/session/logind.c b/backend/session/logind.c index 0b5b2a63..aa38b46c 100644 --- a/backend/session/logind.c +++ b/backend/session/logind.c @@ -330,7 +330,9 @@ static bool add_signal_matches(struct logind_session *session) { static int dbus_event(int fd, uint32_t mask, void *data) { sd_bus *bus = data; - while (sd_bus_process(bus, NULL) > 0); + while (sd_bus_process(bus, NULL) > 0) { + ; + } return 1; } diff --git a/backend/session/session.c b/backend/session/session.c index a5f17b8d..2bbbd4ef 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -307,8 +307,9 @@ size_t wlr_session_find_gpus(struct wlr_session *session, } const char *seat = udev_device_get_property_value(dev, "ID_SEAT"); - if (!seat) + if (!seat) { seat = "seat0"; + } if (session->seat[0] && strcmp(session->seat, seat) != 0) { udev_device_unref(dev); continue; diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c index 32fdc2b6..f85498eb 100644 --- a/backend/wayland/backend.c +++ b/backend/wayland/backend.c @@ -85,12 +85,24 @@ static void wlr_wl_backend_destroy(struct wlr_backend *_backend) { wl_event_source_remove(backend->remote_display_src); wlr_egl_finish(&backend->egl); - if (backend->seat) wl_seat_destroy(backend->seat); - if (backend->shm) wl_shm_destroy(backend->shm); - if (backend->shell) zxdg_shell_v6_destroy(backend->shell); - if (backend->compositor) wl_compositor_destroy(backend->compositor); - if (backend->registry) wl_registry_destroy(backend->registry); - if (backend->remote_display) wl_display_disconnect(backend->remote_display); + if (backend->seat) { + wl_seat_destroy(backend->seat); + } + if (backend->shm) { + wl_shm_destroy(backend->shm); + } + if (backend->shell) { + zxdg_shell_v6_destroy(backend->shell); + } + if (backend->compositor) { + wl_compositor_destroy(backend->compositor); + } + if (backend->registry) { + wl_registry_destroy(backend->registry); + } + if (backend->remote_display) { + wl_display_disconnect(backend->remote_display); + } free(backend); } -- cgit v1.2.3 From e37ebf6869b653c91c27af706404d60b78ad0168 Mon Sep 17 00:00:00 2001 From: Johannes Schramm Date: Sun, 21 Jan 2018 17:00:15 +0100 Subject: style: add comment to empty while loop in logind.c --- backend/session/logind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend') diff --git a/backend/session/logind.c b/backend/session/logind.c index aa38b46c..1ece051f 100644 --- a/backend/session/logind.c +++ b/backend/session/logind.c @@ -331,7 +331,7 @@ static bool add_signal_matches(struct logind_session *session) { static int dbus_event(int fd, uint32_t mask, void *data) { sd_bus *bus = data; while (sd_bus_process(bus, NULL) > 0) { - ; + // Do nothing. } return 1; } -- cgit v1.2.3