mirror of
https://github.com/lbgos/rift-s-linux.git
synced 2026-10-29 04:02:05 +01:00
t/common: Refactor QWERTY builder [NFC]
This commit is contained in:
1 parent
d9329d1c7c
commit
841fc7c644
1 file changed
+21
-9
@@ -87,21 +87,33 @@ qwerty_open_system(struct xrt_builder *xb,
|
||||
return xret;
|
||||
}
|
||||
|
||||
struct u_system_devices *usysd = u_system_devices_allocate();
|
||||
usysd->base.roles.head = head;
|
||||
usysd->base.roles.left = left;
|
||||
usysd->base.roles.right = right;
|
||||
struct xrt_system_devices *xsysd = NULL;
|
||||
{
|
||||
struct u_system_devices *usysds = u_system_devices_allocate();
|
||||
xsysd = &usysds->base;
|
||||
}
|
||||
|
||||
usysd->base.xdevs[usysd->base.xdev_count++] = head;
|
||||
// Add to device list.
|
||||
xsysd->xdevs[xsysd->xdev_count++] = head;
|
||||
if (left != NULL) {
|
||||
usysd->base.xdevs[usysd->base.xdev_count++] = left;
|
||||
xsysd->xdevs[xsysd->xdev_count++] = left;
|
||||
}
|
||||
if (right != NULL) {
|
||||
usysd->base.xdevs[usysd->base.xdev_count++] = right;
|
||||
xsysd->xdevs[xsysd->xdev_count++] = right;
|
||||
}
|
||||
|
||||
*out_xsysd = &usysd->base;
|
||||
u_builder_create_space_overseer(&usysd->base, out_xso);
|
||||
// Assign to role(s).
|
||||
xsysd->roles.head = head;
|
||||
xsysd->roles.left = left;
|
||||
xsysd->roles.right = right;
|
||||
|
||||
|
||||
/*
|
||||
* Done.
|
||||
*/
|
||||
|
||||
*out_xsysd = xsysd;
|
||||
u_builder_create_space_overseer(xsysd, out_xso);
|
||||
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user