From dbcf753b1edcccdf31545af639296c606d732c9a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 28 Nov 2023 18:43:27 +0000 Subject: [PATCH] t/common: Tidy builders a bit [NFC] --- .../common/target_builder_lighthouse.c | 1 + .../common/target_builder_north_star.c | 7 +++++ .../targets/common/target_builder_nreal_air.c | 30 ++++++++++++------- .../targets/common/target_builder_rift_s.c | 29 +++++++++++------- .../targets/common/target_builder_simulavr.c | 7 +++++ 5 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/xrt/targets/common/target_builder_lighthouse.c b/src/xrt/targets/common/target_builder_lighthouse.c index 19c6bf7a3..2f7444ea8 100644 --- a/src/xrt/targets/common/target_builder_lighthouse.c +++ b/src/xrt/targets/common/target_builder_lighthouse.c @@ -283,6 +283,7 @@ valve_index_hand_track(struct lighthouse_system *lhs, return false; } + /* * * Member functions. diff --git a/src/xrt/targets/common/target_builder_north_star.c b/src/xrt/targets/common/target_builder_north_star.c index 0501e9c8c..404b634bd 100644 --- a/src/xrt/targets/common/target_builder_north_star.c +++ b/src/xrt/targets/common/target_builder_north_star.c @@ -369,6 +369,13 @@ ns_setup_depthai_device(struct ns_builder *nsb, } #endif + +/* + * + * Member functions. + * + */ + // Note: We're just checking for the config file's existence static xrt_result_t ns_estimate_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_builder_estimate *estimate) diff --git a/src/xrt/targets/common/target_builder_nreal_air.c b/src/xrt/targets/common/target_builder_nreal_air.c index cb3663da8..189ea643d 100644 --- a/src/xrt/targets/common/target_builder_nreal_air.c +++ b/src/xrt/targets/common/target_builder_nreal_air.c @@ -32,14 +32,26 @@ enum u_logging_level nreal_air_log_level; #define NA_WARN(...) U_LOG_IFL_W(nreal_air_log_level, __VA_ARGS__) #define NA_ERROR(...) U_LOG_IFL_E(nreal_air_log_level, __VA_ARGS__) + /* * - * Defines & structs. + * Misc stuff. * */ DEBUG_GET_ONCE_LOG_OPTION(nreal_air_log, "NA_LOG", U_LOGGING_WARN) +static const char *driver_list[] = { + "nreal_air", +}; + + +/* + * + * Member functions. + * + */ + static xrt_result_t nreal_air_estimate_system(struct xrt_builder *xb, cJSON *config, @@ -181,21 +193,19 @@ fail: return XRT_ERROR_DEVICE_CREATION_FAILED; } -/* - * - * 'Exported' functions. - * - */ -static const char *driver_list[] = { - "nreal_air", -}; - static void nreal_air_destroy(struct xrt_builder *xb) { free(xb); } + +/* + * + * 'Exported' functions. + * + */ + struct xrt_builder * nreal_air_builder_create(void) { diff --git a/src/xrt/targets/common/target_builder_rift_s.c b/src/xrt/targets/common/target_builder_rift_s.c index 861d757c2..0da8fef4f 100644 --- a/src/xrt/targets/common/target_builder_rift_s.c +++ b/src/xrt/targets/common/target_builder_rift_s.c @@ -40,7 +40,7 @@ enum u_logging_level rift_s_log_level; /* * - * Defines & structs. + * Misc stuff. * */ @@ -50,6 +50,17 @@ DEBUG_GET_ONCE_LOG_OPTION(rift_s_log, "RIFT_S_LOG", U_LOGGING_WARN) DEBUG_GET_ONCE_BOOL_OPTION(rift_s_hand_tracking_as_controller, "RIFT_S_HAND_TRACKING_AS_CONTROLLERS", false) #endif +static const char *driver_list[] = { + "rift-s", +}; + + +/* + * + * Member functions. + * + */ + static xrt_result_t rift_s_estimate_system(struct xrt_builder *xb, cJSON *config, @@ -228,21 +239,19 @@ fail: return XRT_ERROR_DEVICE_CREATION_FAILED; } -/* - * - * 'Exported' functions. - * - */ -static const char *driver_list[] = { - "rift-s", -}; - static void rift_s_destroy(struct xrt_builder *xb) { free(xb); } + +/* + * + * 'Exported' functions. + * + */ + struct xrt_builder * rift_s_builder_create(void) { diff --git a/src/xrt/targets/common/target_builder_simulavr.c b/src/xrt/targets/common/target_builder_simulavr.c index da3cd4f44..bd2ce07bd 100644 --- a/src/xrt/targets/common/target_builder_simulavr.c +++ b/src/xrt/targets/common/target_builder_simulavr.c @@ -133,6 +133,13 @@ end: return good; } + +/* + * + * Member functions. + * + */ + static xrt_result_t svr_estimate_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_builder_estimate *estimate) {