aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-12-08 22:52:29 +0000
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-12-09 00:37:50 +0000
commit19e831ed3da2aba75d56e46c57967bcc60442d57 (patch)
treeedaa5855087f9d6f257c5c6dcd5eda0c4cc55b02 /sway/tree/container.c
parentMerge pull request #3260 from RedSoxFan/split-flatten (diff)
downloadsway-19e831ed3da2aba75d56e46c57967bcc60442d57.tar.gz
sway-19e831ed3da2aba75d56e46c57967bcc60442d57.tar.zst
sway-19e831ed3da2aba75d56e46c57967bcc60442d57.zip
list.c: Remove list_foreach
Most occurrences have been replaced by `free_flat_list` which has been moved from stringop.c to list.c. The rest have been replaced by for loops.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 91e8dd7f..ac433577 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -21,6 +21,7 @@
21#include "sway/tree/arrange.h" 21#include "sway/tree/arrange.h"
22#include "sway/tree/view.h" 22#include "sway/tree/view.h"
23#include "sway/tree/workspace.h" 23#include "sway/tree/workspace.h"
24#include "list.h"
24#include "log.h" 25#include "log.h"
25#include "stringop.h" 26#include "stringop.h"
26 27
@@ -67,8 +68,7 @@ void container_destroy(struct sway_container *con) {
67 list_free(con->current.children); 68 list_free(con->current.children);
68 list_free(con->outputs); 69 list_free(con->outputs);
69 70
70 list_foreach(con->marks, free); 71 free_flat_list(con->marks);
71 list_free(con->marks);
72 wlr_texture_destroy(con->marks_focused); 72 wlr_texture_destroy(con->marks_focused);
73 wlr_texture_destroy(con->marks_focused_inactive); 73 wlr_texture_destroy(con->marks_focused_inactive);
74 wlr_texture_destroy(con->marks_unfocused); 74 wlr_texture_destroy(con->marks_unfocused);
@@ -1267,7 +1267,9 @@ bool container_find_and_unmark(char *mark) {
1267} 1267}
1268 1268
1269void container_clear_marks(struct sway_container *con) { 1269void container_clear_marks(struct sway_container *con) {
1270 list_foreach(con->marks, free); 1270 for (int i = 0; i < con->marks->length; ++i) {
1271 free(con->marks->items[i]);
1272 }
1271 con->marks->length = 0; 1273 con->marks->length = 0;
1272 ipc_event_window(con, "mark"); 1274 ipc_event_window(con, "mark");
1273} 1275}