From 42ef57a3e7458ecdf325c41f8f1347982f9a14ce Mon Sep 17 00:00:00 2001 From: buffet Date: Tue, 19 Feb 2019 11:50:46 +0100 Subject: [PATCH] clang-format --- .clang-format | 45 ++++++++++++++++++++++++++++++++++++++++++ include/kiwmi/output.h | 5 +++-- kiwmi/desktop/output.c | 3 ++- kiwmi/output.c | 9 +++++---- kiwmi/server.c | 8 +++++--- 5 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..6e940d3 --- /dev/null +++ b/.clang-format @@ -0,0 +1,45 @@ +--- +Language: Cpp +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: false +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: AllDefinitions +AlwaysBreakBeforeMultilineStrings: true +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Linux +BreakBeforeTernaryOperators: true +BreakStringLiterals: true +ColumnLimit: 80 +ContinuationIndentWidth: 4 +IncludeBlocks: Preserve +IndentCaseLabels: false +IndentPPDirectives: AfterHash +IndentWidth: 4 +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 1 +PointerAlignment: Right +ReflowComments: false +SortIncludes: true +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +UseTab: Never +... diff --git a/include/kiwmi/output.h b/include/kiwmi/output.h index fce4aff..8b5da6b 100644 --- a/include/kiwmi/output.h +++ b/include/kiwmi/output.h @@ -3,7 +3,7 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. - */ + */ #ifndef KIWMI_OUTPUT_H #define KIWMI_OUTPUT_H @@ -21,6 +21,7 @@ struct kiwmi_output { struct wl_listener destroy; }; -struct kiwmi_output *output_create(struct wlr_output *wlr_output, struct kiwmi_server *server); +struct kiwmi_output * +output_create(struct wlr_output *wlr_output, struct kiwmi_server *server); #endif /* KIWMI_OUTPUT_H */ diff --git a/kiwmi/desktop/output.c b/kiwmi/desktop/output.c index 72c29ad..4433e03 100644 --- a/kiwmi/desktop/output.c +++ b/kiwmi/desktop/output.c @@ -23,7 +23,8 @@ new_output_notify(struct wl_listener *listener, void *data) wlr_log(WLR_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); if (!wl_list_empty(&wlr_output->modes)) { - struct wlr_output_mode *mode = wl_container_of(wlr_output->modes.prev, mode, link); + struct wlr_output_mode *mode = + wl_container_of(wlr_output->modes.prev, mode, link); wlr_output_set_mode(wlr_output, mode); } diff --git a/kiwmi/output.c b/kiwmi/output.c index a9680a7..bc9b5a7 100644 --- a/kiwmi/output.c +++ b/kiwmi/output.c @@ -10,8 +10,8 @@ #include #include -#include #include +#include #include "kiwmi/server.h" @@ -27,7 +27,7 @@ output_create(struct wlr_output *wlr_output, struct kiwmi_server *server) } output->wlr_output = wlr_output; - output->server = server; + output->server = server; output->frame.notify = output_frame_notify; wl_signal_add(&wlr_output->events.frame, &output->frame); @@ -41,9 +41,10 @@ output_create(struct wlr_output *wlr_output, struct kiwmi_server *server) static void output_frame_notify(struct wl_listener *listener, void *data) { - struct kiwmi_output *output = wl_container_of(listener, output, frame); + struct kiwmi_output *output = wl_container_of(listener, output, frame); struct wlr_output *wlr_output = data; - struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); + struct wlr_renderer *renderer = + wlr_backend_get_renderer(wlr_output->backend); wlr_output_make_current(wlr_output, NULL); wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); diff --git a/kiwmi/server.c b/kiwmi/server.c index e3abe5a..1f9dd77 100644 --- a/kiwmi/server.c +++ b/kiwmi/server.c @@ -25,7 +25,7 @@ server_init(struct kiwmi_server *server) wlr_log(WLR_DEBUG, "Initializing Wayland server"); server->wl_display = wl_display_create(); - server->backend = wlr_backend_autocreate(server->wl_display, NULL); + server->backend = wlr_backend_autocreate(server->wl_display, NULL); if (!server->backend) { wlr_log(WLR_ERROR, "Failed to create backend"); wl_display_destroy(server->wl_display); @@ -36,7 +36,8 @@ server_init(struct kiwmi_server *server) wlr_renderer_init_wl_display(renderer, server->wl_display); server->compositor = wlr_compositor_create(server->wl_display, renderer); - server->data_device_manager = wlr_data_device_manager_create(server->wl_display); + server->data_device_manager = + wlr_data_device_manager_create(server->wl_display); server->output_layout = wlr_output_layout_create(); @@ -51,7 +52,8 @@ server_init(struct kiwmi_server *server) bool server_run(struct kiwmi_server *server) { - wlr_log(WLR_DEBUG, "Running Wayland server on display '%s'", server->socket); + wlr_log( + WLR_DEBUG, "Running Wayland server on display '%s'", server->socket); server->socket = wl_display_add_socket_auto(server->wl_display); if (!server->socket) {