mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
variable name consistency; from Thomas Pfaff
This commit is contained in:
parent
587d623e4a
commit
7b00e3fe76
36
conf.c
36
conf.c
@ -446,16 +446,15 @@ conf_bindname(struct conf *c, char *name, char *binding)
|
|||||||
{
|
{
|
||||||
struct keybinding *current_binding;
|
struct keybinding *current_binding;
|
||||||
char *substring, *tmp;
|
char *substring, *tmp;
|
||||||
int iter;
|
int i;
|
||||||
|
|
||||||
current_binding = xcalloc(1, sizeof(*current_binding));
|
current_binding = xcalloc(1, sizeof(*current_binding));
|
||||||
|
|
||||||
if ((substring = strchr(name, '-')) != NULL) {
|
if ((substring = strchr(name, '-')) != NULL) {
|
||||||
for (iter = 0; iter < nitems(bind_mods); iter++) {
|
for (i = 0; i < nitems(bind_mods); i++) {
|
||||||
if ((tmp = strchr(name, bind_mods[iter].chr)) !=
|
if ((tmp = strchr(name, bind_mods[i].chr)) !=
|
||||||
NULL && tmp < substring) {
|
NULL && tmp < substring) {
|
||||||
current_binding->modmask |=
|
current_binding->modmask |= bind_mods[i].mask;
|
||||||
bind_mods[iter].mask;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,13 +486,13 @@ conf_bindname(struct conf *c, char *name, char *binding)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iter = 0; iter < nitems(name_to_kbfunc); iter++) {
|
for (i = 0; i < nitems(name_to_kbfunc); i++) {
|
||||||
if (strcmp(name_to_kbfunc[iter].tag, binding) != 0)
|
if (strcmp(name_to_kbfunc[i].tag, binding) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
current_binding->callback = name_to_kbfunc[iter].handler;
|
current_binding->callback = name_to_kbfunc[i].handler;
|
||||||
current_binding->flags = name_to_kbfunc[iter].flags;
|
current_binding->flags = name_to_kbfunc[i].flags;
|
||||||
current_binding->argument = name_to_kbfunc[iter].argument;
|
current_binding->argument = name_to_kbfunc[i].argument;
|
||||||
conf_grab(c, current_binding);
|
conf_grab(c, current_binding);
|
||||||
TAILQ_INSERT_TAIL(&c->keybindingq, current_binding, entry);
|
TAILQ_INSERT_TAIL(&c->keybindingq, current_binding, entry);
|
||||||
return;
|
return;
|
||||||
@ -548,16 +547,15 @@ conf_mousebind(struct conf *c, char *name, char *binding)
|
|||||||
struct mousebinding *current_binding;
|
struct mousebinding *current_binding;
|
||||||
char *substring, *tmp;
|
char *substring, *tmp;
|
||||||
const char *errstr;
|
const char *errstr;
|
||||||
int iter;
|
int i;
|
||||||
|
|
||||||
current_binding = xcalloc(1, sizeof(*current_binding));
|
current_binding = xcalloc(1, sizeof(*current_binding));
|
||||||
|
|
||||||
if ((substring = strchr(name, '-')) != NULL) {
|
if ((substring = strchr(name, '-')) != NULL) {
|
||||||
for (iter = 0; iter < nitems(bind_mods); iter++) {
|
for (i = 0; i < nitems(bind_mods); i++) {
|
||||||
if ((tmp = strchr(name, bind_mods[iter].chr)) !=
|
if ((tmp = strchr(name, bind_mods[i].chr)) !=
|
||||||
NULL && tmp < substring) {
|
NULL && tmp < substring) {
|
||||||
current_binding->modmask |=
|
current_binding->modmask |= bind_mods[i].mask;
|
||||||
bind_mods[iter].mask;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,12 +576,12 @@ conf_mousebind(struct conf *c, char *name, char *binding)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iter = 0; iter < nitems(name_to_mousefunc); iter++) {
|
for (i = 0; i < nitems(name_to_mousefunc); i++) {
|
||||||
if (strcmp(name_to_mousefunc[iter].tag, binding) != 0)
|
if (strcmp(name_to_mousefunc[i].tag, binding) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
current_binding->context = name_to_mousefunc[iter].context;
|
current_binding->context = name_to_mousefunc[i].context;
|
||||||
current_binding->callback = name_to_mousefunc[iter].handler;
|
current_binding->callback = name_to_mousefunc[i].handler;
|
||||||
TAILQ_INSERT_TAIL(&c->mousebindingq, current_binding, entry);
|
TAILQ_INSERT_TAIL(&c->mousebindingq, current_binding, entry);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user