aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-12-09 01:15:23 +0000
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-12-09 01:15:38 +0000
commit98c1e19466c0d83c8e1ca86eda5b273eda7eff3c (patch)
treeb47ccc174669786e3a1df9569046886c23003a45 /sway/commands
parentCleanup list code (diff)
downloadsway-98c1e19466c0d83c8e1ca86eda5b273eda7eff3c.tar.gz
sway-98c1e19466c0d83c8e1ca86eda5b273eda7eff3c.tar.zst
sway-98c1e19466c0d83c8e1ca86eda5b273eda7eff3c.zip
list.c: rename free_flat_list to list_free_items_and_destroy
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/bar/modifier.c4
-rw-r--r--sway/commands/bind.c6
-rw-r--r--sway/commands/reload.c4
-rw-r--r--sway/commands/workspace.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/sway/commands/bar/modifier.c b/sway/commands/bar/modifier.c
index 1b3e7492..b5a16f45 100644
--- a/sway/commands/bar/modifier.c
+++ b/sway/commands/bar/modifier.c
@@ -23,11 +23,11 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
23 } else { 23 } else {
24 error = cmd_results_new(CMD_INVALID, "modifier", 24 error = cmd_results_new(CMD_INVALID, "modifier",
25 "Unknown modifier '%s'", split->items[i]); 25 "Unknown modifier '%s'", split->items[i]);
26 free_flat_list(split); 26 list_free_items_and_destroy(split);
27 return error; 27 return error;
28 } 28 }
29 } 29 }
30 free_flat_list(split); 30 list_free_items_and_destroy(split);
31 config->current_bar->modifier = mod; 31 config->current_bar->modifier = mod;
32 wlr_log(WLR_DEBUG, 32 wlr_log(WLR_DEBUG,
33 "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]); 33 "Show/Hide the bar when pressing '%s' in hide mode.", argv[0]);
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 886a262c..01a35cf2 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -23,7 +23,7 @@ void free_sway_binding(struct sway_binding *binding) {
23 return; 23 return;
24 } 24 }
25 25
26 free_flat_list(binding->keys); 26 list_free_items_and_destroy(binding->keys);
27 free(binding->input); 27 free(binding->input);
28 free(binding->command); 28 free(binding->command);
29 free(binding); 29 free(binding);
@@ -220,14 +220,14 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
220 uint32_t *key = calloc(1, sizeof(uint32_t)); 220 uint32_t *key = calloc(1, sizeof(uint32_t));
221 if (!key) { 221 if (!key) {
222 free_sway_binding(binding); 222 free_sway_binding(binding);
223 free_flat_list(split); 223 list_free_items_and_destroy(split);
224 return cmd_results_new(CMD_FAILURE, bindtype, 224 return cmd_results_new(CMD_FAILURE, bindtype,
225 "Unable to allocate binding key"); 225 "Unable to allocate binding key");
226 } 226 }
227 *key = key_val; 227 *key = key_val;
228 list_add(binding->keys, key); 228 list_add(binding->keys, key);
229 } 229 }
230 free_flat_list(split); 230 list_free_items_and_destroy(split);
231 binding->order = binding_order++; 231 binding->order = binding_order++;
232 232
233 // refine region of interest for mouse binding once we are certain 233 // refine region of interest for mouse binding once we are certain
diff --git a/sway/commands/reload.c b/sway/commands/reload.c
index c236911e..3ccbbf34 100644
--- a/sway/commands/reload.c
+++ b/sway/commands/reload.c
@@ -24,7 +24,7 @@ static void do_reload(void *data) {
24 24
25 if (!load_main_config(config->current_config_path, true, false)) { 25 if (!load_main_config(config->current_config_path, true, false)) {
26 wlr_log(WLR_ERROR, "Error(s) reloading config"); 26 wlr_log(WLR_ERROR, "Error(s) reloading config");
27 free_flat_list(bar_ids); 27 list_free_items_and_destroy(bar_ids);
28 return; 28 return;
29 } 29 }
30 30
@@ -41,7 +41,7 @@ static void do_reload(void *data) {
41 } 41 }
42 } 42 }
43 } 43 }
44 free_flat_list(bar_ids); 44 list_free_items_and_destroy(bar_ids);
45 45
46 config_update_font_height(true); 46 config_update_font_height(true);
47 root_for_each_container(rebuild_textures_iterator, NULL); 47 root_for_each_container(rebuild_textures_iterator, NULL);
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index 7d32e65b..211b344d 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -33,7 +33,7 @@ static struct workspace_config *workspace_config_find_or_create(char *ws_name) {
33 33
34void free_workspace_config(struct workspace_config *wsc) { 34void free_workspace_config(struct workspace_config *wsc) {
35 free(wsc->workspace); 35 free(wsc->workspace);
36 free_flat_list(wsc->outputs); 36 list_free_items_and_destroy(wsc->outputs);
37 free(wsc); 37 free(wsc);
38} 38}
39 39