diff --git a/src/xrt/auxiliary/vive/vive_config.c b/src/xrt/auxiliary/vive/vive_config.c index f7319880d..04badcf6c 100644 --- a/src/xrt/auxiliary/vive/vive_config.c +++ b/src/xrt/auxiliary/vive/vive_config.c @@ -167,14 +167,14 @@ _get_lighthouse(struct vive_config *d, const cJSON *json) map = NULL; d->lh.sensors = s; - d->lh.num_sensors = map_size; + d->lh.sensor_count = map_size; // Transform the sensors into IMU space. struct xrt_pose trackref_to_imu = XRT_POSE_IDENTITY; math_pose_invert(&d->imu.trackref, &trackref_to_imu); - for (i = 0; i < d->lh.num_sensors; i++) { + for (i = 0; i < d->lh.sensor_count; i++) { struct xrt_vec3 point = d->lh.sensors[i].pos; struct xrt_vec3 normal = d->lh.sensors[i].normal; @@ -527,7 +527,7 @@ vive_config_teardown(struct vive_config *config) if (config->lh.sensors != NULL) { free(config->lh.sensors); config->lh.sensors = NULL; - config->lh.num_sensors = 0; + config->lh.sensor_count = 0; } } diff --git a/src/xrt/auxiliary/vive/vive_config.h b/src/xrt/auxiliary/vive/vive_config.h index 125cb02ee..b277f2820 100644 --- a/src/xrt/auxiliary/vive/vive_config.h +++ b/src/xrt/auxiliary/vive/vive_config.h @@ -99,7 +99,7 @@ struct lh_sensor struct lh_model { struct lh_sensor *sensors; - size_t num_sensors; + size_t sensor_count; }; struct vive_config diff --git a/src/xrt/drivers/hdk/hdk_interface.h b/src/xrt/drivers/hdk/hdk_interface.h index d275dab26..3d3748643 100644 --- a/src/xrt/drivers/hdk/hdk_interface.h +++ b/src/xrt/drivers/hdk/hdk_interface.h @@ -35,7 +35,7 @@ extern "C" { int hdk_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev); diff --git a/src/xrt/drivers/hdk/hdk_prober.c b/src/xrt/drivers/hdk/hdk_prober.c index bb8942765..fad743b60 100644 --- a/src/xrt/drivers/hdk/hdk_prober.c +++ b/src/xrt/drivers/hdk/hdk_prober.c @@ -28,7 +28,7 @@ static const char HDK12_PRODUCT_STRING[] = "OSVR HDK 1.2"; int hdk_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev) diff --git a/src/xrt/drivers/hydra/hydra_driver.c b/src/xrt/drivers/hydra/hydra_driver.c index 174d82bdf..3d04ce47e 100644 --- a/src/xrt/drivers/hydra/hydra_driver.c +++ b/src/xrt/drivers/hydra/hydra_driver.c @@ -570,7 +570,7 @@ hydra_device_destroy(struct xrt_device *xdev) int hydra_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs) diff --git a/src/xrt/drivers/hydra/hydra_interface.h b/src/xrt/drivers/hydra/hydra_interface.h index 8ae7616e1..2400c605a 100644 --- a/src/xrt/drivers/hydra/hydra_interface.h +++ b/src/xrt/drivers/hydra/hydra_interface.h @@ -33,7 +33,7 @@ extern "C" { int hydra_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs); diff --git a/src/xrt/drivers/ohmd/oh_device.c b/src/xrt/drivers/ohmd/oh_device.c index b0700600c..6348a650c 100644 --- a/src/xrt/drivers/ohmd/oh_device.c +++ b/src/xrt/drivers/ohmd/oh_device.c @@ -1154,10 +1154,10 @@ oh_device_create(ohmd_context *ctx, bool no_hmds, struct xrt_device **out_xdevs) } /* Probe for devices */ - int num_devices = ohmd_ctx_probe(ctx); + int device_count = ohmd_ctx_probe(ctx); /* Then loop */ - for (int i = 0; i < num_devices; i++) { + for (int i = 0; i < device_count; i++) { int device_class = 0, device_flags = 0; const char *prod = NULL; diff --git a/src/xrt/drivers/psmv/psmv_driver.c b/src/xrt/drivers/psmv/psmv_driver.c index bb37919e1..700bca2e7 100644 --- a/src/xrt/drivers/psmv/psmv_driver.c +++ b/src/xrt/drivers/psmv/psmv_driver.c @@ -995,7 +995,7 @@ static struct xrt_binding_profile binding_profiles[1] = { int psmv_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs) diff --git a/src/xrt/drivers/psmv/psmv_interface.h b/src/xrt/drivers/psmv/psmv_interface.h index 5e5a66910..f594e97f0 100644 --- a/src/xrt/drivers/psmv/psmv_interface.h +++ b/src/xrt/drivers/psmv/psmv_interface.h @@ -33,7 +33,7 @@ extern "C" { int psmv_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs); diff --git a/src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp b/src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp index 0dfae0b6c..0a7c560b3 100644 --- a/src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp +++ b/src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp @@ -380,7 +380,7 @@ ulv2_device_destroy(struct xrt_device *xdev) int ulv2_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev) diff --git a/src/xrt/drivers/ultraleap_v2/ulv2_interface.h b/src/xrt/drivers/ultraleap_v2/ulv2_interface.h index 40c5843db..53efe1ef5 100644 --- a/src/xrt/drivers/ultraleap_v2/ulv2_interface.h +++ b/src/xrt/drivers/ultraleap_v2/ulv2_interface.h @@ -25,7 +25,7 @@ extern "C" { int ulv2_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev); diff --git a/src/xrt/drivers/vive/vive_prober.c b/src/xrt/drivers/vive/vive_prober.c index 29233c23a..d4e395f45 100644 --- a/src/xrt/drivers/vive/vive_prober.c +++ b/src/xrt/drivers/vive/vive_prober.c @@ -63,7 +63,7 @@ static int init_vive1(struct xrt_prober *xp, struct xrt_prober_device *dev, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, enum u_logging_level ll, struct xrt_device **out_xdev) { @@ -77,7 +77,7 @@ init_vive1(struct xrt_prober *xp, struct os_hid_device *sensors_dev = NULL; struct os_hid_device *watchman_dev = NULL; - for (uint32_t i = 0; i < num_devices; i++) { + for (uint32_t i = 0; i < device_count; i++) { struct xrt_prober_device *d = devices[i]; if (d->vendor_id != VALVE_VID && d->product_id != VIVE_LIGHTHOUSE_FPGA_RX) @@ -134,7 +134,7 @@ static int init_vive_pro(struct xrt_prober *xp, struct xrt_prober_device *dev, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, enum u_logging_level ll, struct xrt_device **out_xdev) { @@ -151,7 +151,7 @@ init_vive_pro(struct xrt_prober *xp, struct os_hid_device *sensors_dev = NULL; struct os_hid_device *watchman_dev = NULL; - for (uint32_t i = 0; i < num_devices; i++) { + for (uint32_t i = 0; i < device_count; i++) { struct xrt_prober_device *d = devices[i]; if (d->vendor_id != VALVE_VID && d->product_id != VIVE_PRO_LHR_PID) @@ -208,7 +208,7 @@ static int init_valve_index(struct xrt_prober *xp, struct xrt_prober_device *dev, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, enum u_logging_level ll, struct xrt_device **out_xdevs) { @@ -283,7 +283,7 @@ init_valve_index(struct xrt_prober *xp, int vive_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev) @@ -302,9 +302,9 @@ vive_found(struct xrt_prober *xp, } switch (dev->product_id) { - case VIVE_PID: return init_vive1(xp, dev, devices, num_devices, ll, out_xdev); - case VIVE_PRO_MAINBOARD_PID: return init_vive_pro(xp, dev, devices, num_devices, ll, out_xdev); - case VIVE_PRO_LHR_PID: return init_valve_index(xp, dev, devices, num_devices, ll, out_xdev); + case VIVE_PID: return init_vive1(xp, dev, devices, device_count, ll, out_xdev); + case VIVE_PRO_MAINBOARD_PID: return init_vive_pro(xp, dev, devices, device_count, ll, out_xdev); + case VIVE_PRO_LHR_PID: return init_valve_index(xp, dev, devices, device_count, ll, out_xdev); default: U_LOG_E("No product ids matched %.4x", dev->product_id); return -1; } @@ -314,7 +314,7 @@ vive_found(struct xrt_prober *xp, int vive_controller_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs) diff --git a/src/xrt/drivers/vive/vive_prober.h b/src/xrt/drivers/vive/vive_prober.h index b18a53092..becac8894 100644 --- a/src/xrt/drivers/vive/vive_prober.h +++ b/src/xrt/drivers/vive/vive_prober.h @@ -47,7 +47,7 @@ extern "C" { int vive_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev); @@ -61,7 +61,7 @@ vive_found(struct xrt_prober *xp, int vive_controller_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs); diff --git a/src/xrt/drivers/wmr/wmr_interface.h b/src/xrt/drivers/wmr/wmr_interface.h index c6821e1f5..56f5d59f4 100644 --- a/src/xrt/drivers/wmr/wmr_interface.h +++ b/src/xrt/drivers/wmr/wmr_interface.h @@ -31,7 +31,7 @@ extern "C" { int wmr_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev); diff --git a/src/xrt/drivers/wmr/wmr_prober.c b/src/xrt/drivers/wmr/wmr_prober.c index cf4307ed5..24bbcc58f 100644 --- a/src/xrt/drivers/wmr/wmr_prober.c +++ b/src/xrt/drivers/wmr/wmr_prober.c @@ -72,7 +72,7 @@ check_and_get_interface_lenovo(struct xrt_prober_device *device, static bool find_control_device(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, enum u_logging_level ll, enum wmr_headset_type *out_hmd_type, struct xrt_prober_device **out_device, @@ -81,7 +81,7 @@ find_control_device(struct xrt_prober *xp, struct xrt_prober_device *dev = NULL; int interface = 0; - for (size_t i = 0; i < num_devices; i++) { + for (size_t i = 0; i < device_count; i++) { bool match = false; if (devices[i]->bus != XRT_BUS_TYPE_USB) { @@ -131,7 +131,7 @@ find_control_device(struct xrt_prober *xp, int wmr_found(struct xrt_prober *xp, struct xrt_prober_device **devices, - size_t num_devices, + size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev) @@ -153,7 +153,7 @@ wmr_found(struct xrt_prober *xp, return -1; } - if (!find_control_device(xp, devices, num_devices, ll, &hmd_type, &dev_ctrl, &interface_ctrl)) { + if (!find_control_device(xp, devices, device_count, ll, &hmd_type, &dev_ctrl, &interface_ctrl)) { U_LOG_IFL_E(ll, "Did not find companion control device." "\n\tCurrently only Reverb G1 and G2 is supported");