diff options
author | 2015-12-21 20:42:08 -0500 | |
---|---|---|
committer | 2015-12-21 20:42:08 -0500 | |
commit | 91c102a897467ff1bae345458ccf096e32e7bd15 (patch) | |
tree | 104c612d08afef1566c9b56f962641bb39c0dc1b /sway/commands.c | |
parent | Merge pull request #391 from mikkeloscar/trigger-workspace-ipc (diff) | |
parent | replace non-standard qsort_r with qsort (diff) | |
download | sway-91c102a897467ff1bae345458ccf096e32e7bd15.tar.gz sway-91c102a897467ff1bae345458ccf096e32e7bd15.tar.zst sway-91c102a897467ff1bae345458ccf096e32e7bd15.zip |
Merge pull request #393 from robotanarchy/musl-libc-compatibility
musl libc compatibility
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/commands.c b/sway/commands.c index 93c74915..b1b1c5b6 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -220,7 +220,7 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) { | |||
220 | } | 220 | } |
221 | binding->order = binding_order++; | 221 | binding->order = binding_order++; |
222 | list_add(mode->bindings, binding); | 222 | list_add(mode->bindings, binding); |
223 | list_sort(mode->bindings, sway_binding_cmp); | 223 | list_qsort(mode->bindings, sway_binding_cmp_qsort); |
224 | 224 | ||
225 | sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command); | 225 | sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command); |
226 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 226 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
@@ -1266,9 +1266,9 @@ static struct cmd_results *cmd_scratchpad(int argc, char **argv) { | |||
1266 | } | 1266 | } |
1267 | 1267 | ||
1268 | // sort in order of longest->shortest | 1268 | // sort in order of longest->shortest |
1269 | static int compare_set(const void *_l, const void *_r) { | 1269 | static int compare_set_qsort(const void *_l, const void *_r) { |
1270 | struct sway_variable const *l = _l; | 1270 | struct sway_variable const *l = *(void **)_l; |
1271 | struct sway_variable const *r = _r; | 1271 | struct sway_variable const *r = *(void **)_r; |
1272 | return strlen(r->name) - strlen(l->name); | 1272 | return strlen(r->name) - strlen(l->name); |
1273 | } | 1273 | } |
1274 | 1274 | ||
@@ -1295,7 +1295,7 @@ static struct cmd_results *cmd_set(int argc, char **argv) { | |||
1295 | var = malloc(sizeof(struct sway_variable)); | 1295 | var = malloc(sizeof(struct sway_variable)); |
1296 | var->name = strdup(argv[0]); | 1296 | var->name = strdup(argv[0]); |
1297 | list_add(config->symbols, var); | 1297 | list_add(config->symbols, var); |
1298 | list_sort(config->symbols, compare_set); | 1298 | list_qsort(config->symbols, compare_set_qsort); |
1299 | } | 1299 | } |
1300 | var->value = join_args(argv + 1, argc - 1); | 1300 | var->value = join_args(argv + 1, argc - 1); |
1301 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 1301 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
@@ -1631,7 +1631,7 @@ static struct cmd_results *bar_cmd_bindsym(int argc, char **argv) { | |||
1631 | list_del(bar->bindings, i); | 1631 | list_del(bar->bindings, i); |
1632 | } | 1632 | } |
1633 | list_add(bar->bindings, binding); | 1633 | list_add(bar->bindings, binding); |
1634 | list_sort(bar->bindings, sway_mouse_binding_cmp); | 1634 | list_qsort(bar->bindings, sway_mouse_binding_cmp_qsort); |
1635 | 1635 | ||
1636 | sway_log(L_DEBUG, "bindsym - Bound %s to command %s when clicking swaybar", argv[0], binding->command); | 1636 | sway_log(L_DEBUG, "bindsym - Bound %s to command %s when clicking swaybar", argv[0], binding->command); |
1637 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 1637 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |