The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/util: Improve word choice/clarity

+49 -52
+1 -1
src/xrt/auxiliary/util/u_builders.c
··· 66 66 67 67 results->xpdevs[results->xpdev_count++] = xpdev; 68 68 69 - // Abort if full. 69 + // Exit if full. 70 70 if (results->xpdev_count >= ARRAY_SIZE(results->xpdevs)) { 71 71 return; 72 72 }
+1 -1
src/xrt/auxiliary/util/u_device.c
··· 214 214 } 215 215 } 216 216 { 217 - /* left eye - just mirroring right eye now */ 217 + /* left eye - mirroring right eye */ 218 218 xdev->hmd->distortion.fov[0].angle_up = xdev->hmd->distortion.fov[1].angle_up; 219 219 xdev->hmd->distortion.fov[0].angle_down = xdev->hmd->distortion.fov[1].angle_down; 220 220
+1 -1
src/xrt/auxiliary/util/u_device.h
··· 76 76 u_device_setup_split_side_by_side(struct xrt_device *xdev, const struct u_device_simple_info *info); 77 77 78 78 /*! 79 - * Just setup the device's display's 2D extents. 79 + * Setup the device's display's 2D extents. 80 80 * Good for headsets without traditional VR optics. 81 81 * 82 82 * @return true on success.
+1 -1
src/xrt/auxiliary/util/u_distortion.h
··· 60 60 * Values to create a distortion mesh from cardboard values. 61 61 * 62 62 * This matches the formula in the cardboard SDK, while the array is fixed size 63 - * just setting the K value to zero will make it not have a effect. 63 + * setting the K value to zero will make it not have a effect. 64 64 * 65 65 * p' = p (1 + K0 r^2 + K1 r^4 + ... + Kn r^(2n)) 66 66 *
+1 -1
src/xrt/auxiliary/util/u_documentation.h
··· 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file 5 - * @brief Header with just documentation. 5 + * @brief Header with only documentation. 6 6 * @author Jakob Bornecrantz <jakob@collabora.com> 7 7 * @ingroup aux_util 8 8 */
+1 -1
src/xrt/auxiliary/util/u_frame.c
··· 56 56 { 57 57 struct xrt_frame *xf = U_TYPED_CALLOC(struct xrt_frame); 58 58 59 - // Paranoia: Explicitly only copy the fields we want 59 + // Explicitly only copy the fields we want 60 60 xf->width = to_copy->width; 61 61 xf->height = to_copy->height; 62 62 xf->stride = to_copy->stride;
+2 -2
src/xrt/auxiliary/util/u_hashset.cpp
··· 81 81 extern "C" int 82 82 u_hashset_create_and_insert_str(struct u_hashset *hs, const char *str, size_t length, struct u_hashset_item **out_item) 83 83 { 84 - struct u_hashset_item *dummy = NULL; 84 + struct u_hashset_item *unused = NULL; 85 85 struct u_hashset_item *item = NULL; 86 86 size_t size = 0; 87 87 int ret; 88 88 89 - ret = u_hashset_find_str(hs, str, length, &dummy); 89 + ret = u_hashset_find_str(hs, str, length, &unused); 90 90 if (ret >= 0) { 91 91 return -1; 92 92 }
+1 -1
src/xrt/auxiliary/util/u_id_ringbuffer.cpp
··· 31 31 32 32 namespace { 33 33 34 - // just enough iterator to get it done: basically copy and paste from u_template_historybuf_const_iterator.inl 34 + // just-enough iterator to get it done: basically copy and paste from u_template_historybuf_const_iterator.inl 35 35 struct IdRingbufferIterator : public RandomAccessIteratorBase<const RingBufferHelper> 36 36 { 37 37 using base = RandomAccessIteratorBase<const RingBufferHelper>;
+2 -2
src/xrt/auxiliary/util/u_id_ringbuffer.h
··· 19 19 /** 20 20 * Container type to let you store IDs in a ring buffer, and maybe your own data in your own parallel array. 21 21 * 22 - * The IDs are just uint64_t. If you don't need any of the order-dependent functionality, you can treat use them for any 22 + * The IDs are uint64_t. If you don't need any of the order-dependent functionality, you can treat use them for any 23 23 * purpose you like. 24 24 * 25 25 * Some functionality requires that IDs be pushed in increasing order, but it's highlighted in the docs. ··· 187 187 /** 188 188 * Find the element with the supplied ID @p search_id in an unordered buffer. 189 189 * 190 - * This does *not* depend on order so just does a linear search. If you are keeping your IDs in ascending order, use 190 + * This does *not* depend on order so does a linear search. If you are keeping your IDs in ascending order, use 191 191 * u_id_ringbuffer_lower_bound_id() instead. 192 192 * 193 193 * @param uirb self pointer
+4 -3
src/xrt/auxiliary/util/u_iterator_base.hpp
··· 65 65 } 66 66 67 67 /*! 68 - * @brief True if this iterator is "irrecoverably" invalid (aka, cleared/default constructed). 68 + * @brief True if this iterator is "irrecoverably" invalid (that is, cleared or default constructed). 69 69 * 70 70 * Implies !valid() but is stronger. `buf.end().is_cleared()` is false. 71 71 */ ··· 128 128 129 129 130 130 /** 131 - * @brief Default constructor - initializes to "cleared" aka irrecoverably invalid 131 + * @brief Default constructor - initializes to "cleared" (that is, irrecoverably invalid - because we have no 132 + * reference to a container) 132 133 */ 133 134 RandomAccessIteratorBase() = default; 134 135 ··· 172 173 void 173 174 decrement_n(std::size_t n); 174 175 175 - //! Access the container or helper 176 + //! Get the associated container or helper 176 177 ContainerOrHelper * 177 178 container() const noexcept 178 179 {
+4 -4
src/xrt/auxiliary/util/u_json.hpp
··· 89 89 public: 90 90 // Class resource management 91 91 92 - //! This is public just so that make_shared works; do not use outside of this file. 92 + //! This is public so that make_shared works; do not use outside of this file. 93 93 JSONNode(cJSON *cjson, bool is_owner, const JSONNode::Ptr &parent) 94 94 : cjson(cjson), is_owner(is_owner), parent(parent) 95 95 {} ··· 190 190 operator[](const string &key) const 191 191 { 192 192 const char *name = key.c_str(); 193 - JSON_ASSERTW(isObject(), "Trying to access field '%s' from non-object %s", name, toString().c_str()); 193 + JSON_ASSERTW(isObject(), "Trying to retrieve field '%s' from non-object %s", name, toString().c_str()); 194 194 195 195 cJSON *value = cJSON_GetObjectItemCaseSensitive(cjson, name); 196 196 JSON_ASSERTW(value != nullptr, "Unable to retrieve field '%s' from %s", name, toString().c_str()); ··· 201 201 JSONNode 202 202 operator[](int i) const 203 203 { 204 - JSON_ASSERTW(isArray(), "Trying to access index '%d' from non-array %s", i, toString().c_str()); 204 + JSON_ASSERTW(isArray(), "Trying to retrieve index '%d' from non-array %s", i, toString().c_str()); 205 205 206 206 cJSON *value = cJSON_GetArrayItem(cjson, i); 207 207 JSON_ASSERTW(value != nullptr, "Unable to retrieve index %d from %s", i, toString().c_str()); ··· 427 427 * @brief Receives inputs and transitions the automata from state to state. 428 428 * 429 429 * This is the table of transitions. Can be thought of as three regular FSM 430 - * that get switched based on the stack's [top] value. The function is just 430 + * that get switched based on the stack's [top] value. The function is 431 431 * the implementation of the table. 432 432 * 433 433 * [top], [state], [symbol] -> [new-state], [stack-action]
+1 -1
src/xrt/auxiliary/util/u_logging.h
··· 66 66 void *data); 67 67 68 68 /*! 69 - * For places where you really just want printf, prints a new-line. 69 + * For places where you really want printf, prints a new-line. 70 70 */ 71 71 #define U_LOG_RAW(...) \ 72 72 do { \
+1 -1
src/xrt/auxiliary/util/u_misc.h
··· 80 80 /*! 81 81 * Reallocates or frees dynamically-allocated memory. 82 82 * 83 - * Just wraps realloc with a return value check, freeing the provided memory if 83 + * Wraps realloc with a return value check, freeing the provided memory if 84 84 * it is NULL, to avoid leaks. Use U_ARRAY_REALLOC_OR_FREE() instead. 85 85 * 86 86 * @ingroup aux_util
+1 -1
src/xrt/auxiliary/util/u_pacing.h
··· 120 120 * @param[in] earliest_present_time_ns The earliest the GPU could have presented - might be before @p 121 121 * actual_present_time_ns if a @p desired_present_time_ns was passed. 122 122 * @param[in] present_margin_ns How "early" present happened compared to when it needed to happen in 123 - * order to hit @p earliestPresentTime. 123 + * order to finish at @p earliestPresentTime. 124 124 * @param[in] when_ns The time when we got the info, nominally from @ref 125 125 * os_monotonic_get_ns 126 126 *
+5 -4
src/xrt/auxiliary/util/u_pacing_compositor.c
··· 645 645 pc_update_vblank_from_display_control(struct u_pacing_compositor *upc, uint64_t last_vblank_ns) 646 646 { 647 647 /* 648 - * This is a no-op, here just in case display control is used at the 648 + * This is a no-op, here in case display control is used at the 649 649 * same time as the google extension. We ignore this call. 650 650 */ 651 651 } ··· 670 670 } 671 671 672 672 const struct u_pc_display_timing_config U_PC_DISPLAY_TIMING_CONFIG_DEFAULT = { 673 - // Just a wild guess. 673 + // An arbitrary guess. 674 674 .present_to_display_offset_ns = U_TIME_1MS_IN_NS * 4, 675 675 .margin_ns = U_TIME_1MS_IN_NS, 676 676 // Start by assuming the compositor takes 10% of the frame. ··· 695 695 pc->base.destroy = pc_destroy; 696 696 pc->frame_period_ns = estimated_frame_period_ns; 697 697 698 - // Estimate of how long after "present" the photons hit the eyes 698 + // Estimate of how long after "present" the eyes see the photons 699 699 pc->present_to_display_offset_ns = config->present_to_display_offset_ns; 700 700 701 701 // Start at this of frame time. 702 702 pc->comp_time_ns = get_percent_of_time(estimated_frame_period_ns, config->comp_time_fraction); 703 - // Max compositor time: if we ever hit this, write a better compositor. 703 + // Max compositor time: if we ever reach this, write a better compositor. (using too much time per frame on the 704 + // compositor) 704 705 pc->comp_time_max_ns = get_percent_of_time(estimated_frame_period_ns, config->comp_time_max_fraction); 705 706 // When missing, back off in these increments 706 707 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
··· 202 202 // To make sure the code can start from a non-zero frame id. 203 203 ft->frame_id_generator = 5; 204 204 205 - // Just a wild guess. 205 + // An arbitrary guess. 206 206 ft->present_to_display_offset_ns = U_TIME_1MS_IN_NS * 4; 207 207 208 208 // 20% of the frame time.
+1 -1
src/xrt/auxiliary/util/u_process.h
··· 21 21 * Creates a handle for this process that is unique to the operating system user. Returns NULL if another process 22 22 * holding a handle is already running. 23 23 * 24 - * @todo If built without libbsd support, a dummy value is returned that needs to be handled by the caller. 24 + * @todo If built without libbsd support, a placeholder value is returned that needs to be handled by the caller. 25 25 * 26 26 * @return a new u_process handle if no monado instance is running, NULL if another instance is already running. 27 27 * @ingroup aux_util
+2 -3
src/xrt/auxiliary/util/u_sink_force_genlock.c
··· 74 74 break; 75 75 } 76 76 77 - // Just in case. 78 77 if (q->frames[0] == NULL || q->frames[1] == NULL) { 79 78 continue; 80 79 } ··· 85 84 * We need to take a reference on the current frame, this is to 86 85 * keep it alive during the call to the consumer should it be 87 86 * replaced. But we no longer need to hold onto the frame on the 88 - * queue so we just move the pointer. 87 + * queue so we move the pointer. 89 88 */ 90 89 frames[0] = q->frames[0]; 91 90 frames[1] = q->frames[1]; ··· 124 123 125 124 /* 126 125 * Average the timestamps, SLAM systems break if they don't have the exact same timestamp. 127 - * (This is dumb, because on DepthAI the images *are* taken like 0.1ms apart, and we *could* expose 126 + * (This is not great, because on DepthAI the images *are* taken like 0.1ms apart, and we *could* expose 128 127 * that, but oh well.) 129 128 */ 130 129
+1 -2
src/xrt/auxiliary/util/u_sink_queue.c
··· 148 148 break; 149 149 } 150 150 151 - // Just in case. 152 151 if (queue_is_empty(q)) { 153 152 continue; 154 153 } ··· 160 159 * We need to take a reference on the current frame, this is to 161 160 * keep it alive during the call to the consumer should it be 162 161 * replaced. But we no longer need to hold onto the frame on the 163 - * queue so we just dequeue it. 162 + * queue so we dequeue it. 164 163 */ 165 164 frame = queue_pop(q); 166 165
+1 -1
src/xrt/auxiliary/util/u_sink_simple_queue.c
··· 86 86 * We need to take a reference on the current frame, this is to 87 87 * keep it alive during the call to the consumer should it be 88 88 * replaced. But we no longer need to hold onto the frame on the 89 - * queue so we just move the pointer. 89 + * queue so we move the pointer. 90 90 */ 91 91 frame = q->frame; 92 92 q->frame = NULL;
+2 -2
src/xrt/auxiliary/util/u_string_list.h
··· 107 107 /*! 108 108 * @brief Append a new string literal to the list, if it's not the same as a string already in the list. 109 109 * 110 - * (Comparing string contents, not just pointers) 110 + * (Comparing string contents, not pointers) 111 111 * 112 112 * @param usl self pointer 113 113 * @param str a non-null, null-terminated string that must live at least as long as the list, preferably a string ··· 122 122 /*! 123 123 * @brief Check if the string is in the list. 124 124 * 125 - * (Comparing string contents, not just pointers) 125 + * (Comparing string contents, not pointers) 126 126 * 127 127 * @param usl self pointer 128 128 * @param str a non-null, null-terminated string.
+2 -2
src/xrt/auxiliary/util/u_string_list.hpp
··· 111 111 /*! 112 112 * @brief Check if the string is in the list. 113 113 * 114 - * (Comparing string contents, not just pointers) 114 + * (Comparing string contents, not pointers) 115 115 * 116 116 * @param str a non-null, null-terminated string. 117 117 * ··· 131 131 /*! 132 132 * @brief Append a new string to the list if it doesn't match any existing string. 133 133 * 134 - * (Comparing string contents, not just pointers) 134 + * (Comparing string contents, not pointers) 135 135 * 136 136 * This does a simple linear search, because it is assumed that the size of this list is fairly small. 137 137 *
+3 -4
src/xrt/auxiliary/util/u_template_historybuf.hpp
··· 69 69 /*! 70 70 * @brief Logically remove the oldest element from the buffer. 71 71 * 72 - * The value still remains in the backing container until overwritten, it just isn't accessible anymore. 72 + * The value still remains in the backing container until overwritten, but it isn't accessible anymore. 73 73 * 74 74 * This invalidates iterators. They won't be poisoned, but they will return something you don't expect. 75 75 */ ··· 80 80 } 81 81 82 82 /*! 83 - * @brief Access something at a given age, where age 0 is the most recent value, age 1 precedes it, etc. 83 + * @brief Use a value at a given age, where age 0 is the most recent value, age 1 precedes it, etc. 84 84 * (reverse chronological order) 85 85 * 86 86 * Out of bounds accesses will return nullptr. ··· 94 94 95 95 /*! 96 96 * @brief Like get_at_age() but values larger than the oldest age are clamped. 97 - * 98 97 */ 99 98 T * 100 99 get_at_clamped_age(size_t age) noexcept ··· 118 117 } 119 118 120 119 /*! 121 - * @brief Access something at a given index, where 0 is the least-recent value still stored, index 1 follows it, 120 + * @brief Use a value at a given index, where 0 is the least-recent value still stored, index 1 follows it, 122 121 * etc. (chronological order) 123 122 * 124 123 * Out of bounds accesses will return nullptr.
+1 -1
src/xrt/auxiliary/util/u_template_historybuf_const_iterator.inl
··· 64 64 return valid(); 65 65 } 66 66 67 - //! Access the container: for internal use 67 + //! Get the inner container: for internal use 68 68 container_type * 69 69 container() const noexcept 70 70 {
+2 -2
src/xrt/auxiliary/util/u_template_historybuf_impl_helpers.hpp
··· 178 178 if (index >= length_) { 179 179 return false; 180 180 } 181 - // Just add to the front (oldest) index and take modulo capacity_ 181 + // add to the front (oldest) index and take modulo capacity_ 182 182 out_inner_idx = (front_impl_() + index) % capacity_; 183 183 return true; 184 184 } ··· 188 188 { 189 189 // We always increment the latest inner index modulo capacity_ 190 190 latest_inner_idx_ = (latest_inner_idx_ + 1) % capacity_; 191 - // Length cannot exceed capacity_. If it already was capacity_, that just means we're overwriting something at 191 + // Length cannot exceed capacity_. If it already was capacity_, that means we're overwriting something at 192 192 // latest_inner_idx_ 193 193 length_ = std::min(length_ + 1, capacity_); 194 194 return latest_inner_idx_;
+1 -1
src/xrt/auxiliary/util/u_template_historybuf_iterator.inl
··· 60 60 return valid(); 61 61 } 62 62 63 - //! Access the container: for internal use 63 + //! Get the associated container: for internal use 64 64 container_type * 65 65 container() const noexcept 66 66 {
+1 -3
src/xrt/auxiliary/util/u_var.h
··· 175 175 * side-effects. 176 176 * 177 177 * This is intended only for debugging and is turned off by default, as this all 178 - * very very unsafe. It is just pointers straight into objects, completely 178 + * very very unsafe. It is only pointers straight into objects, completely 179 179 * ignores ownership or any safe practices. 180 - * 181 - * If it's stupid, but it works, it ain't stupid. 182 180 * 183 181 * ```c 184 182 * // On create
+1 -1
src/xrt/auxiliary/util/u_win32_com_guard.cpp
··· 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file 5 - * @brief An object that serves to keep the reference count of COM initialization above 0. 5 + * @brief An object that serves to keep the reference count of COM initialization greater than 0. 6 6 * 7 7 * @author Ryan Pavlik <ryan.pavlik@collabora.com> 8 8 * @ingroup aux_util
+1 -1
src/xrt/auxiliary/util/u_win32_com_guard.hpp
··· 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file 5 - * @brief An object that serves to keep the reference count of COM initialization above 0. 5 + * @brief An object that serves to keep the reference count of COM initialization greater than 0. 6 6 * 7 7 * @author Ryan Pavlik <ryan.pavlik@collabora.com> 8 8 * @ingroup aux_util
+2 -2
src/xrt/auxiliary/util/u_worker.c
··· 217 217 * work is outstanding what we should do then is increase the worker 218 218 * limit and wait on the conditional. 219 219 * 220 - * Similar to above, we where woken up, there are more work outstanding 220 + * Similar to preceding, we were woken up, there are more work outstanding 221 221 * on the group and we had been released, remove one released and up the 222 222 * worker limit, then wait on the conditional. 223 223 * ··· 225 225 * submitted, then break out of the loop and decrement the released 226 226 * count. 227 227 * 228 - * As above, but we where one of many woken up but only one thread had 228 + * As preceding, but we were one of many woken up but only one thread had 229 229 * been released and that released count had been taken, then we should 230 230 * do nothing and wait again. 231 231 */