aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.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/config.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/config.c')
-rw-r--r--sway/config.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sway/config.c b/sway/config.c
index ff7de4b9..efb95e31 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -654,8 +654,7 @@ bool read_config(FILE *file, struct sway_config *config,
654 654
655 if (read + length > config_size) { 655 if (read + length > config_size) {
656 wlr_log(WLR_ERROR, "Config file changed during reading"); 656 wlr_log(WLR_ERROR, "Config file changed during reading");
657 list_foreach(stack, free); 657 free_flat_list(stack);
658 list_free(stack);
659 free(line); 658 free(line);
660 return false; 659 return false;
661 } 660 }
@@ -684,8 +683,7 @@ bool read_config(FILE *file, struct sway_config *config,
684 } 683 }
685 char *expanded = expand_line(block, line, brace_detected > 0); 684 char *expanded = expand_line(block, line, brace_detected > 0);
686 if (!expanded) { 685 if (!expanded) {
687 list_foreach(stack, free); 686 free_flat_list(stack);
688 list_free(stack);
689 free(line); 687 free(line);
690 return false; 688 return false;
691 } 689 }
@@ -750,8 +748,7 @@ bool read_config(FILE *file, struct sway_config *config,
750 free(line); 748 free(line);
751 free_cmd_results(res); 749 free_cmd_results(res);
752 } 750 }
753 list_foreach(stack, free); 751 free_flat_list(stack);
754 list_free(stack);
755 config->current_config_line_number = 0; 752 config->current_config_line_number = 0;
756 config->current_config_line = NULL; 753 config->current_config_line = NULL;
757 754