Apply clang-format

This commit is contained in:
project-repo 2020-03-21 14:31:06 +01:00
commit 9363a59b95
6 changed files with 38 additions and 26 deletions

View file

@ -10,11 +10,11 @@
#include "config.h"
#include <fcntl.h>
#include <fontconfig/fontconfig.h>
#include <getopt.h>
#include <pango.h>
#include <pango/pangocairo.h>
#include <fcntl.h>
#include <getopt.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -1,10 +1,10 @@
/* This file is used by the fuzzer in order to prevent executing shell commands.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include "../output.h"
#include <cairo.h>
#include <cairo/cairo.h>
#include <stdlib.h>
#include <wlr/render/wlr_renderer.h>
int
@ -12,18 +12,18 @@ fork() {
return 1;
}
void wlr_texture_get_size(struct wlr_texture *texture, int *width,
int *height) {
void
wlr_texture_get_size(struct wlr_texture *texture, int *width, int *height) {
if(width != NULL) {
*width=0;
*width = 0;
}
if(height != NULL) {
*height=0;
*height = 0;
}
}
cairo_surface_t*
cairo_surface_t *
cairo_image_surface_create(cairo_format_t fmt, int width, int height) {
return NULL;
}

View file

@ -51,11 +51,11 @@
#include "keybinding.h"
#include "message.h"
#include "output.h"
#include "workspace.h"
#include "parse.h"
#include "seat.h"
#include "server.h"
#include "view.h"
#include "workspace.h"
#include "xdg_shell.h"
#if CG_HAS_XWAYLAND
#include "xwayland.h"
@ -423,7 +423,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
(union keybinding_params){.c = NULL});
wl_display_flush_clients(server.wl_display);
wl_display_destroy_clients(server.wl_display);
struct cg_output* output;
struct cg_output *output;
wl_list_for_each(output, &server.outputs, link) {
message_clear(output);
struct cg_view *view;

View file

@ -649,7 +649,7 @@ int
keybinding_switch_ws(struct cg_server *server, uint32_t ws) {
if(ws >= server->nws) {
wlr_log(WLR_ERROR,
"Requested workspace %u, but only have %u workspaces.", ws+1,
"Requested workspace %u, but only have %u workspaces.", ws + 1,
server->nws);
return -1;
}
@ -716,15 +716,19 @@ keybinding_set_nws(struct cg_server *server, int nws) {
wl_list_for_each(output, &server->outputs, link) {
for(unsigned int i = nws; i < server->nws; ++i) {
struct cg_view *view, *tmp;
wl_list_for_each_safe(view,tmp, &output->workspaces[i]->views,link) {
wl_list_for_each_safe(view, tmp, &output->workspaces[i]->views,
link) {
wl_list_remove(&view->link);
wl_list_insert(&output->workspaces[nws-1]->views,&view->link);
view->workspace = output->workspaces[nws-1];
wl_list_insert(&output->workspaces[nws - 1]->views,
&view->link);
view->workspace = output->workspaces[nws - 1];
}
wl_list_for_each_safe(view,tmp,&output->workspaces[i]->unmanaged_views,link) {
wl_list_for_each_safe(
view, tmp, &output->workspaces[i]->unmanaged_views, link) {
wl_list_remove(&view->link);
wl_list_insert(&output->workspaces[nws-1]->unmanaged_views,&view->link);
view->workspace = output->workspaces[nws-1];
wl_list_insert(&output->workspaces[nws - 1]->unmanaged_views,
&view->link);
view->workspace = output->workspaces[nws - 1];
}
workspace_free(output->workspaces[i]);
}
@ -746,7 +750,10 @@ keybinding_set_nws(struct cg_server *server, int nws) {
}
}
server->nws = nws;
seat_set_focus(server->seat,server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view);
seat_set_focus(
server->seat,
server->curr_output->workspaces[server->curr_output->curr_workspace]
->focused_tile->view);
}
void

View file

@ -44,10 +44,10 @@ enum keybinding_action {
KEYBINDING_FOCUS_TOP,
KEYBINDING_FOCUS_BOTTOM,
KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition
KEYBINDING_BACKGROUND, //data.color is the background color
KEYBINDING_DEFINEMODE, //data.c is the mode name
KEYBINDING_WORKSPACES, //data.i is the number of workspaces
KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition
KEYBINDING_BACKGROUND, // data.color is the background color
KEYBINDING_DEFINEMODE, // data.c is the mode name
KEYBINDING_WORKSPACES, // data.i is the number of workspaces
};
union keybinding_params {
@ -56,7 +56,7 @@ union keybinding_params {
int32_t i;
bool b;
float color[3];
struct keybinding* kb;
struct keybinding *kb;
};
struct keybinding {

11
parse.c
View file

@ -262,7 +262,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding,
long ws = strtol(nws_str, NULL, 10);
if(ws < 1) {
wlr_log(WLR_ERROR, "Workspace number must be a integer number larger or equal to 1. Got %ld", ws);
wlr_log(WLR_ERROR,
"Workspace number must be a integer number larger or equal "
"to 1. Got %ld",
ws);
return -1;
}
keybinding->data.u = ws - 1;
@ -277,8 +280,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding,
long ws = strtol(nws_str, NULL, 10);
if(ws < 1) {
wlr_log(
WLR_ERROR, "Workspace number must be an integer larger or equal to 1. Got %ld", ws);
wlr_log(WLR_ERROR,
"Workspace number must be an integer larger or equal to 1. "
"Got %ld",
ws);
return -1;
}
keybinding->data.u = ws - 1;