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

This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
This commit is contained in:
Michael Stapelberg
2014-06-15 19:07:02 +02:00
parent 4d937b7dbb
commit 9200094203
65 changed files with 2891 additions and 2924 deletions

View File

@ -21,7 +21,8 @@
void scratchpad_move(Con *con) {
if (con->type == CT_WORKSPACE) {
LOG("'move scratchpad' used on a workspace \"%s\". Calling it "
"recursively on all windows on this workspace.\n", con->name);
"recursively on all windows on this workspace.\n",
con->name);
Con *current;
current = TAILQ_FIRST(&(con->focus_head));
while (current) {
@ -115,25 +116,25 @@ void scratchpad_show(Con *con) {
* unfocused scratchpad on the current workspace and focus it */
Con *walk_con;
Con *focused_ws = con_get_workspace(focused);
TAILQ_FOREACH(walk_con, &(focused_ws->floating_head), floating_windows) {
TAILQ_FOREACH (walk_con, &(focused_ws->floating_head), floating_windows) {
if (!con && (floating = con_inside_floating(walk_con)) &&
floating->scratchpad_state != SCRATCHPAD_NONE &&
floating != con_inside_floating(focused)) {
DLOG("Found an unfocused scratchpad window on this workspace\n");
DLOG("Focusing it: %p\n", walk_con);
/* use con_descend_tiling_focused to get the last focused
DLOG("Found an unfocused scratchpad window on this workspace\n");
DLOG("Focusing it: %p\n", walk_con);
/* use con_descend_tiling_focused to get the last focused
* window inside this scratch container in order to
* keep the focus the same within this container */
con_focus(con_descend_tiling_focused(walk_con));
return;
}
con_focus(con_descend_tiling_focused(walk_con));
return;
}
}
/* If this was 'scratchpad show' without criteria, we check if there is a
* visible scratchpad window on another workspace. In this case we move it
* to the current workspace. */
focused_ws = con_get_workspace(focused);
TAILQ_FOREACH(walk_con, &all_cons, all_cons) {
TAILQ_FOREACH (walk_con, &all_cons, all_cons) {
Con *walk_ws = con_get_workspace(walk_con);
if (!con && walk_ws &&
!con_is_internal(walk_ws) && focused_ws != walk_ws &&
@ -256,7 +257,7 @@ void scratchpad_fix_resolution(void) {
Con *output;
int new_width = -1,
new_height = -1;
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
TAILQ_FOREACH (output, &(croot->nodes_head), nodes) {
if (output == __i3_output)
continue;
DLOG("output %s's resolution: (%d, %d) %d x %d\n",
@ -287,7 +288,7 @@ void scratchpad_fix_resolution(void) {
DLOG("Fixing coordinates of scratchpad windows\n");
Con *con;
TAILQ_FOREACH(con, &(__i3_scratch->floating_head), floating_windows) {
TAILQ_FOREACH (con, &(__i3_scratch->floating_head), floating_windows) {
floating_fix_coordinates(con, &old_rect, &new_rect);
}
}