mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +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?
|
||||
size_t num = 0;
|
||||
size_t binding_count = 0;
|
||||
|
||||
/*
|
||||
* 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++) {
|
||||
if (b->keys[z] == key) {
|
||||
bindings[num++] = b;
|
||||
bindings[binding_count++] = b;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//! @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!");
|
||||
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 *
|
||||
|
|
|
@ -683,20 +683,20 @@ get_binding(struct oxr_logger *log,
|
|||
return;
|
||||
}
|
||||
|
||||
size_t num = 0;
|
||||
size_t binding_count = 0;
|
||||
oxr_binding_find_bindings_from_key( //
|
||||
log, // log
|
||||
profile, // p
|
||||
act_ref->act_key, // key
|
||||
ARRAY_SIZE(binding_points), // max_bounding_count
|
||||
binding_points, // bindings
|
||||
&num); // out_binding_count
|
||||
if (num == 0) {
|
||||
&binding_count); // out_binding_count
|
||||
if (binding_count == 0) {
|
||||
oxr_slog(slog, "\t\t\tNo bindings!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < num; i++) {
|
||||
for (size_t i = 0; i < binding_count; i++) {
|
||||
const char *str = NULL;
|
||||
struct oxr_binding *binding_point = binding_points[i];
|
||||
|
||||
|
|
Loading…
Reference in a new issue