diff options
| author | Abhinav Prasai <abhinav.prsai@gmail.com> | 2025-08-24 21:34:10 +0100 |
|---|---|---|
| committer | Abhinav Prasai <abhinav.prsai@gmail.com> | 2025-08-24 21:34:10 +0100 |
| commit | 10777ab35142e494884896c32cf5ed6389f9945f (patch) | |
| tree | c311d1dec0af1051829600704bf6cf60556b9647 /src/parser.c | |
| parent | 02bd4d5de2ab9715aba045ebf46d76dc58ca6e42 (diff) | |
rename bindsn -> n_binds
Diffstat (limited to 'src/parser.c')
| -rw-r--r-- | src/parser.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/parser.c b/src/parser.c index f0cc0d5..32f9483 100644 --- a/src/parser.c +++ b/src/parser.c @@ -39,11 +39,11 @@ static const CommandEntry call_table[] = {{"close_window", close_focused}, static void remap_and_dedupe_binds(Config *cfg) { - for (int i = 0; i < cfg->bindsn; i++) { - for (int j = i + 1; j < cfg->bindsn; j++) { + for (int i = 0; i < cfg->n_binds; i++) { + for (int j = i + 1; j < cfg->n_binds; j++) { if (cfg->binds[i].mods == cfg->binds[j].mods && cfg->binds[i].keysym == cfg->binds[j].keysym) { - memmove(&cfg->binds[j], &cfg->binds[j + 1], sizeof(Binding) * (cfg->bindsn - j - 1)); - cfg->bindsn--; + memmove(&cfg->binds[j], &cfg->binds[j + 1], sizeof(Binding) * (cfg->n_binds - j - 1)); + cfg->n_binds--; j--; } } @@ -81,15 +81,15 @@ static char *strip_quotes(char *s) static Binding *alloc_bind(Config *cfg, unsigned mods, KeySym ks) { - for (int i = 0; i < cfg->bindsn; i++) { + for (int i = 0; i < cfg->n_binds; i++) { if (cfg->binds[i].mods == (int)mods && cfg->binds[i].keysym == ks) { return &cfg->binds[i]; } } - if (cfg->bindsn >= MAX_BINDS) { + if (cfg->n_binds >= MAX_BINDS) { return NULL; } - Binding *b = &cfg->binds[cfg->bindsn++]; + Binding *b = &cfg->binds[cfg->n_binds++]; b->mods = mods; b->keysym = ks; return b; |
