clang-format

This commit is contained in:
buffet 2019-02-19 11:50:46 +01:00
parent 11740072a5
commit d4df311d24
5 changed files with 60 additions and 10 deletions

45
.clang-format Normal file
View file

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

View file

@ -21,6 +21,7 @@ struct kiwmi_output {
struct wl_listener destroy; 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 */ #endif /* KIWMI_OUTPUT_H */

View file

@ -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); wlr_log(WLR_DEBUG, "New output %p: %s", wlr_output, wlr_output->name);
if (!wl_list_empty(&wlr_output->modes)) { 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); wlr_output_set_mode(wlr_output, mode);
} }

View file

@ -10,8 +10,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <wayland-server.h> #include <wayland-server.h>
#include <wlr/types/wlr_output.h>
#include <wlr/render/wlr_renderer.h> #include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_output.h>
#include "kiwmi/server.h" #include "kiwmi/server.h"
@ -43,7 +43,8 @@ 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_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_output_make_current(wlr_output, NULL);
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);

View file

@ -36,7 +36,8 @@ server_init(struct kiwmi_server *server)
wlr_renderer_init_wl_display(renderer, server->wl_display); wlr_renderer_init_wl_display(renderer, server->wl_display);
server->compositor = wlr_compositor_create(server->wl_display, renderer); 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(); server->output_layout = wlr_output_layout_create();
@ -51,7 +52,8 @@ server_init(struct kiwmi_server *server)
bool bool
server_run(struct kiwmi_server *server) 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); server->socket = wl_display_add_socket_auto(server->wl_display);
if (!server->socket) { if (!server->socket) {