switch to clang-format-3.8 (#2547)

https://llvm.org/bugs/show_bug.cgi?id=30353 was filed for the unintended
line break between in e.g. “TAILQ_ENTRY(foo)\nbar;”.

Until that’s fixed or a workaround is known, we’ll live with line
breaks. To make it a bit easier for readers to see what’s going on, I
added extra line breaks around each such struct member/variable
definition, so that they at least visually are a single unit.

fixes #2174
This commit is contained in:
Michael Stapelberg
2016-11-08 13:46:43 -08:00
committed by GitHub
parent 4ccac59932
commit fff3f79da9
24 changed files with 907 additions and 837 deletions

View File

@ -142,7 +142,9 @@ static Con *maybe_auto_back_and_forth_workspace(Con *workspace) {
*/
typedef struct owindow {
Con *con;
TAILQ_ENTRY(owindow) owindows;
TAILQ_ENTRY(owindow)
owindows;
} owindow;
typedef TAILQ_HEAD(owindows_head, owindow) owindows_head;

View File

@ -410,7 +410,8 @@ Con *con_parent_with_orientation(Con *con, orientation_t orientation) {
struct bfs_entry {
Con *con;
TAILQ_ENTRY(bfs_entry) entries;
TAILQ_ENTRY(bfs_entry)
entries;
};
/*
@ -422,7 +423,9 @@ Con *con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode) {
/* TODO: is breadth-first-search really appropriate? (check as soon as
* fullscreen levels and fullscreen for containers is implemented) */
TAILQ_HEAD(bfs_head, bfs_entry) bfs_head = TAILQ_HEAD_INITIALIZER(bfs_head);
TAILQ_HEAD(bfs_head, bfs_entry)
bfs_head = TAILQ_HEAD_INITIALIZER(bfs_head);
struct bfs_entry *entry = smalloc(sizeof(struct bfs_entry));
entry->con = con;
TAILQ_INSERT_TAIL(&bfs_head, entry, entries);

View File

@ -1002,7 +1002,7 @@ bool parse_file(const char *f, bool use_nagbar) {
char *next;
for (next = bufcopy;
next < (bufcopy + stbuf.st_size) &&
(next = strcasestr(next, current->key)) != NULL;
(next = strcasestr(next, current->key)) != NULL;
next += strlen(current->key)) {
*next = '_';
extra_bytes += extra;

View File

@ -22,7 +22,8 @@
char *current_socketpath = NULL;
TAILQ_HEAD(ipc_client_head, ipc_client) all_clients = TAILQ_HEAD_INITIALIZER(all_clients);
TAILQ_HEAD(ipc_client_head, ipc_client)
all_clients = TAILQ_HEAD_INITIALIZER(all_clients);
/*
* Puts the given socket file descriptor into non-blocking mode or dies if

View File

@ -34,7 +34,9 @@ static bool swallow_is_empty;
* array. */
struct focus_mapping {
int old_id;
TAILQ_ENTRY(focus_mapping) focus_mappings;
TAILQ_ENTRY(focus_mapping)
focus_mappings;
};
static TAILQ_HEAD(focus_mappings_head, focus_mapping) focus_mappings =

View File

@ -167,7 +167,7 @@ bool match_matches_window(Match *match, i3Window *window) {
/* if we find a window that is newer than this one, bail */
TAILQ_FOREACH(con, &all_cons, all_cons) {
if ((con->window != NULL) &&
_i3_timercmp(con->window->urgent, window->urgent, > )) {
_i3_timercmp(con->window->urgent, window->urgent, >)) {
return false;
}
}
@ -183,7 +183,7 @@ bool match_matches_window(Match *match, i3Window *window) {
TAILQ_FOREACH(con, &all_cons, all_cons) {
if ((con->window != NULL) &&
(con->window->urgent.tv_sec != 0) &&
_i3_timercmp(con->window->urgent, window->urgent, < )) {
_i3_timercmp(con->window->urgent, window->urgent, <)) {
return false;
}
}

View File

@ -29,7 +29,8 @@ typedef struct placeholder_state {
/** The graphics context for “pixmap”. */
xcb_gcontext_t gc;
TAILQ_ENTRY(placeholder_state) state;
TAILQ_ENTRY(placeholder_state)
state;
} placeholder_state;
static TAILQ_HEAD(state_head, placeholder_state) state_head =

20
src/x.c
View File

@ -58,18 +58,26 @@ typedef struct con_state {
char *name;
CIRCLEQ_ENTRY(con_state) state;
CIRCLEQ_ENTRY(con_state) old_state;
TAILQ_ENTRY(con_state) initial_mapping_order;
CIRCLEQ_ENTRY(con_state)
state;
CIRCLEQ_ENTRY(con_state)
old_state;
TAILQ_ENTRY(con_state)
initial_mapping_order;
} con_state;
CIRCLEQ_HEAD(state_head, con_state) state_head =
CIRCLEQ_HEAD(state_head, con_state)
state_head =
CIRCLEQ_HEAD_INITIALIZER(state_head);
CIRCLEQ_HEAD(old_state_head, con_state) old_state_head =
CIRCLEQ_HEAD(old_state_head, con_state)
old_state_head =
CIRCLEQ_HEAD_INITIALIZER(old_state_head);
TAILQ_HEAD(initial_mapping_head, con_state) initial_mapping_head =
TAILQ_HEAD(initial_mapping_head, con_state)
initial_mapping_head =
TAILQ_HEAD_INITIALIZER(initial_mapping_head);
/*