]> git.sur5r.net Git - i3/i3/blobdiff - tests/swap.c
Revert "Check if output is disabled in handle_output()"
[i3/i3] / tests / swap.c
index 606b0f7175e3f1216512238d90d5c16d32722c6a..abc3b3b525d130145ba544b71d01de6d50598810 100644 (file)
@@ -34,17 +34,18 @@ void dump() {
     printf("done\n\n");
 }
 
-#define TAILQ_SWAP(first, second, head, field) do { \
-    *((first)->field.tqe_prev) = (second); \
-    (second)->field.tqe_prev = (first)->field.tqe_prev; \
-    (first)->field.tqe_prev = &((second)->field.tqe_next); \
-    (first)->field.tqe_next = (second)->field.tqe_next; \
-    if ((second)->field.tqe_next) \
-        (second)->field.tqe_next->field.tqe_prev = &((first)->field.tqe_next); \
-    (second)->field.tqe_next = first; \
-    if ((head)->tqh_last == &((second)->field.tqe_next)) \
-        (head)->tqh_last = &((first)->field.tqe_next); \
-} while (0)
+#define TAILQ_SWAP(first, second, head, field)                                     \
+    do {                                                                           \
+        *((first)->field.tqe_prev) = (second);                                     \
+        (second)->field.tqe_prev = (first)->field.tqe_prev;                        \
+        (first)->field.tqe_prev = &((second)->field.tqe_next);                     \
+        (first)->field.tqe_next = (second)->field.tqe_next;                        \
+        if ((second)->field.tqe_next)                                              \
+            (second)->field.tqe_next->field.tqe_prev = &((first)->field.tqe_next); \
+        (second)->field.tqe_next = first;                                          \
+        if ((head)->tqh_last == &((second)->field.tqe_next))                       \
+            (head)->tqh_last = &((first)->field.tqe_next);                         \
+    } while (0)
 
 void _TAILQ_SWAP(struct obj *first, struct obj *second, struct objhead *head) {
     struct obj **tqe_prev = first->entry.tqe_prev;
@@ -65,7 +66,6 @@ void _TAILQ_SWAP(struct obj *first, struct obj *second, struct objhead *head) {
 
     if (head->tqh_last == &(second->entry.tqe_next))
         head->tqh_last = &(first->entry.tqe_next);
-
 }
 
 int main() {
@@ -85,7 +85,6 @@ int main() {
     struct obj fourth;
     fourth.abc = 999;
 
-
     struct obj fifth;
     fifth.abc = 5555;
 
@@ -157,7 +156,6 @@ int main() {
 
     dump();
 
-
     /*
      * ************************************************
      */
@@ -180,7 +178,6 @@ int main() {
 
     dump();
 
-
     /*
      * ************************************************
      */
@@ -203,7 +200,6 @@ int main() {
 
     dump();
 
-
     /*
      * ************************************************
      */
@@ -225,5 +221,4 @@ int main() {
     TAILQ_REMOVE(&head, &second, entry);
 
     dump();
-
 }