clang-format-3.5 **/*.h **/*.c

This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
This commit is contained in:
Michael Stapelberg
2014-06-19 11:20:32 +02:00
parent 4211274fcd
commit 4c06e7a573
64 changed files with 1317 additions and 1252 deletions

View File

@ -44,8 +44,8 @@ static void _workspace_apply_default_orientation(Con *ws) {
Con *workspace_get(const char *num, bool *created) {
Con *output, *workspace = NULL;
TAILQ_FOREACH (output, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, num));
TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, num));
if (workspace == NULL) {
LOG("Creating new workspace \"%s\"\n", num);
@ -59,7 +59,7 @@ Con *workspace_get(const char *num, bool *created) {
* -1. */
long parsed_num = ws_name_to_number(num);
TAILQ_FOREACH (assignment, &ws_assignments, ws_assignments) {
TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) {
if (strcmp(assignment->name, num) == 0) {
DLOG("Found workspace name assignment to output \"%s\"\n", assignment->output);
GREP_FIRST(output, croot, !strcmp(child->name, assignment->output));
@ -117,7 +117,7 @@ Con *create_workspace_on_output(Output *output, Con *content) {
/* try the configured workspace bindings first to find a free name */
Binding *bind;
TAILQ_FOREACH (bind, bindings, bindings) {
TAILQ_FOREACH(bind, bindings, bindings) {
DLOG("binding with command %s\n", bind->command);
if (strlen(bind->command) < strlen("workspace ") ||
strncasecmp(bind->command, "workspace", strlen("workspace")) != 0)
@ -156,7 +156,7 @@ Con *create_workspace_on_output(Output *output, Con *content) {
* find a new workspace, etc… */
bool assigned = false;
struct Workspace_Assignment *assignment;
TAILQ_FOREACH (assignment, &ws_assignments, ws_assignments) {
TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) {
if (strcmp(assignment->name, ws->name) != 0 ||
strcmp(assignment->output, output->name) == 0)
continue;
@ -169,8 +169,8 @@ Con *create_workspace_on_output(Output *output, Con *content) {
continue;
current = NULL;
TAILQ_FOREACH (out, &(croot->nodes_head), nodes)
GREP_FIRST(current, output_get_content(out), !strcasecmp(child->name, ws->name));
TAILQ_FOREACH(out, &(croot->nodes_head), nodes)
GREP_FIRST(current, output_get_content(out), !strcasecmp(child->name, ws->name));
exists = (current != NULL);
if (!exists) {
@ -201,8 +201,8 @@ Con *create_workspace_on_output(Output *output, Con *content) {
ws->num = c;
current = NULL;
TAILQ_FOREACH (out, &(croot->nodes_head), nodes)
GREP_FIRST(current, output_get_content(out), child->num == ws->num);
TAILQ_FOREACH(out, &(croot->nodes_head), nodes)
GREP_FIRST(current, output_get_content(out), child->num == ws->num);
exists = (current != NULL);
DLOG("result for ws %d: exists = %d\n", c, exists);
@ -245,7 +245,7 @@ bool workspace_is_visible(Con *ws) {
Con *_get_sticky(Con *con, const char *sticky_group, Con *exclude) {
Con *current;
TAILQ_FOREACH (current, &(con->nodes_head), nodes) {
TAILQ_FOREACH(current, &(con->nodes_head), nodes) {
if (current != exclude &&
current->sticky_group != NULL &&
current->window != NULL &&
@ -257,7 +257,7 @@ Con *_get_sticky(Con *con, const char *sticky_group, Con *exclude) {
return recurse;
}
TAILQ_FOREACH (current, &(con->floating_head), floating_windows) {
TAILQ_FOREACH(current, &(con->floating_head), floating_windows) {
if (current != exclude &&
current->sticky_group != NULL &&
current->window != NULL &&
@ -284,7 +284,7 @@ static void workspace_reassign_sticky(Con *con) {
/* 1: go through all containers */
/* handle all children and floating windows of this node */
TAILQ_FOREACH (current, &(con->nodes_head), nodes) {
TAILQ_FOREACH(current, &(con->nodes_head), nodes) {
if (current->sticky_group == NULL) {
workspace_reassign_sticky(current);
continue;
@ -312,8 +312,8 @@ static void workspace_reassign_sticky(Con *con) {
LOG("re-assigned window from src %p to dest %p\n", src, current);
}
TAILQ_FOREACH (current, &(con->floating_head), floating_windows)
workspace_reassign_sticky(current);
TAILQ_FOREACH(current, &(con->floating_head), floating_windows)
workspace_reassign_sticky(current);
}
/*
@ -344,7 +344,7 @@ static void _workspace_show(Con *workspace) {
/* disable fullscreen for the other workspaces and get the workspace we are
* currently on. */
TAILQ_FOREACH (current, &(workspace->parent->nodes_head), nodes) {
TAILQ_FOREACH(current, &(workspace->parent->nodes_head), nodes) {
if (current->fullscreen_mode == CF_OUTPUT)
old = current;
current->fullscreen_mode = CF_NONE;
@ -472,11 +472,11 @@ Con *workspace_next(void) {
next = TAILQ_NEXT(current, nodes);
} else {
/* If currently a numbered workspace, find next numbered workspace. */
TAILQ_FOREACH (output, &(croot->nodes_head), nodes) {
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
/* Skip outputs starting with __, they are internal. */
if (con_is_internal(output))
continue;
NODES_FOREACH (output_get_content(output)) {
NODES_FOREACH(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (child->num == -1)
@ -493,11 +493,11 @@ Con *workspace_next(void) {
/* Find next named workspace. */
if (!next) {
bool found_current = false;
TAILQ_FOREACH (output, &(croot->nodes_head), nodes) {
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
/* Skip outputs starting with __, they are internal. */
if (con_is_internal(output))
continue;
NODES_FOREACH (output_get_content(output)) {
NODES_FOREACH(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (child == current) {
@ -512,11 +512,11 @@ Con *workspace_next(void) {
/* Find first workspace. */
if (!next) {
TAILQ_FOREACH (output, &(croot->nodes_head), nodes) {
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
/* Skip outputs starting with __, they are internal. */
if (con_is_internal(output))
continue;
NODES_FOREACH (output_get_content(output)) {
NODES_FOREACH(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (!next || (child->num != -1 && child->num < next->num))
@ -544,11 +544,11 @@ Con *workspace_prev(void) {
prev = NULL;
} else {
/* If numbered workspace, find previous numbered workspace. */
TAILQ_FOREACH_REVERSE (output, &(croot->nodes_head), nodes_head, nodes) {
TAILQ_FOREACH_REVERSE(output, &(croot->nodes_head), nodes_head, nodes) {
/* Skip outputs starting with __, they are internal. */
if (con_is_internal(output))
continue;
NODES_FOREACH_REVERSE (output_get_content(output)) {
NODES_FOREACH_REVERSE(output_get_content(output)) {
if (child->type != CT_WORKSPACE || child->num == -1)
continue;
/* Need to check child against current and previous because we
@ -563,11 +563,11 @@ Con *workspace_prev(void) {
/* Find previous named workspace. */
if (!prev) {
bool found_current = false;
TAILQ_FOREACH_REVERSE (output, &(croot->nodes_head), nodes_head, nodes) {
TAILQ_FOREACH_REVERSE(output, &(croot->nodes_head), nodes_head, nodes) {
/* Skip outputs starting with __, they are internal. */
if (con_is_internal(output))
continue;
NODES_FOREACH_REVERSE (output_get_content(output)) {
NODES_FOREACH_REVERSE(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (child == current) {
@ -582,11 +582,11 @@ Con *workspace_prev(void) {
/* Find last workspace. */
if (!prev) {
TAILQ_FOREACH_REVERSE (output, &(croot->nodes_head), nodes_head, nodes) {
TAILQ_FOREACH_REVERSE(output, &(croot->nodes_head), nodes_head, nodes) {
/* Skip outputs starting with __, they are internal. */
if (con_is_internal(output))
continue;
NODES_FOREACH_REVERSE (output_get_content(output)) {
NODES_FOREACH_REVERSE(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (!prev || child->num > prev->num)
@ -613,7 +613,7 @@ Con *workspace_next_on_output(void) {
next = TAILQ_NEXT(current, nodes);
} else {
/* If currently a numbered workspace, find next numbered workspace. */
NODES_FOREACH (output_get_content(output)) {
NODES_FOREACH(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (child->num == -1)
@ -629,7 +629,7 @@ Con *workspace_next_on_output(void) {
/* Find next named workspace. */
if (!next) {
bool found_current = false;
NODES_FOREACH (output_get_content(output)) {
NODES_FOREACH(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (child == current) {
@ -643,7 +643,7 @@ Con *workspace_next_on_output(void) {
/* Find first workspace. */
if (!next) {
NODES_FOREACH (output_get_content(output)) {
NODES_FOREACH(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (!next || (child->num != -1 && child->num < next->num))
@ -671,7 +671,7 @@ Con *workspace_prev_on_output(void) {
prev = NULL;
} else {
/* If numbered workspace, find previous numbered workspace. */
NODES_FOREACH_REVERSE (output_get_content(output)) {
NODES_FOREACH_REVERSE(output_get_content(output)) {
if (child->type != CT_WORKSPACE || child->num == -1)
continue;
/* Need to check child against current and previous because we
@ -685,7 +685,7 @@ Con *workspace_prev_on_output(void) {
/* Find previous named workspace. */
if (!prev) {
bool found_current = false;
NODES_FOREACH_REVERSE (output_get_content(output)) {
NODES_FOREACH_REVERSE(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (child == current) {
@ -699,7 +699,7 @@ Con *workspace_prev_on_output(void) {
/* Find last workspace. */
if (!prev) {
NODES_FOREACH_REVERSE (output_get_content(output)) {
NODES_FOREACH_REVERSE(output_get_content(output)) {
if (child->type != CT_WORKSPACE)
continue;
if (!prev || child->num > prev->num)
@ -742,13 +742,13 @@ Con *workspace_back_and_forth_get(void) {
static bool get_urgency_flag(Con *con) {
Con *child;
TAILQ_FOREACH (child, &(con->nodes_head), nodes)
if (child->urgent || get_urgency_flag(child))
return true;
TAILQ_FOREACH(child, &(con->nodes_head), nodes)
if (child->urgent || get_urgency_flag(child))
return true;
TAILQ_FOREACH (child, &(con->floating_head), floating_windows)
if (child->urgent || get_urgency_flag(child))
return true;
TAILQ_FOREACH(child, &(con->floating_head), floating_windows)
if (child->urgent || get_urgency_flag(child))
return true;
return false;
}