···66666767 results->xpdevs[results->xpdev_count++] = xpdev;
68686969- // Abort if full.
6969+ // Exit if full.
7070 if (results->xpdev_count >= ARRAY_SIZE(results->xpdevs)) {
7171 return;
7272 }
+1-1
src/xrt/auxiliary/util/u_device.c
···214214 }
215215 }
216216 {
217217- /* left eye - just mirroring right eye now */
217217+ /* left eye - mirroring right eye */
218218 xdev->hmd->distortion.fov[0].angle_up = xdev->hmd->distortion.fov[1].angle_up;
219219 xdev->hmd->distortion.fov[0].angle_down = xdev->hmd->distortion.fov[1].angle_down;
220220
+1-1
src/xrt/auxiliary/util/u_device.h
···7676u_device_setup_split_side_by_side(struct xrt_device *xdev, const struct u_device_simple_info *info);
77777878/*!
7979- * Just setup the device's display's 2D extents.
7979+ * Setup the device's display's 2D extents.
8080 * Good for headsets without traditional VR optics.
8181 *
8282 * @return true on success.
+1-1
src/xrt/auxiliary/util/u_distortion.h
···6060 * Values to create a distortion mesh from cardboard values.
6161 *
6262 * This matches the formula in the cardboard SDK, while the array is fixed size
6363- * just setting the K value to zero will make it not have a effect.
6363+ * setting the K value to zero will make it not have a effect.
6464 *
6565 * p' = p (1 + K0 r^2 + K1 r^4 + ... + Kn r^(2n))
6666 *
+1-1
src/xrt/auxiliary/util/u_documentation.h
···22// SPDX-License-Identifier: BSL-1.0
33/*!
44 * @file
55- * @brief Header with just documentation.
55+ * @brief Header with only documentation.
66 * @author Jakob Bornecrantz <jakob@collabora.com>
77 * @ingroup aux_util
88 */
+1-1
src/xrt/auxiliary/util/u_frame.c
···5656{
5757 struct xrt_frame *xf = U_TYPED_CALLOC(struct xrt_frame);
58585959- // Paranoia: Explicitly only copy the fields we want
5959+ // Explicitly only copy the fields we want
6060 xf->width = to_copy->width;
6161 xf->height = to_copy->height;
6262 xf->stride = to_copy->stride;
···31313232namespace {
33333434-// just enough iterator to get it done: basically copy and paste from u_template_historybuf_const_iterator.inl
3434+// just-enough iterator to get it done: basically copy and paste from u_template_historybuf_const_iterator.inl
3535struct IdRingbufferIterator : public RandomAccessIteratorBase<const RingBufferHelper>
3636{
3737 using base = RandomAccessIteratorBase<const RingBufferHelper>;
+2-2
src/xrt/auxiliary/util/u_id_ringbuffer.h
···1919/**
2020 * Container type to let you store IDs in a ring buffer, and maybe your own data in your own parallel array.
2121 *
2222- * The IDs are just uint64_t. If you don't need any of the order-dependent functionality, you can treat use them for any
2222+ * The IDs are uint64_t. If you don't need any of the order-dependent functionality, you can treat use them for any
2323 * purpose you like.
2424 *
2525 * Some functionality requires that IDs be pushed in increasing order, but it's highlighted in the docs.
···187187/**
188188 * Find the element with the supplied ID @p search_id in an unordered buffer.
189189 *
190190- * This does *not* depend on order so just does a linear search. If you are keeping your IDs in ascending order, use
190190+ * This does *not* depend on order so does a linear search. If you are keeping your IDs in ascending order, use
191191 * u_id_ringbuffer_lower_bound_id() instead.
192192 *
193193 * @param uirb self pointer
+4-3
src/xrt/auxiliary/util/u_iterator_base.hpp
···6565 }
66666767 /*!
6868- * @brief True if this iterator is "irrecoverably" invalid (aka, cleared/default constructed).
6868+ * @brief True if this iterator is "irrecoverably" invalid (that is, cleared or default constructed).
6969 *
7070 * Implies !valid() but is stronger. `buf.end().is_cleared()` is false.
7171 */
···128128129129130130 /**
131131- * @brief Default constructor - initializes to "cleared" aka irrecoverably invalid
131131+ * @brief Default constructor - initializes to "cleared" (that is, irrecoverably invalid - because we have no
132132+ * reference to a container)
132133 */
133134 RandomAccessIteratorBase() = default;
134135···172173 void
173174 decrement_n(std::size_t n);
174175175175- //! Access the container or helper
176176+ //! Get the associated container or helper
176177 ContainerOrHelper *
177178 container() const noexcept
178179 {
+4-4
src/xrt/auxiliary/util/u_json.hpp
···8989public:
9090 // Class resource management
91919292- //! This is public just so that make_shared works; do not use outside of this file.
9292+ //! This is public so that make_shared works; do not use outside of this file.
9393 JSONNode(cJSON *cjson, bool is_owner, const JSONNode::Ptr &parent)
9494 : cjson(cjson), is_owner(is_owner), parent(parent)
9595 {}
···190190 operator[](const string &key) const
191191 {
192192 const char *name = key.c_str();
193193- JSON_ASSERTW(isObject(), "Trying to access field '%s' from non-object %s", name, toString().c_str());
193193+ JSON_ASSERTW(isObject(), "Trying to retrieve field '%s' from non-object %s", name, toString().c_str());
194194195195 cJSON *value = cJSON_GetObjectItemCaseSensitive(cjson, name);
196196 JSON_ASSERTW(value != nullptr, "Unable to retrieve field '%s' from %s", name, toString().c_str());
···201201 JSONNode
202202 operator[](int i) const
203203 {
204204- JSON_ASSERTW(isArray(), "Trying to access index '%d' from non-array %s", i, toString().c_str());
204204+ JSON_ASSERTW(isArray(), "Trying to retrieve index '%d' from non-array %s", i, toString().c_str());
205205206206 cJSON *value = cJSON_GetArrayItem(cjson, i);
207207 JSON_ASSERTW(value != nullptr, "Unable to retrieve index %d from %s", i, toString().c_str());
···427427 * @brief Receives inputs and transitions the automata from state to state.
428428 *
429429 * This is the table of transitions. Can be thought of as three regular FSM
430430- * that get switched based on the stack's [top] value. The function is just
430430+ * that get switched based on the stack's [top] value. The function is
431431 * the implementation of the table.
432432 *
433433 * [top], [state], [symbol] -> [new-state], [stack-action]
+1-1
src/xrt/auxiliary/util/u_logging.h
···6666 void *data);
67676868/*!
6969- * For places where you really just want printf, prints a new-line.
6969+ * For places where you really want printf, prints a new-line.
7070 */
7171#define U_LOG_RAW(...) \
7272 do { \
+1-1
src/xrt/auxiliary/util/u_misc.h
···8080/*!
8181 * Reallocates or frees dynamically-allocated memory.
8282 *
8383- * Just wraps realloc with a return value check, freeing the provided memory if
8383+ * Wraps realloc with a return value check, freeing the provided memory if
8484 * it is NULL, to avoid leaks. Use U_ARRAY_REALLOC_OR_FREE() instead.
8585 *
8686 * @ingroup aux_util
+1-1
src/xrt/auxiliary/util/u_pacing.h
···120120 * @param[in] earliest_present_time_ns The earliest the GPU could have presented - might be before @p
121121 * actual_present_time_ns if a @p desired_present_time_ns was passed.
122122 * @param[in] present_margin_ns How "early" present happened compared to when it needed to happen in
123123- * order to hit @p earliestPresentTime.
123123+ * order to finish at @p earliestPresentTime.
124124 * @param[in] when_ns The time when we got the info, nominally from @ref
125125 * os_monotonic_get_ns
126126 *
+5-4
src/xrt/auxiliary/util/u_pacing_compositor.c
···645645pc_update_vblank_from_display_control(struct u_pacing_compositor *upc, uint64_t last_vblank_ns)
646646{
647647 /*
648648- * This is a no-op, here just in case display control is used at the
648648+ * This is a no-op, here in case display control is used at the
649649 * same time as the google extension. We ignore this call.
650650 */
651651}
···670670}
671671672672const struct u_pc_display_timing_config U_PC_DISPLAY_TIMING_CONFIG_DEFAULT = {
673673- // Just a wild guess.
673673+ // An arbitrary guess.
674674 .present_to_display_offset_ns = U_TIME_1MS_IN_NS * 4,
675675 .margin_ns = U_TIME_1MS_IN_NS,
676676 // Start by assuming the compositor takes 10% of the frame.
···695695 pc->base.destroy = pc_destroy;
696696 pc->frame_period_ns = estimated_frame_period_ns;
697697698698- // Estimate of how long after "present" the photons hit the eyes
698698+ // Estimate of how long after "present" the eyes see the photons
699699 pc->present_to_display_offset_ns = config->present_to_display_offset_ns;
700700701701 // Start at this of frame time.
702702 pc->comp_time_ns = get_percent_of_time(estimated_frame_period_ns, config->comp_time_fraction);
703703- // Max compositor time: if we ever hit this, write a better compositor.
703703+ // Max compositor time: if we ever reach this, write a better compositor. (using too much time per frame on the
704704+ // compositor)
704705 pc->comp_time_max_ns = get_percent_of_time(estimated_frame_period_ns, config->comp_time_max_fraction);
705706 // When missing, back off in these increments
706707 pc->adjust_missed_ns = get_percent_of_time(estimated_frame_period_ns, config->adjust_missed_fraction);
+1-1
src/xrt/auxiliary/util/u_pacing_compositor_fake.c
···202202 // To make sure the code can start from a non-zero frame id.
203203 ft->frame_id_generator = 5;
204204205205- // Just a wild guess.
205205+ // An arbitrary guess.
206206 ft->present_to_display_offset_ns = U_TIME_1MS_IN_NS * 4;
207207208208 // 20% of the frame time.
+1-1
src/xrt/auxiliary/util/u_process.h
···2121 * Creates a handle for this process that is unique to the operating system user. Returns NULL if another process
2222 * holding a handle is already running.
2323 *
2424- * @todo If built without libbsd support, a dummy value is returned that needs to be handled by the caller.
2424+ * @todo If built without libbsd support, a placeholder value is returned that needs to be handled by the caller.
2525 *
2626 * @return a new u_process handle if no monado instance is running, NULL if another instance is already running.
2727 * @ingroup aux_util
+2-3
src/xrt/auxiliary/util/u_sink_force_genlock.c
···7474 break;
7575 }
76767777- // Just in case.
7877 if (q->frames[0] == NULL || q->frames[1] == NULL) {
7978 continue;
8079 }
···8584 * We need to take a reference on the current frame, this is to
8685 * keep it alive during the call to the consumer should it be
8786 * replaced. But we no longer need to hold onto the frame on the
8888- * queue so we just move the pointer.
8787+ * queue so we move the pointer.
8988 */
9089 frames[0] = q->frames[0];
9190 frames[1] = q->frames[1];
···124123125124 /*
126125 * Average the timestamps, SLAM systems break if they don't have the exact same timestamp.
127127- * (This is dumb, because on DepthAI the images *are* taken like 0.1ms apart, and we *could* expose
126126+ * (This is not great, because on DepthAI the images *are* taken like 0.1ms apart, and we *could* expose
128127 * that, but oh well.)
129128 */
130129
+1-2
src/xrt/auxiliary/util/u_sink_queue.c
···148148 break;
149149 }
150150151151- // Just in case.
152151 if (queue_is_empty(q)) {
153152 continue;
154153 }
···160159 * We need to take a reference on the current frame, this is to
161160 * keep it alive during the call to the consumer should it be
162161 * replaced. But we no longer need to hold onto the frame on the
163163- * queue so we just dequeue it.
162162+ * queue so we dequeue it.
164163 */
165164 frame = queue_pop(q);
166165
+1-1
src/xrt/auxiliary/util/u_sink_simple_queue.c
···8686 * We need to take a reference on the current frame, this is to
8787 * keep it alive during the call to the consumer should it be
8888 * replaced. But we no longer need to hold onto the frame on the
8989- * queue so we just move the pointer.
8989+ * queue so we move the pointer.
9090 */
9191 frame = q->frame;
9292 q->frame = NULL;
+2-2
src/xrt/auxiliary/util/u_string_list.h
···107107/*!
108108 * @brief Append a new string literal to the list, if it's not the same as a string already in the list.
109109 *
110110- * (Comparing string contents, not just pointers)
110110+ * (Comparing string contents, not pointers)
111111 *
112112 * @param usl self pointer
113113 * @param str a non-null, null-terminated string that must live at least as long as the list, preferably a string
···122122/*!
123123 * @brief Check if the string is in the list.
124124 *
125125- * (Comparing string contents, not just pointers)
125125+ * (Comparing string contents, not pointers)
126126 *
127127 * @param usl self pointer
128128 * @param str a non-null, null-terminated string.
+2-2
src/xrt/auxiliary/util/u_string_list.hpp
···111111 /*!
112112 * @brief Check if the string is in the list.
113113 *
114114- * (Comparing string contents, not just pointers)
114114+ * (Comparing string contents, not pointers)
115115 *
116116 * @param str a non-null, null-terminated string.
117117 *
···131131 /*!
132132 * @brief Append a new string to the list if it doesn't match any existing string.
133133 *
134134- * (Comparing string contents, not just pointers)
134134+ * (Comparing string contents, not pointers)
135135 *
136136 * This does a simple linear search, because it is assumed that the size of this list is fairly small.
137137 *
+3-4
src/xrt/auxiliary/util/u_template_historybuf.hpp
···6969 /*!
7070 * @brief Logically remove the oldest element from the buffer.
7171 *
7272- * The value still remains in the backing container until overwritten, it just isn't accessible anymore.
7272+ * The value still remains in the backing container until overwritten, but it isn't accessible anymore.
7373 *
7474 * This invalidates iterators. They won't be poisoned, but they will return something you don't expect.
7575 */
···8080 }
81818282 /*!
8383- * @brief Access something at a given age, where age 0 is the most recent value, age 1 precedes it, etc.
8383+ * @brief Use a value at a given age, where age 0 is the most recent value, age 1 precedes it, etc.
8484 * (reverse chronological order)
8585 *
8686 * Out of bounds accesses will return nullptr.
···94949595 /*!
9696 * @brief Like get_at_age() but values larger than the oldest age are clamped.
9797- *
9897 */
9998 T *
10099 get_at_clamped_age(size_t age) noexcept
···118117 }
119118120119 /*!
121121- * @brief Access something at a given index, where 0 is the least-recent value still stored, index 1 follows it,
120120+ * @brief Use a value at a given index, where 0 is the least-recent value still stored, index 1 follows it,
122121 * etc. (chronological order)
123122 *
124123 * Out of bounds accesses will return nullptr.
···6464 return valid();
6565 }
66666767- //! Access the container: for internal use
6767+ //! Get the inner container: for internal use
6868 container_type *
6969 container() const noexcept
7070 {
···178178 if (index >= length_) {
179179 return false;
180180 }
181181- // Just add to the front (oldest) index and take modulo capacity_
181181+ // add to the front (oldest) index and take modulo capacity_
182182 out_inner_idx = (front_impl_() + index) % capacity_;
183183 return true;
184184}
···188188{
189189 // We always increment the latest inner index modulo capacity_
190190 latest_inner_idx_ = (latest_inner_idx_ + 1) % capacity_;
191191- // Length cannot exceed capacity_. If it already was capacity_, that just means we're overwriting something at
191191+ // Length cannot exceed capacity_. If it already was capacity_, that means we're overwriting something at
192192 // latest_inner_idx_
193193 length_ = std::min(length_ + 1, capacity_);
194194 return latest_inner_idx_;
···6060 return valid();
6161 }
62626363- //! Access the container: for internal use
6363+ //! Get the associated container: for internal use
6464 container_type *
6565 container() const noexcept
6666 {
+1-3
src/xrt/auxiliary/util/u_var.h
···175175 * side-effects.
176176 *
177177 * This is intended only for debugging and is turned off by default, as this all
178178- * very very unsafe. It is just pointers straight into objects, completely
178178+ * very very unsafe. It is only pointers straight into objects, completely
179179 * ignores ownership or any safe practices.
180180- *
181181- * If it's stupid, but it works, it ain't stupid.
182180 *
183181 * ```c
184182 * // On create
+1-1
src/xrt/auxiliary/util/u_win32_com_guard.cpp
···22// SPDX-License-Identifier: BSL-1.0
33/*!
44 * @file
55- * @brief An object that serves to keep the reference count of COM initialization above 0.
55+ * @brief An object that serves to keep the reference count of COM initialization greater than 0.
66 *
77 * @author Ryan Pavlik <ryan.pavlik@collabora.com>
88 * @ingroup aux_util
+1-1
src/xrt/auxiliary/util/u_win32_com_guard.hpp
···22// SPDX-License-Identifier: BSL-1.0
33/*!
44 * @file
55- * @brief An object that serves to keep the reference count of COM initialization above 0.
55+ * @brief An object that serves to keep the reference count of COM initialization greater than 0.
66 *
77 * @author Ryan Pavlik <ryan.pavlik@collabora.com>
88 * @ingroup aux_util
+2-2
src/xrt/auxiliary/util/u_worker.c
···217217 * work is outstanding what we should do then is increase the worker
218218 * limit and wait on the conditional.
219219 *
220220- * Similar to above, we where woken up, there are more work outstanding
220220+ * Similar to preceding, we were woken up, there are more work outstanding
221221 * on the group and we had been released, remove one released and up the
222222 * worker limit, then wait on the conditional.
223223 *
···225225 * submitted, then break out of the loop and decrement the released
226226 * count.
227227 *
228228- * As above, but we where one of many woken up but only one thread had
228228+ * As preceding, but we were one of many woken up but only one thread had
229229 * been released and that released count had been taken, then we should
230230 * do nothing and wait again.
231231 */