]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
switch to clang-format-3.8 (#2547)
[i3/i3] / src / commands.c
index 403c3b3a2dd02f3fb1821268567d1bfb9156c3bf..70622b7db15ca608a3b19ffe870f2afcfdd4c264 100644 (file)
@@ -1,5 +1,3 @@
-#undef I3__FILE__
-#define I3__FILE__ "commands.c"
 /*
  * vim:ts=4:sw=4:expandtab
  *
@@ -9,6 +7,8 @@
  * commands.c: all command functions (see commands_parser.c)
  *
  */
+#include "all.h"
+
 #include <stdint.h>
 #include <float.h>
 #include <stdarg.h>
@@ -17,7 +17,6 @@
 #include <sanitizer/lsan_interface.h>
 #endif
 
-#include "all.h"
 #include "shmlog.h"
 
 // Macros to make the YAJL API a bit easier to use.
@@ -87,17 +86,6 @@ static bool definitelyGreaterThan(float a, float b, float epsilon) {
     return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
 }
 
-/*
- * Returns the output containing the given container.
- */
-static Output *get_output_of_con(Con *con) {
-    Con *output_con = con_get_output(con);
-    Output *output = get_output_by_name(output_con->name);
-    assert(output != NULL);
-
-    return output;
-}
-
 /*
  * Checks whether we switched to a new workspace and returns false in that case,
  * signaling that further workspace switching should be done by the calling function
@@ -154,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;
@@ -1036,7 +1026,7 @@ void cmd_move_con_to_output(I3_CMD, const char *name) {
     TAILQ_FOREACH(current, &owindows, owindows) {
         DLOG("matching: %p / %s\n", current->con, current->con->name);
 
-        Output *current_output = get_output_of_con(current->con);
+        Output *current_output = get_output_for_con(current->con);
         assert(current_output != NULL);
 
         Output *output = get_output_from_string(current_output, name);
@@ -1648,7 +1638,7 @@ void cmd_focus_output(I3_CMD, const char *name) {
     Output *output;
 
     TAILQ_FOREACH(current, &owindows, owindows)
-    current_output = get_output_of_con(current->con);
+    current_output = get_output_for_con(current->con);
     assert(current_output != NULL);
 
     output = get_output_from_string(current_output, name);