st/oxr: Change num to binding_count [NFC]

This commit is contained in:
Jakob Bornecrantz 2024-01-04 21:20:53 +00:00
parent 0f9147c6de
commit ef6e07508a
2 changed files with 9 additions and 9 deletions

View file

@ -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 *

View file

@ -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];