mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
st/oxr: Change num to binding_count [NFC]
This commit is contained in:
parent
0f9147c6de
commit
ef6e07508a
|
@ -436,7 +436,7 @@ oxr_binding_find_bindings_from_key(struct oxr_logger *log,
|
||||||
}
|
}
|
||||||
|
|
||||||
// How many bindings are we returning?
|
// How many bindings are we returning?
|
||||||
size_t num = 0;
|
size_t binding_count = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop over all app provided bindings for this profile
|
* Loop over all app provided bindings for this profile
|
||||||
|
@ -447,21 +447,21 @@ oxr_binding_find_bindings_from_key(struct oxr_logger *log,
|
||||||
|
|
||||||
for (size_t z = 0; z < b->key_count; z++) {
|
for (size_t z = 0; z < b->key_count; z++) {
|
||||||
if (b->keys[z] == key) {
|
if (b->keys[z] == key) {
|
||||||
bindings[num++] = b;
|
bindings[binding_count++] = b;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! @todo Should return total count instead of fixed max.
|
//! @todo Should return total count instead of fixed max.
|
||||||
if (num >= max_bounding_count) {
|
if (binding_count >= max_bounding_count) {
|
||||||
oxr_warn(log, "Internal limit reached, action has too many bindings!");
|
oxr_warn(log, "Internal limit reached, action has too many bindings!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(num <= max_bounding_count);
|
assert(binding_count <= max_bounding_count);
|
||||||
|
|
||||||
*out_binding_count = num;
|
*out_binding_count = binding_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct oxr_interaction_profile *
|
struct oxr_interaction_profile *
|
||||||
|
|
|
@ -683,20 +683,20 @@ get_binding(struct oxr_logger *log,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t num = 0;
|
size_t binding_count = 0;
|
||||||
oxr_binding_find_bindings_from_key( //
|
oxr_binding_find_bindings_from_key( //
|
||||||
log, // log
|
log, // log
|
||||||
profile, // p
|
profile, // p
|
||||||
act_ref->act_key, // key
|
act_ref->act_key, // key
|
||||||
ARRAY_SIZE(binding_points), // max_bounding_count
|
ARRAY_SIZE(binding_points), // max_bounding_count
|
||||||
binding_points, // bindings
|
binding_points, // bindings
|
||||||
&num); // out_binding_count
|
&binding_count); // out_binding_count
|
||||||
if (num == 0) {
|
if (binding_count == 0) {
|
||||||
oxr_slog(slog, "\t\t\tNo bindings!\n");
|
oxr_slog(slog, "\t\t\tNo bindings!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < num; i++) {
|
for (size_t i = 0; i < binding_count; i++) {
|
||||||
const char *str = NULL;
|
const char *str = NULL;
|
||||||
struct oxr_binding *binding_point = binding_points[i];
|
struct oxr_binding *binding_point = binding_points[i];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue