The open source OpenXR runtime
0
fork

Configure Feed

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

t/common: Refactor Nreal Air builder [NFC]

+25 -6
+25 -6
src/xrt/targets/common/target_builder_nreal_air.c
··· 86 86 DRV_TRACE_MARKER(); 87 87 88 88 nreal_air_log_level = debug_get_log_option_nreal_air_log(); 89 - struct u_system_devices *usysd = u_system_devices_allocate(); 89 + struct xrt_system_devices *xsysd = NULL; 90 + { 91 + struct u_system_devices *usysd = u_system_devices_allocate(); 92 + xsysd = &usysd->base; 93 + } 90 94 91 95 xret = xrt_prober_lock_list(xp, &xpdevs, &xpdev_count); 92 96 if (xret != XRT_SUCCESS) { ··· 132 136 NA_ERROR("Failed to initialise Nreal Air driver"); 133 137 goto fail; 134 138 } 135 - usysd->base.xdevs[usysd->base.xdev_count++] = na_device; 136 - usysd->base.roles.head = na_device; 139 + 140 + // Add to device list. 141 + xsysd->xdevs[xsysd->xdev_count++] = na_device; 142 + 143 + // Assign to role(s). 144 + xsysd->roles.head = na_device; 145 + 146 + 147 + /* 148 + * Done. 149 + */ 137 150 138 - *out_xsysd = &usysd->base; 139 - u_builder_create_space_overseer(&usysd->base, out_xso); 151 + *out_xsysd = xsysd; 152 + u_builder_create_space_overseer(xsysd, out_xso); 140 153 141 154 return XRT_SUCCESS; 142 155 156 + 157 + /* 158 + * Error path. 159 + */ 160 + 143 161 unlock_and_fail: 144 162 xret = xrt_prober_unlock_list(xp, &xpdevs); 145 163 if (xret != XRT_SUCCESS) { ··· 148 166 149 167 /* Fallthrough */ 150 168 fail: 151 - u_system_devices_destroy(&usysd); 169 + xrt_system_devices_destroy(&xsysd); 170 + 152 171 return XRT_ERROR_DEVICE_CREATION_FAILED; 153 172 } 154 173