clang-format: bring back ForeachMacros (#3948)

* clang-format: bring back ForeachMacros

ForeachMacros was disabled in 4211274fcd
due to the breakage of include/queue.h. The currently used version,
clang-format-6.0 doesn't break it.

* Add curly braces

Co-authored-by: Orestis Floros <orestisflo@gmail.com>
This commit is contained in:
xzfc
2020-02-19 10:31:09 +00:00
committed by GitHub
parent e3f120c0b6
commit 1f0c628cde
37 changed files with 363 additions and 329 deletions

View File

@ -24,7 +24,7 @@ static Rect total_outputs_dimensions(void) {
Output *output;
/* Use Rect to encapsulate dimensions, ignoring x/y */
Rect outputs_dimensions = {0, 0, 0, 0};
TAILQ_FOREACH(output, &outputs, outputs) {
TAILQ_FOREACH (output, &outputs, outputs) {
outputs_dimensions.height += output->rect.height;
outputs_dimensions.width += output->rect.width;
}
@ -39,7 +39,7 @@ static Rect total_outputs_dimensions(void) {
static void floating_set_hint_atom(Con *con, bool floating) {
if (!con_is_leaf(con)) {
Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
floating_set_hint_atom(child, floating);
}
}
@ -328,7 +328,7 @@ void floating_enable(Con *con, bool automatic) {
if (rect_equals(nc->rect, (Rect){0, 0, 0, 0})) {
DLOG("Geometry not set, combining children\n");
Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
DLOG("child geometry: %d x %d\n", child->geometry.width, child->geometry.height);
nc->rect.width += child->geometry.width;
nc->rect.height = max(nc->rect.height, child->geometry.height);