From cc4780eb71fcc3f13b3380806734b55cbc8bd588 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Sep 2021 10:25:34 +0200 Subject: [PATCH] Apply clang-format --- cagebreak.c | 12 ++++++------ keybinding.c | 2 +- message.c | 4 ++-- server.c | 24 +++++++++++++----------- util.c | 6 ++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 8b9184a..f1ae6a7 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -61,7 +61,7 @@ #define WAIT_ANY -1 #endif -bool show_info=false; +bool show_info = false; void set_sig_handler(int sig, void (*action)(int)) { @@ -137,7 +137,7 @@ usage(FILE *file, const char *const cage) { #endif " -h\t Display this help message\n" " -v\t Show the version number and exit\n" - " -s\t Show information about the current setup and exit\n", + " -s\t Show information about the current setup and exit\n", cage); } @@ -168,7 +168,7 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { fprintf(stdout, "Cagebreak version " CG_VERSION "\n"); exit(0); case 's': - show_info=true; + show_info = true; break; default: usage(stderr, argv[0]); @@ -535,12 +535,12 @@ main(int argc, char *argv[]) { #endif if(show_info) { - char *msg=server_show_info(&server); + char *msg = server_show_info(&server); if(msg != NULL) { - fprintf(stderr,"%s",msg); + fprintf(stderr, "%s", msg); free(msg); } else { - wlr_log(WLR_ERROR,"Failed to get info on cagebreak setup\n"); + wlr_log(WLR_ERROR, "Failed to get info on cagebreak setup\n"); } exit(0); } diff --git a/keybinding.c b/keybinding.c index 26b2ae2..0686d90 100644 --- a/keybinding.c +++ b/keybinding.c @@ -703,7 +703,7 @@ keybinding_show_time(struct cg_server *server) { void keybinding_show_info(struct cg_server *server) { - char *msg=server_show_info(server); + char *msg = server_show_info(server); if(!msg) { return; diff --git a/message.c b/message.c index e544813..f05b175 100644 --- a/message.c +++ b/message.c @@ -8,11 +8,11 @@ #include #include -#include "util.h" #include "message.h" #include "output.h" #include "pango.h" #include "server.h" +#include "util.h" cairo_subpixel_order_t to_cairo_subpixel_order(const enum wl_output_subpixel subpixel) { @@ -153,7 +153,7 @@ void message_printf(struct cg_output *output, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - char *buffer = malloc_vsprintf_va_list(fmt,ap); + char *buffer = malloc_vsprintf_va_list(fmt, ap); va_end(ap); if(buffer == NULL) { wlr_log(WLR_ERROR, "Failed to allocate buffer in message_printf"); diff --git a/server.c b/server.c index b69f6dd..e0ccb82 100644 --- a/server.c +++ b/server.c @@ -9,16 +9,15 @@ #define _POSIX_C_SOURCE 200809L - -#include #include +#include #include #include #include -#include "server.h" #include "input_manager.h" #include "output.h" +#include "server.h" #include "util.h" void @@ -44,29 +43,32 @@ get_mode_index_from_name(char *const *modes, const char *mode_name) { char * server_show_info(struct cg_server *server) { - char *output_str=strdup(""), *output_str_tmp; + char *output_str = strdup(""), *output_str_tmp; struct cg_output *output; wl_list_for_each(output, &server->outputs, link) { if(!output_str) { return NULL; } - output_str_tmp=output_str; - output_str=malloc_vsprintf("%s\t * %s\n",output_str, output->wlr_output->name); + output_str_tmp = output_str; + output_str = malloc_vsprintf("%s\t * %s\n", output_str, + output->wlr_output->name); free(output_str_tmp); } - char *input_str=strdup(""), *input_str_tmp; + char *input_str = strdup(""), *input_str_tmp; struct cg_input_device *input; wl_list_for_each(input, &server->input->devices, link) { if(!input_str) { return NULL; } - input_str_tmp=input_str; - if(strcmp(input->identifier,"") != 0) { - input_str=malloc_vsprintf("%s\t * H:%s\n",input_str, input->identifier); + input_str_tmp = input_str; + if(strcmp(input->identifier, "") != 0) { + input_str = + malloc_vsprintf("%s\t * H:%s\n", input_str, input->identifier); } free(input_str_tmp); } - char *ret=malloc_vsprintf("Outputs:\n%sInputs:\n%s",output_str,input_str); + char *ret = + malloc_vsprintf("Outputs:\n%sInputs:\n%s", output_str, input_str); free(output_str); free(input_str); return ret; diff --git a/util.c b/util.c index b74a589..83b7e66 100644 --- a/util.c +++ b/util.c @@ -49,9 +49,7 @@ malloc_vsprintf_va_list(const char *fmt, va_list ap) { char * malloc_vsprintf(const char *fmt, ...) { va_list args; - va_start(args,fmt); - char *ret=malloc_vsprintf_va_list(fmt,args); + va_start(args, fmt); + char *ret = malloc_vsprintf_va_list(fmt, args); return ret; } - -