From 301a5f77b610724ce288ae249ee72fe9a0aa817f Mon Sep 17 00:00:00 2001 From: kolunmi Date: Tue, 7 Feb 2023 15:21:07 -0700 Subject: minor cleanup and update readme --- dwlb.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'dwlb.c') diff --git a/dwlb.c b/dwlb.c index 61959fb..944824e 100644 --- a/dwlb.c +++ b/dwlb.c @@ -193,19 +193,17 @@ handle_cmd(char *cmd, pixman_color_t *fg, pixman_color_t *bg, if (!strcmp(cmd, "bg")) { if (bg && def_bg) { - if (!*arg) { + if (!*arg) *bg = *def_bg; - } else if (parse_color(arg, bg)) { + else if (parse_color(arg, bg)) fprintf(stderr, "Bad color string \"%s\"\n", arg); - } } } else if (!strcmp(cmd, "fg")) { if (fg && def_fg) { - if (!*arg) { + if (!*arg) *fg = *def_fg; - } else if (parse_color(arg, fg)) { + else if (parse_color(arg, fg)) fprintf(stderr, "Bad color string \"%s\"\n", arg); - } } } else { fprintf(stderr, "Unrecognized command \"%s\"\n", cmd); @@ -475,7 +473,7 @@ cleanup(void) unlink(socketpath); } -static struct zwlr_layer_surface_v1_listener layer_surface_listener = { +static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { .configure = layer_surface_configure, .closed = layer_surface_closed, }; @@ -515,7 +513,7 @@ output_description(void *data, struct zxdg_output_v1 *xdg_output, { } -static struct zxdg_output_v1_listener output_listener = { +static const struct zxdg_output_v1_listener output_listener = { .name = output_name, .description = output_description, .done = output_done, @@ -606,7 +604,6 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) teardown_bar(b); } - static const struct wl_registry_listener registry_listener = { .global = handle_global, .global_remove = handle_global_remove @@ -937,7 +934,6 @@ main(int argc, char **argv) signal(SIGINT, sig_handler); signal(SIGHUP, sig_handler); signal(SIGTERM, sig_handler); - signal(SIGPIPE, SIG_IGN); /* Run */ ready = true; -- cgit v1.2.3