xrt: Tidy xrt_instance_create argument order and add doc-comment

This commit is contained in:
Jakob Bornecrantz 2020-07-08 15:38:49 +01:00 committed by Jakob Bornecrantz
parent 323d794df3
commit deedd10a50
11 changed files with 23 additions and 19 deletions

View file

@ -226,6 +226,8 @@ xrt_instance_destroy(struct xrt_instance **xinst_ptr)
*
* Each target must implement this function.
*
* @param[in] ii A pointer to a info struct containing information about the
* application.
* @param[out] out_xinst A pointer to an xrt_instance pointer. Will be
* populated.
*
@ -234,8 +236,10 @@ xrt_instance_destroy(struct xrt_instance **xinst_ptr)
* @relates xrt_instance
*/
int
xrt_instance_create(struct xrt_instance **out_xinst,
struct xrt_instance_info *ii);
xrt_instance_create(struct xrt_instance_info *ii,
struct xrt_instance **out_xinst
);
/*!
* @}

View file

@ -183,8 +183,8 @@ ipc_client_instance_destroy(struct xrt_instance *xinst)
* @public @memberof ipc_instance
*/
int
ipc_instance_create(struct xrt_instance **out_xinst,
struct xrt_instance_info *i_info)
ipc_instance_create(struct xrt_instance_info *i_info,
struct xrt_instance **out_xinst)
{
struct ipc_client_instance *ii =
U_TYPED_CALLOC(struct ipc_client_instance);

View file

@ -384,7 +384,7 @@ init_all(struct ipc_server *s)
s->running = true;
s->exit_on_disconnect = debug_get_bool_option_exit_on_disconnect();
int ret = xrt_instance_create(&s->xinst, NULL);
int ret = xrt_instance_create(NULL, &s->xinst);
if (ret < 0) {
teardown_all(s);
return ret;

View file

@ -38,7 +38,7 @@ gui_prober_init(struct gui_program *p)
int ret = 0;
// Initialize the prober.
ret = xrt_instance_create(&p->instance, NULL);
ret = xrt_instance_create(NULL, &p->instance);
if (ret != 0) {
return do_exit(p, ret);
}

View file

@ -177,7 +177,7 @@ oxr_instance_create(struct oxr_logger *log,
sizeof(inst->xinst->instance_info.application_name), "%s",
createInfo->applicationInfo.applicationName);
xinst_ret = xrt_instance_create(&inst->xinst, &i_info);
xinst_ret = xrt_instance_create(&i_info, &inst->xinst);
if (xinst_ret != 0) {
ret = oxr_error(log, XR_ERROR_RUNTIME_FAILURE,
"Failed to create prober");

View file

@ -32,7 +32,7 @@ init(struct program *p)
int ret;
// Fist initialize the instance.
ret = xrt_instance_create(&p->xi, NULL);
ret = xrt_instance_create(NULL, &p->xi);
if (ret != 0) {
fprintf(stderr, "Failed to create instance\n");
return ret;

View file

@ -36,7 +36,7 @@ cli_cmd_probe(int argc, const char **argv)
// Initialize the prober.
printf(" :: Creating instance!\n");
ret = xrt_instance_create(&xi, NULL);
ret = xrt_instance_create(NULL, &xi);
if (ret != 0) {
return do_exit(&xi, 0);
}

View file

@ -36,7 +36,7 @@ cli_cmd_test(int argc, const char **argv)
// Initialize the prober.
printf(" :: Creating instance!\n");
ret = xrt_instance_create(&xi, NULL);
ret = xrt_instance_create(NULL, &xi);
if (ret != 0) {
return do_exit(&xi, 0);
}

View file

@ -35,8 +35,8 @@ t_instance_create_fd_compositor(struct xrt_instance *xinst,
*/
int
xrt_instance_create(struct xrt_instance **out_xinst,
struct xrt_instance_info *i_info)
xrt_instance_create(struct xrt_instance_info *i_info,
struct xrt_instance **out_xinst)
{
struct xrt_prober *xp = NULL;

View file

@ -29,8 +29,8 @@ t_instance_create_fd_compositor_stub(struct xrt_instance *xinst,
*/
int
xrt_instance_create(struct xrt_instance **out_xinst,
struct xrt_instance_info *i_info)
xrt_instance_create(struct xrt_instance_info *i_info,
struct xrt_instance **out_xinst)
{
struct xrt_prober *xp = NULL;

View file

@ -14,14 +14,14 @@
// Forward declaration
int
ipc_instance_create(struct xrt_instance **out_xinst,
struct xrt_instance_info *i_info);
ipc_instance_create(struct xrt_instance_info *i_info,
struct xrt_instance **out_xinst);
int
xrt_instance_create(struct xrt_instance **out_xinst,
struct xrt_instance_info *i_info)
xrt_instance_create(struct xrt_instance_info *i_info,
struct xrt_instance **out_xinst)
{
return ipc_instance_create(out_xinst, i_info);
return ipc_instance_create(i_info, out_xinst);
}
#else