From ef6e07508a6c0529bd44b8595f98dea976cbb95c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 4 Jan 2024 21:20:53 +0000 Subject: [PATCH] st/oxr: Change num to binding_count [NFC] --- src/xrt/state_trackers/oxr/oxr_binding.c | 10 +++++----- src/xrt/state_trackers/oxr/oxr_input.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_binding.c b/src/xrt/state_trackers/oxr/oxr_binding.c index f8831607c..1a494893b 100644 --- a/src/xrt/state_trackers/oxr/oxr_binding.c +++ b/src/xrt/state_trackers/oxr/oxr_binding.c @@ -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 * diff --git a/src/xrt/state_trackers/oxr/oxr_input.c b/src/xrt/state_trackers/oxr/oxr_input.c index b69880bf4..5b3f7e017 100644 --- a/src/xrt/state_trackers/oxr/oxr_input.c +++ b/src/xrt/state_trackers/oxr/oxr_input.c @@ -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];